PGButton
from panda3d.core import PGButton
- class PGButton
Bases:
PGItem
This is a particular kind of PGItem that is specialized to behave like a normal button object. It keeps track of its own state, and handles mouse events sensibly.
Inheritance diagram
- SDepressed = 1
- SInactive = 3
- SReady = 0
- SRollover = 2
- S_depressed = 1
- S_inactive = 3
- S_ready = 0
- S_rollover = 2
- __init__(*args, **kwargs)
- addClickButton()
C++ Interface: add_click_button(const PGButton self, const ButtonHandle button)
- /**
Adds the indicated button to the set of buttons that can effectively
“click” the PGButton. Normally, this is just MouseButton::one(). Returns
true if the button was added, or false if it was already there.
*/
- add_click_button()
C++ Interface: add_click_button(const PGButton self, const ButtonHandle button)
- /**
Adds the indicated button to the set of buttons that can effectively
“click” the PGButton. Normally, this is just MouseButton::one(). Returns
true if the button was added, or false if it was already there.
*/
- click_prefix = 'click-'
- getClassType()
C++ Interface: get_class_type()
- getClickEvent()
C++ Interface: get_click_event(PGButton self, const ButtonHandle button)
- /**
Returns the event name that will be thrown when the button is clicked
normally.
*/
- getClickPrefix()
C++ Interface: get_click_prefix()
- /**
Returns the prefix that is used to define the click event for all
PGButtons. The click event is the concatenation of this string followed by
get_id().
*/
- get_class_type()
C++ Interface: get_class_type()
- get_click_event()
C++ Interface: get_click_event(PGButton self, const ButtonHandle button)
- /**
Returns the event name that will be thrown when the button is clicked
normally.
*/
- get_click_prefix()
C++ Interface: get_click_prefix()
- /**
Returns the prefix that is used to define the click event for all
PGButtons. The click event is the concatenation of this string followed by
get_id().
*/
- hasClickButton()
C++ Interface: has_click_button(const PGButton self, const ButtonHandle button)
- /**
Returns true if the indicated button is on the set of buttons that can
effectively “click” the PGButton. Normally, this is just
MouseButton::one().
*/
- has_click_button()
C++ Interface: has_click_button(const PGButton self, const ButtonHandle button)
- /**
Returns true if the indicated button is on the set of buttons that can
effectively “click” the PGButton. Normally, this is just
MouseButton::one().
*/
- isButtonDown()
C++ Interface: is_button_down(const PGButton self)
- /**
Returns true if the user is currently holding the mouse button down on the
button, false otherwise.
*/
- is_button_down()
C++ Interface: is_button_down(const PGButton self)
- /**
Returns true if the user is currently holding the mouse button down on the
button, false otherwise.
*/
- removeClickButton()
C++ Interface: remove_click_button(const PGButton self, const ButtonHandle button)
- /**
Removes the indicated button from the set of buttons that can effectively
“click” the PGButton. Normally, this is just MouseButton::one(). Returns
true if the button was removed, or false if it was not in the set.
*/
- remove_click_button()
C++ Interface: remove_click_button(const PGButton self, const ButtonHandle button)
- /**
Removes the indicated button from the set of buttons that can effectively
“click” the PGButton. Normally, this is just MouseButton::one(). Returns
true if the button was removed, or false if it was not in the set.
*/
- setup()
C++ Interface: setup(const PGButton self, str label) setup(const PGButton self, const NodePath ready) setup(const PGButton self, const NodePath ready, const NodePath depressed) setup(const PGButton self, str label, float bevel) setup(const PGButton self, const NodePath ready, const NodePath depressed, const NodePath rollover) setup(const PGButton self, const NodePath ready, const NodePath depressed, const NodePath rollover, const NodePath inactive)
- /**
Sets up the button using the indicated NodePath as arbitrary geometry.
*/
- /**
Sets up the button using the indicated NodePath as arbitrary geometry.
*/
- /**
Sets up the button using the indicated NodePath as arbitrary geometry.
*/
- /**
Sets up the button as a default text button using the indicated label
string. The TextNode defined by PGItem::get_text_node() will be used to
create the label geometry. This automatically sets up the frame according
to the size of the text.
*/
- /**
Sets up the button using the indicated NodePath as arbitrary geometry.
*/