wxDialog why not call wxDialog.__init__ in example ?

This is from the example demo app.

class TestDialog(wxDialog):
    def __init__(self, parent, ID, title,
                 pos=wxDefaultPosition, size=wxDefaultSize,
                 style=wxDEFAULT_DIALOG_STYLE):

        # Instead of calling wxDialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI dialog using the Create
        # method.
        pre = wxPreDialog()
        pre.SetExtraStyle(wxDIALOG_EX_CONTEXTHELP)
        pre.Create(parent, ID, title, pos, size, style)

Could someone more clearly explain what this SetExtraStyle is ?

There are some styles that can only be set at creation time, otherwise they
won't have any effect.
SetExtraStyle is a way to set - well extra styles, thus modifying the beaviour
of the control. The extra styles are not part of the flags when you __init__
something. Instead they must be set with the SetExtraStyle command. Since you
have to set them at create time you have to do a 2 step init.

  UC

···

On Friday 11 July 2003 07:51 am, Geiregat Jonas wrote:

This is from the example demo app.

class TestDialog(wxDialog):
    def __init__(self, parent, ID, title,
                 pos=wxDefaultPosition, size=wxDefaultSize,
                 style=wxDEFAULT_DIALOG_STYLE):

        # Instead of calling wxDialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI dialog using the Create
        # method.
        pre = wxPreDialog()
        pre.SetExtraStyle(wxDIALOG_EX_CONTEXTHELP)
        pre.Create(parent, ID, title, pos, size, style)

Could someone more clearly explain what this SetExtraStyle is ?

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417

Uwe C. Schroeder wrote:

···

On Friday 11 July 2003 07:51 am, Geiregat Jonas wrote:

This is from the example demo app.

class TestDialog(wxDialog):
   def __init__(self, parent, ID, title,
                pos=wxDefaultPosition, size=wxDefaultSize,
                style=wxDEFAULT_DIALOG_STYLE):

       # Instead of calling wxDialog.__init__ we precreate the dialog
       # so we can set an extra style that must be set before
       # creation, and then we create the GUI dialog using the Create
       # method.
       pre = wxPreDialog()
       pre.SetExtraStyle(wxDIALOG_EX_CONTEXTHELP)
       pre.Create(parent, ID, title, pos, size, style)

Could someone more clearly explain what this SetExtraStyle is ?

There are some styles that can only be set at creation time, otherwise they won't have any effect.
SetExtraStyle is a way to set - well extra styles, thus modifying the beaviour of the control. The extra styles are not part of the flags when you __init__ something. Instead they must be set with the SetExtraStyle command. Since you have to set them at create time you have to do a 2 step init.

Just a little more clarification: Since the style parameter is a 32-bit value that means that the number of styles are limited to 32. After those were used up then the extra styles were added. Not all extra styles need to be set at creation time, but the wxDIALOG_EX_CONTEXTHELP is one that does.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!