Forum: Poser Python Scripting


Subject: pzrXml20--New widgets, stream-lined workflow

PoseWorks opened this issue on Nov 28, 2005 ยท 1 posts


PoseWorks posted Mon, 28 November 2005 at 10:41 PM

Attached Link: Download pzrXml20

I've just finished the docs for the new version of pzrXml, a dynamic dialog module for Poser 6. --- New in this version: **Module Name: pzrXml20** You should import pzrXml20 instead of pzrXml to use the new features. **PzrDialog** This class replaces both the old XmlManager and the widget's place method. Here's the revised workflow: dlg = PzrDialog(width=320, height=240) label = PzrMessage("Hello world!") dlg.add(label, 160, 110) dlg.add(PzrOkButton(), 260, 210) dlg.Show() **PzrValueButton (and family)** New widgets that ask for and store values. For instance, clicking a PzrFileButton will open the file browser, and then store the resulting file path. You can use a PzrValueButton's get() method to retrieve the stored value. You can easily extend PzrValueButton to make your own value-storing widgets with filtered display text and values. The other new value button widgets are: PzrDirButton, PzrFileButton, PzrFloatButton, PzrIntButton, PzrPickImageButton, and PzrMenuButton. **PzrImageButton** Like PzrButton, but uses an image of your choosing rather than the default button graphic. **AskDirectory** Like AskOpen and AskSave, this pops up a directory chooser that doesn't change the current working directory. **PzrWidget Attribute: callback** Many PzrWidgets can now be created with a callback attribute, which should equal either None or a function that takes one argument. The function will be run when the widget is clicked. myButton = PzrButton("Click me!", callback=myFunction) **PzrWidget Attribute: width, height** These replace the bb and rect attributes to define the size of a widget. myImage = PzrImage("My Image", width=32, height=16) **PzrRadioPane Method: setOnClick(function)** This method can assign a function to be called whenever a radio button is clicked. The function should be able to take one argument, which is the radio button's name. **Clicking PzrRadio/PzrCheck Text** You can now click a PzrRadio/PzrCheck's text to toggle its selection, rather than having to click right on the checkbox or radiobutton. --- The help files have been fully updated for all new features. Like its predacessor, you cannot redistribute PzrXml 2.0 without prior permission.