[Q] wxPython - layout & placement

Rolf Marvin Bøe Lindgren roffe at aqualene.uio.no
Fri Jul 19 12:17:23 EDT 2002


I'm trying to place a button in a dialog window.  this works:

        dlg = wxDialog(parent,-1,FileName,size=(400,400))

        wxButton (parent=dlg,
                  id = -1,
                  label = 'This is a button',
                  pos=(10,10))

        dlg.ShowModal()

but I'd like to use layout controls.  I've figured out how to do it
with wxPanel, but wxDialog doesn't seem to work the same way.  the
example on <URL:http://www.wxpython.org/tut-part2.php> 

        b = wxButton(self.panelA, 100, ' Panel A ')
        lc = wxLayoutConstraints()
        lc.centreX.SameAs (self.panelA, wxCentreX)
        lc.centreY.SameAs (self.panelA, wxCentreY)
        lc.height.AsIs ()
        lc.width.PercentOf (self.panelA, wxWidth, 50)
        b.SetConstraints(lc)

does not work if the parent object is a wxDialog. 

any clues?  


-- 
Rolf Lindgren                                            http://www.roffe.com/
roffe at tag.uio.no



More information about the Python-list mailing list