> <\body> In what follows can be anything defined using . <\explain> )>> <|explain> This does just that: it centers with respect to the enclosing widget. Although we are calling this an attribute, the effect is achieved by using a vertical list and a horizontal one together with four widgets. This means that in the following example, the first widget is actually expanded to something like the second one. <\session|scheme|default> <\unfolded-io|Scheme] > (tm-widget (wid1) \ \ (centered (text "I'm centered."))) <|unfolded-io> ((guile-user) (guile-user)) <\folded-io|Scheme] > (tm-widget (wid2) \ \ (vlist \ \ \ \ (glue #f #f 0 10) \ \ \ \ (hlist \ \ \ \ \ \ (glue #t #f 25 0) \ \ \ \ \ \ (text "I'm centered.") \ \ \ \ \ \ (glue #t #f 25 0)) \ \ \ \ (glue #f #f 0 10))) <|folded-io> ((guile-user) (guile-user)) <\input|Scheme] > (show wid1) <\input|Scheme] > (show wid2) <\explain> ) ( ) )> )>> <|explain> These two variants resize the argument. The first one specifies a minimum size of >, a default size of > and a maximum size of >. will be set to the default size and will be allowed to resize but not beyond the bounds specified. The second alternative sets a fixed width and height. Sizes are specified as strings with a unit suffix, like in . <\session|scheme|default> <\unfolded-io|Scheme] > (tm-widget (wid) \ \ (resize "200px" "70px" (text "I'm stuck!"))) <|unfolded-io> \; <\input|Scheme] > (show wid) <\explain> )> by padding> <|explain> This sets some fixed padding around . As in the case of , the effect is achieved by means of several widgets into which this macro expands. These are actually the same as in the example there, but the widgets are all fixed (i.e. have all their expansion parameters set to ). You can arrange widgets horizontally or vertically, or in two column mode as in forms. When running the QT version the latter will default to the OS standard for arranging labels and their associated input widgets in dialogs. Other possibilities are splitters and tabbed widgets. A very useful macro is , which allows you to embed one widget into another. <\explain> )> <|explain> \; <\explain> )> <|explain> \; <\explain> )> <|explain> \; <\explain> )) (item ()) ...)> <|explain> \; <\explain> )) (tab ()) ...)> <|explain> \; <\explain> ))> <|explain> \; Besides laying out widgets in containers, you will often want to specify how they eat up space around them when the user resizes the window. By default (most?) widgets take up as much space as they can (i.e. they always expand) unless you used with them or they can have their size set with a parameter. If you don't want this to happen you can place invisible spacers around them which will (if you tell them to) gobble up as much as they can, either vertically or horizontally or in both directions. provides one such basic building block: <\explain> )> <|explain> The first two parameters, and , are of boolean type and specify whether the widget will try to expand horizontally or vertically when its surroundings do. The last two parameters, , either fix the size for non-expanding or set a minimum one. <\session|scheme|default> <\unfolded-io|Scheme] > (tm-widget (wid1) \ \ (centered (text "I'm centered."))) <|unfolded-io> \; <\unfolded-io|Scheme] > (tm-widget (wid2) \ \ (vlist \ \ \ \ === \ \ \ \ (hlist \ \ \ \ \ \ (glue #t #f 25 0) \ \ \ \ \ \ (text "I'm centered.") \ \ \ \ \ \ (glue #t #f 25 0)) \ \ \ \ (glue #f #f 0 10))) <|unfolded-io> \; <\input|Scheme] > (show wid1) <\input|Scheme] > (show wid2) In addition to the basic widget, there are several convenience macros. <\explain> <|explain> Expands to . <\explain> <|explain> Expands to . <\explain> <|explain> Expands to . <\explain> <|explain> Expands to . <\explain> \> <|explain> Expands to . <\explain> \\> <|explain> Expands to . For the specific use in menus the following two macros are defined: <\explain> <|explain> (A vertical bar) <\explain> <|explain> (Three dashes) Refresh widgets redraw their contents every time a command is executed. They achieve this re-evaluating the code for the whole widget, so you can have new values in your variables... team.> >