MenuButton

A menu button widget displays a textual label and/or image, and displays a menu when pressed.

Constructors

this
this(UiElement parent, string text, Menu menu, string direction)

Construct the widget.

this
this(string text, Menu menu, string direction)

Construct the widget.

Inherited Members

From TextWidget

_textVariable
string _textVariable;
Undocumented in source.
_image
Image _image;
Undocumented in source.
setText
auto setText(string text)

Set the widget text.

getText
string getText()

Get the widget text.

setImage
auto setImage(Image image, string imagePosition)

Set the image for this widget.

setImagePosition
auto setImagePosition(string imagePosition)

Change the position of the image in relation to the text.

setTextCharacterWidth
auto setTextCharacterWidth(int characterWidth)

Set the text character width.

destroy
void destroy()

Destroy this widget.

__anonymous
mixin Underline

Mixin common commands.

Examples

auto menu = new Menu()
	.addEntry("Entry 1", delegate(CommandArgs args){ ... })
	.addEntry("Entry 2", delegate(CommandArgs args){ ... });

auto menuButton = new MenuButton("Text", menu)
	.pack();

Additional Events

Additional events that can also be bound to using the bind method.

<<Invoke>>, <<PrevWindow>>, <Alt-Key>, <B1-Leave>, <Button-1>, <ButtonRelease-1>, <Enter>, <Key-F10>, <Key-Tab>, <Key-space>, <Leave>,

Styles: Menu button widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.

See Also

Meta