On Jan 31, 2007, at 12:53 PM, wccppp wrote:
> After making changes to couple of lines, the dialog behaves almost > the same > as the pure wxPython version when dragged. I noticed the OK, > Cancel button > is not horizontally centered when form is dragged. Is it the intended > behavior? In the file dabo\ui\uiwx\dDialog.py where class > dOkCancelDialog > is defined, I changed line 218 from > bs.append(buttonSizer, "x") to > bs.append(buttonSizer, "x", halign="center") > I thought this will keep the button horiz. centered. But didn't.
This is a special case that is a matter of interface guidelines in action. The sizer for the buttons is not a regular sizer, but a wx.StdDialogButtonSizer. It is supposed to determine the position of the OK/Cancel buttons in a platform-independent way to conform with each platform's standards. If you had used a standard dDialog class and added the buttons manually using dSizer, that would have indeed been the correct code.
> One more question, how do I set a title to the frame?
Every control that has an associated piece of identifying text has a 'Caption' property. This is done to make Dabo much more consistent than the way that wxPython does things, which could involve a call to SetTitle(), SetCaption(), or SetText(). So for a frame ('form' in Dabo-speak), you could do it one of two ways: in the constructor call, or with an object reference. These two do the same thing:
frm = dabo.ui.dForm(None, Caption="Foo")
- or, given a 'frm' reference:
frm.Caption = "Foo"
-- Ed Leafe -- http://leafe.com -- http://dabodev.com
©2007 Ed Leafe |