Cees De Groot
2006-07-19 15:18:02 UTC
Hi,
I have an XRC file (attached) created with wxGlade. There are two
issues with this I cannot seem to solve... Here's what I do with the
XRC:
DGVMessageDialogMetVinkjePresenter >>view
| res |
view ifNil: [
res := WxXmlResource new.
res initAllHandlers.
res loadFromString: self class resourceText.
view := res loadObject: nil name: 'dialog_1' className: 'wxDialog'.
res destroy].
^view
DGVMessageDialogMetVinkjePresenter >>connectView
| messageField |
messageField _ self view findWindowByName: 'message'.
messageField setLabel: 'this is a test. It is a bit longer than a
single line, so we can check whether this is really a good idea,
you know the painting and stuff...'.
okButton _ self view findWindowByName: 'okButton'.
okButton on: #wxEvtCommandButtonClicked send: #okButtonClicked: to: self.
self view getSizer setSizeHints: self view
Test code:
dlg _ DGVMessageDialogMetVinkjePresenter new.
dlg connectView.
dlg view showModal
Two things don't really work out right. In wxGlade, on the sizer
there's a button "fit parent". It will resize the dialog according to
whatever label you've set on the message field. If tried different
things here (the #setSizeHints: being the last attempt), but I cannot
seem to get the dialog to resize around the text. Further, my
#okButtonClicked: never triggers....
Is there anything I'm missing? Generally or XRC related? This is my
first attempt at using XRC, being fed up with creating handcoded
#createView methods :)
TIA,
Cees
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DGVMessageDialogMetVinkjePresenter.xrc
Type: application/octet-stream
Size: 1795 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/wxsqueak/attachments/20050726/6dd62069/DGVMessageDialogMetVinkjePresenter.obj
I have an XRC file (attached) created with wxGlade. There are two
issues with this I cannot seem to solve... Here's what I do with the
XRC:
DGVMessageDialogMetVinkjePresenter >>view
| res |
view ifNil: [
res := WxXmlResource new.
res initAllHandlers.
res loadFromString: self class resourceText.
view := res loadObject: nil name: 'dialog_1' className: 'wxDialog'.
res destroy].
^view
DGVMessageDialogMetVinkjePresenter >>connectView
| messageField |
messageField _ self view findWindowByName: 'message'.
messageField setLabel: 'this is a test. It is a bit longer than a
single line, so we can check whether this is really a good idea,
you know the painting and stuff...'.
okButton _ self view findWindowByName: 'okButton'.
okButton on: #wxEvtCommandButtonClicked send: #okButtonClicked: to: self.
self view getSizer setSizeHints: self view
Test code:
dlg _ DGVMessageDialogMetVinkjePresenter new.
dlg connectView.
dlg view showModal
Two things don't really work out right. In wxGlade, on the sizer
there's a button "fit parent". It will resize the dialog according to
whatever label you've set on the message field. If tried different
things here (the #setSizeHints: being the last attempt), but I cannot
seem to get the dialog to resize around the text. Further, my
#okButtonClicked: never triggers....
Is there anything I'm missing? Generally or XRC related? This is my
first attempt at using XRC, being fed up with creating handcoded
#createView methods :)
TIA,
Cees
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DGVMessageDialogMetVinkjePresenter.xrc
Type: application/octet-stream
Size: 1795 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/wxsqueak/attachments/20050726/6dd62069/DGVMessageDialogMetVinkjePresenter.obj