wxRuby Documentation Home

# Wx::StaticBox

A static box is a rectangle drawn around other panel items to denote
a logical grouping of items.

Please note that a static box should not be used as the parent for the
controls it contains, instead they should be siblings of each other. Although
using a static box as a parent might work in some versions of Widgets, it
results in a crash under, for example, GTK.

Also, please note that because of this, the order in which you create new
controls is important. Create your StaticBox control before any
siblings that are to appear inside the StaticBox in order to preserve the
correct Z-Order of controls.

## Derived from

Control

Window

EvtHandler

Object

## Window styles

There are no special styles for this control.

See also window styles overview.

## See also

StaticText

## Methods

- StaticBox.new
- StaticBox#create

### StaticBox.new

StaticBox.new(%(arg-type)Window% parent, Integer id, String label, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = 0, String name = “staticBox”)

Constructor, creating and showing a static box.

#### Parameters

- parent Parent window. Must not be NULL.
- id Window identifier. A value of -1 indicates a default value.
- label Text to be displayed in the static box, the empty string for no label.
- pos Window position. If the position (-1, -1) is specified then a default position is chosen.
- size Checkbox size. If the size (-1, -1) is specified then a default size is chosen.
- style Window style. See StaticBox.
- name Window name.

#### See also

StaticBox#create

destructor()

Destructor, destroying the group box.

### StaticBox#create

Boolean create(%(arg-type)Window% parent, Integer id, String label, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = 0, String name = “staticBox”)

Creates the static box for two-step construction. See StaticBox.new for further details.

[This page automatically generated from the Textile source at 2023-06-09 00:45:37 +0000]