hi rob in the latest 1.1 you can have a look at SettingBrowser has an example. in botsinc book image there is the code of a minibrowser you can also take as example. open | window | Cursor wait showWhile: [window := StandardWindow new model: self. window title: self windowTitle. self buildWindowIn: window. window themeChanged. window openInWorld. ^ window] buildWindowIn: aWindow | statusView toolBar treeMorph toolBarY gap localGap menuBar menuBarY | treeMorph := self treeMorphIn: aWindow. statusView := self statusViewIn: aWindow. toolBar := self toolBarIn: aWindow. menuBar := self menuBarIn: aWindow. menuBar submorphs ifEmpty: [menuBarY := 0] ifNotEmpty: [menuBarY := menuBar minExtent y. aWindow addMorph: menuBar fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0) offsets: (0 @ 0 corner: 0 @ menuBarY))]. localGap := 5. gap := localGap + menuBarY. toolBarY := toolBar minExtent y + gap. aWindow addMorph: toolBar fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0) offsets: (0 @ (gap ) corner: 0 @ (toolBarY + localGap))). aWindow addMorph: treeMorph fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0.99) offsets: (0 @ (toolBarY + localGap + localGap) corner: 0 @ 100 negated)). aWindow addMorph: statusView fullFrame: (LayoutFrame fractions: (0 @ 0.99 corner: 1 @ 1) offsets: (0 @ 100 negated corner: 0 @ 0)). ^ aWindow On Dec 5, 2009, at 10:45 PM, Rob Rothwell wrote:
I just can't seem to figure this out from the UITheme examples.
Can anyone give me some general pointers on building a plain old Window? I know there isn't a UI builder, but how do you control the placement of the child controls you create in the window?
For example, the following will create a StandardWindow and add a button to it (in the upper left corner). Do you control placement [of the button] with LayoutFrame? How do you use LayoutFrame?
| win btnOk |
win := StandardWindow new. btnOk := win newButtonFor: nil action: #ok getEnabled: nil label: 'Ok' help: nil. win addMorph: btnOk . win themeChanged; openInWorld.
Thank you. I am finally trying to understand how to build some typical applications without a GUI builder...
Take care,
Rob _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project