Hi,
I'm having trouble using a layout manager with wxDialog. If I add a panel
to a wxDialog, and then set constraints on the panel, the constraints are
never used when the dialog is displayed. I was wondering if I was doing
something wrong or if wxDialog just isn't supposed to handle window objects
with layout constraints. I've attached code below which illustrates what I'm
talking about.
Thanks,
Seth.
···
___________________________________________________________________
from wxPython.wx import *
class GUIList:
def __init__(self, parent, ID, title, position=wxDefaultPosition):
win = wxDialog(parent, ID, title, position, wxSize(350, 200))
listPanel = wxPanel(win, -1)
button = wxButton(listPanel, 12, "add", wxPoint(0,0))
listPanelLC = wxLayoutConstraints()
listPanelLC.top.SameAs(win, wxTop)
listPanelLC.bottom.SameAs(win, wxBottom)
listPanelLC.left.SameAs(win, wxLeft)
listPanelLC.right.SameAs(win, wxRight)
buttonLC = wxLayoutConstraints()
buttonLC.centreX.SameAs(win, wxCentreX)
buttonLC.centreY.SameAs(win, wxCentreY)
buttonLC.height.AsIs()
buttonLC.width.AsIs()
listPanel.SetConstraints(listPanelLC)
button.SetConstraints(buttonLC)
val = win.ShowModal()
if val == wxID_OK:
print "You pressed OK"
else:
print "You pressed Cancel"
class App(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "")
frame.Show(true)
GUIList(frame, -2, "")
self.SetTopWindow(frame)
return true
app = App(0)
app.MainLoop()
---------------------------------------------------
My opinions are my own, I don't speak for Intel
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users