wxmenubar
Description
A wxmenubar object provides the menu bar where the various menus are located that are associated with a given window. A menu bar object can only be associated with one window at a time. It can also exist independently of being hosted within a window.
Type Tags
None
Object Value
wxmenubar.new()
Description
Creates a new wxmenubar object.
Prototype
wxmenubar
.new
()
Parameters
None
Properties
Property | Type | Description |
---|---|---|
_ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. |
__ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property. |
firstentry | wxmenubarentry | This property holds a reference to the first menu attached to the menu bar. |
type | type | Specifies the wxmenubar type object. |
window | wxwindow | This property holds a reference to the window where the menu bar is hosted. |
Methods
delete()
Description
Deletes a menu from the menu bar.
Prototype
wxmenubarvar
.delete
(
wxmenu
)
menu
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
menu | None | wxmenu | The menu that is to be deleted from the menu bar. |
deleteall()
Description
Deletes all menues from the menu bar.
Prototype
wxmenubarvar
.deleteall
()
Parameters
None
insert()
Description
Inserts a menu into the menu bar. The wxmenubar object itself is returned, to allow multiple insertions to be put into one expression.
Prototype
wxmenubarvar
.insert
(
wxmenu
,
string menu
,
integer label
,
boolean position
,
string enabled
)
name
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
menu | None | wxmenu | The wxmenu object that is being inserted. |
label | "" | string | The label for the menu. |
position | Current entry count plus one | integer | The place where the menu is to be inserted. By default, it will be appended to the end. |
enabled | .true | boolean | Indicates whether the menu is enabled or disabled. |
name | .nul | string | This is the name of the menu. It is not required, but can be useful if the menu is to be manipulated using the member (!) operator. |
setwindow()
Description
Creates the menu bar in the target window.
Prototype
wxmenubarvar
.setwindow
(
wxwindow
)
window
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
window | None | wxwindow | The window that will host the menu bar. |
wxmenubar!
Get
The member operator followed by the name of a menu bar entry returns a
reference to the wxmenubarentry object. To access a menu
associated with a menu bar entry using only the menu bar object, the
code would look like this: mb!file.menu
where
mb
is the menu bar object and
file
is the name that was assigned when the menu
was inserted. If the name provided is not correct (including
case-sensitivity), then an error will occur.
Set
Attempting to assign a reference or a value to a wxmenubar object using the ! operator is not supported.