wxRuby Documentation Home

Wx::StaticText

A static text control displays one or more lines of read-only text.

Derived from

Control

Window

EvtHandler

Object

Window styles

ALIGN_LEFT Align the text to the left
ALIGN_RIGHT Align the text to the right
ALIGN_CENTRE Center the text (horizontally)
ST_NO_AUTORESIZE By default, the control willadjust its size to exactly fit to the size of the text when set_label is called. If this style flag isgiven, the control will not change its size (this style is especially usefulwith controls which also have ALIGN_RIGHT or CENTER style because otherwisethey won’t make sense any longer after a call to SetLabel)

See also window styles overview.

See also

StaticBitmap, StaticBox

Methods

StaticText.new

StaticText.new(Window parent,  Integer id,  String label, 
               Point pos = DEFAULT_POSITION, 
               Size size = DEFAULT_SIZE, 
               Integer style = 0, 
               String name = "staticText")

Constructor, creating and showing a text control.

Parameters

See also

StaticText#create

StaticText#create

Boolean create(Window parent,  Integer id,  String label, 
               Point pos = DEFAULT_POSITION, 
               Size size = DEFAULT_SIZE, 
               Integer style = 0, 
               String name = "staticText")

Creation function, for two-step construction. For details see StaticText.new.

StaticText#get_label

String get_label()

Returns the contents of the control.

StaticText#set_label

set_label(String label)

Sets the static text label and updates the controls size to exactly fit the label unless the control has ST_NO_AUTORESIZE flag.

Parameters

StaticText#wrap

wrap(Integer width)

This functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long). If width is negative, no wrapping is done.

2.6.2

[This page automatically generated from the Textile source at Wed Sep 09 02:21:24 +0100 2009]