2.1.2 area-container<%>

► |  | GUI: Racket Graphics Toolkit

1 | Overview
2 | Reference
3 | Configuration
4 | Dynamic Loading
| Bibliography
| Index

► | 2 | Reference

2.1 | Windowing Classes
2.2 | Windowing Functions
2.3 | Drawing Classes
2.4 | Drawing Functions
2.5 | Editor Classes
2.6 | Editor Functions
2.7 | WXME Decoding

▼ | 2.1 | Windowing Classes

2.1.1 | area<%>
2.1.2 | area-container<%>
2.1.3 | area-container-window<%>
2.1.4 | button%
2.1.5 | canvas<%>
2.1.6 | canvas%
2.1.7 | check-box%
2.1.8 | checkable-menu-item%
2.1.9 | choice%
2.1.10 | clipboard-client%
2.1.11 | clipboard<%>
2.1.12 | combo-field%
2.1.13 | control<%>
2.1.14 | control-event%
2.1.15 | cursor%
2.1.16 | dialog%
2.1.17 | event%
2.1.18 | frame%
2.1.19 | gauge%
2.1.20 | group-box-panel%
2.1.21 | grow-box-spacer-pane%
2.1.22 | horizontal-pane%
2.1.23 | horizontal-panel%
2.1.24 | key-event%
2.1.25 | labelled-menu-item<%>
2.1.26 | list-box%
2.1.27 | list-control<%>
2.1.28 | menu%
2.1.29 | menu-bar%
2.1.30 | menu-item<%>
2.1.31 | menu-item%
2.1.32 | menu-item-container<%>
2.1.33 | message%
2.1.34 | mouse-event%
2.1.35 | pane%
2.1.36 | panel%
2.1.37 | popup-menu%
2.1.38 | radio-box%
2.1.39 | selectable-menu-item<%>
2.1.40 | separator-menu-item%
2.1.41 | scroll-event%
2.1.42 | slider%
2.1.43 | subarea<%>
2.1.44 | subwindow<%>
2.1.45 | tab-panel%
2.1.46 | text-field%
2.1.47 | timer%
2.1.48 | top-level-window<%>
2.1.49 | vertical-pane%
2.1.50 | vertical-panel%
2.1.51 | window<%>

On this page:

add-child
after-new-child
begin-container-sequence
border
change-children
container-flow-modified
container-size
delete-child
end-container-sequence
get-alignment
get-children
place-children
reflow-container
set-alignment
spacing

Inherited methods:
from area<%>
get-graphical-min-size
get-parent
get-top-level-window
min-height
min-width
stretchable-height
stretchable-width

top← prev up next →

area-container<%> : interface?

implements: | area<%>

An area-container<%> is a container area<%>.

All area-container<%> classes accept the following named instantiation arguments:

- border – default is 0; passed to border

- spacing – default is 0; passed to spacing

- alignment – default is class-specific, such as '(center top) for vertical-panel%; the list elements are passed to set-alignment

( send an-area-container add-child child) → void?
child : ( is-a?/c subwindow<%>)

Add the given subwindow to the set of non-deleted children. See also change-children.

( send an-area-container after-new-child child) → void?
child : ( is-a?/c subarea<%>)

Specification: This method is called after a new containee area is created with this area as its container. The new child is provided as an argument to the method.

Default implementation: Does nothing.

( send an-area-container begin-container-sequence) → void?

Suspends geometry management in the container’s top-level window until end-container-sequence is called. The begin-container-sequence and end-container-sequence methods are used to bracket a set of container modifications so that the resulting geometry is computed only once. A container sequence also delays show and hide actions by change-children, as well as the on-screen part of showing via show until the sequence is complete. Sequence begin and end commands may be nested arbitrarily deep.

( send an-area-container border) → ( integer-in 0 1000)
( send an-area-container border margin) → void?
margin : ( integer-in 0 1000)

Gets or sets the border margin for the container in pixels. This margin is used as an inset into the panel’s client area before the locations and sizes of the subareas are computed.

( send an-area-container change-children filter) → void?

filter

:

(( listof ( is-a?/c subarea<%>))
. -> . ( listof ( is-a?/c subarea<%>)))

Takes a filter procedure and changes the container’s list of non-deleted children. The filter procedure takes a list of children areas and returns a new list of children areas. The new list must consist of children that were created as subareas of this area (i.e., change-children cannot be used to change the parent of a subarea).

After the set of non-deleted children is changed, the container computes the sets of newly deleted and newly non-deleted children. Newly deleted windows are hidden. Newly non-deleted windows are shown.

Since non-window areas cannot be hidden, non-window areas cannot be deleted. If the filter procedure removes non-window subareas, an exception is raised and the set of non-deleted children is not changed.

( send an-area-container container-flow-modified) → void?

Call this method when the result changes for an overridden flow-defining method, such as place-children. The call notifies the geometry manager that the placement of the container’s children needs to be recomputed.

The reflow-containermethod only recomputes child positions when the geometry manager thinks that the placement has changed since the last computation.

( send an-area-container container-size info)

→

( integer-in 0 10000) |  | ( integer-in 0 10000)

info

:

( listof ( list/c ( integer-in 0 10000)
( integer-in 0 10000)
any/c
any/c))

Called to determine the minimum size of a container. See Geometry Management for more information.

( send an-area-container delete-child child) → void?
child : ( is-a?/c subwindow<%>)

Removes the given subwindow from the list of non-deleted children. See also change-children.

( send an-area-container end-container-sequence) → void?

See begin-container-sequence.

( send an-area-container get-alignment)

→

(symbols/c right center left)
(symbols/c bottom center top)

Returns the container’s current alignment specification. See set-alignment for more information.

( send an-area-container get-children)
→ ( listof ( is-a?/c subarea<%>))

Returns a list of the container’s non-deleted children. (The non-deleted children are the ones currently managed by the container; deleted children are generally hidden.) The order of the children in the list is significant. For example, in a vertical panel, the first child in the list is placed at the top of the panel.

( send an-area-container place-children |  | info |
|  | width |
|  | height) |

→

( listof ( list/c ( integer-in 0 10000)
( integer-in 0 10000)
( integer-in 0 10000)
( integer-in 0 10000)))

info

:

( listof ( list/c ( integer-in 0 10000)
( integer-in 0 10000)
any/c
any/c))

width : ( integer-in 0 10000)
height : ( integer-in 0 10000)

Called to place the children of a container. See Geometry Management for more information.

( send an-area-container reflow-container) → void?

When a container window is not shown, changes to the container’s set of children do not necessarily trigger the immediate re-computation of the container’s size and its children’s sizes and positions. Instead, the recalculation is delayed until the container is shown, which avoids redundant computations between a series of changes. The reflow-container method forces the immediate recalculation of the container’s and its children’s sizes and locations.

Immediately after calling the reflow-container method, get-size, get-client-size, get-width, get-height, get-x, and get-y report the manager-applied sizes and locations for the container and its children, even when the container is hidden. A container implementation can call functions such as get-size at any time to obtain the current state of a window (because the functions do not trigger geometry management).

See also container-flow-modified.

( send an-area-container set-alignment |  | horiz-align |  |  |  |
|  | vert-align) |  | → |  | void?

horiz-align : (symbols/c right center left)
vert-align : (symbols/c bottom center top)

Sets the alignment specification for a container, which determines how it positions its children when the container has leftover space (when a child was not stretchable in a particular dimension).

When the container’s horizontal alignment is 'left, the children are left-aligned in the container and whitespace is inserted to the right. When the container’s horizontal alignment is 'center, each child is horizontally centered in the container. When the container’s horizontal alignment is 'right, leftover whitespace is inserted to the left.

Similarly, a container’s vertical alignment can be 'top, 'center, or 'bottom.

( send an-area-container spacing) → ( integer-in 0 1000)
( send an-area-container spacing spacing) → void?
spacing : ( integer-in 0 1000)

Gets or sets the spacing, in pixels, used between subareas in the container. For example, a vertical panel inserts this spacing between each pair of vertically aligned subareas (with no extra space at the top or bottom).
top← prev up next →