Debian Codegraph @

doc/classes/MenuButton.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="MenuButton" inherits="Button" keywords="dropdown" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A button that brings up a [PopupMenu] when clicked.
5 </brief_description>
6 <description>
7 A button that brings up a [PopupMenu] when clicked. To create new items inside this [PopupMenu], use [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from Godot editor's inspector.
8 See also [BaseButton] which contains common properties and methods associated with this node.
9 </description>
10 <tutorials>
11 </tutorials>
12 <methods>
13 <method name="get_popup" qualifiers="const">
14 <return type="PopupMenu" />
15 <description>
16 Returns the [PopupMenu] contained in this button.
17 [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
18 </description>
19 </method>
20 <method name="set_disable_shortcuts">
21 <return type="void" />
22 <param index="0" name="disabled" type="bool" />
23 <description>
24 If [code]true[/code], shortcuts are disabled and cannot be used to trigger the button.
25 </description>
26 </method>
27 <method name="show_popup">
28 <return type="void" />
29 <description>
30 Adjusts popup position and sizing for the [MenuButton], then shows the [PopupMenu]. Prefer this over using [code]get_popup().popup()[/code].
31 </description>
32 </method>
33 </methods>
34 <members>
35 <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" />
36 <member name="flat" type="bool" setter="set_flat" getter="is_flat" overrides="Button" default="true" />
37 <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="3" />
38 <member name="item_count" type="int" setter="set_item_count" getter="get_item_count" default="0">
39 The number of items currently in the list.
40 </member>
41 <member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false">
42 If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [member switch_on_hover] enabled, it will close the current [MenuButton] and open the other one.
43 </member>
44 <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
45 </members>
46 <signals>
47 <signal name="about_to_popup">
48 <description>
49 Emitted when the [PopupMenu] of this MenuButton is about to show.
50 </description>
51 </signal>
52 </signals>
53 </class>