On Aug 8, 2009, at 12:00 PM, [email protected] wrote:
> In this example, we have "dlg = MyDialog(self)" which instantiates
> your
> MyDialog class as dlg. My question is how do I turn a dialog I've
> designed in
> the class designer into a class that I can refer to in this way?
The class is created dynamically from the cdxml; the way to do this is:
dlg = dabo.ui.createForm("mydialog.cdxml", self)
You call createForm with the path to the dialog file (it will find it
if you have it in the 'ui' folder and use the standard directory
structure), and include any parameters you need to pass after the file
name.
> I can't
> seem to save the dialog form as anything but "cdxml" -- (why not
> as python
> code?)
Because generated code is evil and hackish. It is also not re-
entrant: once you generate the code, you can no longer edit it with
the designer tool.
> -- I'm guessing there's a way to define the class using this cdxml
> file? Is there a tool that will convert cdxml to python?
Not permanently; it is much, much better to do this dynamically using
createForm()
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]