![]() |
![]() |
This widget is generally used with a signal handler that is called when the button is pressed. It can hold any valid child widget. The most commonly used child is the Gtk::Label.
Public Member Functions | |
Button (const StockID& stock_id) | |
Creates a new Button containing the image and text from a stock item. | |
Button (const Glib::ustring& label, bool mnemonic=false) | |
Simple Push Button with label. | |
Button () | |
Create an empty button. | |
void | clicked () |
void | enter () |
void | get_alignment (float& xalign, float& yalign) |
Gets the alignment of the child in the button. | |
bool | get_focus_on_click () const |
Returns whether the button grabs focus when it is clicked with the mouse. | |
const Widget* | get_image () const |
Gets the widget that is currenty set as the image of button . | |
Widget* | get_image () |
Gets the widget that is currenty set as the image of button . | |
Glib::ustring | get_label () const |
Fetches the text from the label of the button, as set by set_label(). | |
ReliefStyle | get_relief () const |
bool | get_use_stock () const |
Returns whether the button label is a stock item. | |
bool | get_use_underline () const |
Returns whether an embedded underline in the button label indicates a mnemonic. | |
const GtkButton* | gobj () const |
Provides access to the underlying C GtkObject. | |
GtkButton* | gobj () |
Provides access to the underlying C GtkObject. | |
void | leave () |
void | pressed () |
Glib::PropertyProxy_ReadOnly< bool > | property_focus_on_click () const |
Whether the button grabs focus when it is clicked with the mouse. | |
Glib::PropertyProxy<bool> | property_focus_on_click () |
Whether the button grabs focus when it is clicked with the mouse. | |
Glib::PropertyProxy_ReadOnly< Gtk::Widget* > | property_image () const |
Child widget to appear next to the button text. | |
Glib::PropertyProxy<Gtk::Widget*> | property_image () |
Child widget to appear next to the button text. | |
Glib::PropertyProxy_ReadOnly< PositionType > | property_image_position () const |
The position of the image relative to the text. | |
Glib::PropertyProxy<PositionType> | property_image_position () |
The position of the image relative to the text. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_label () const |
Text of the label widget inside the button. | |
Glib::PropertyProxy<Glib::ustring> | property_label () |
Text of the label widget inside the button. | |
Glib::PropertyProxy_ReadOnly< ReliefStyle > | property_relief () const |
The border relief style. | |
Glib::PropertyProxy<ReliefStyle> | property_relief () |
The border relief style. | |
Glib::PropertyProxy_ReadOnly< bool > | property_use_stock () const |
If set. | |
Glib::PropertyProxy<bool> | property_use_stock () |
If set. | |
Glib::PropertyProxy_ReadOnly< bool > | property_use_underline () const |
If set. | |
Glib::PropertyProxy<bool> | property_use_underline () |
If set. | |
Glib::PropertyProxy_ReadOnly< float > | property_xalign () const |
Horizontal position of child in available space. | |
Glib::PropertyProxy<float> | property_xalign () |
Horizontal position of child in available space. | |
Glib::PropertyProxy_ReadOnly< float > | property_yalign () const |
Vertical position of child in available space. | |
Glib::PropertyProxy<float> | property_yalign () |
Vertical position of child in available space. | |
void | released () |
void | set_alignment (float xalign, float yalign) |
Sets the alignment of the child. | |
void | set_focus_on_click (bool focus_on_click=true) |
Sets whether the button will grab focus when it is clicked with the mouse. | |
void | set_image (Widget& image) |
Set the image of button to the given widget. | |
PositionType | set_image_position () const |
void | set_image_position (PositionType position) |
void | set_label (const Glib::ustring& label) |
Sets the text of the label of the button to str . | |
void | set_relief (ReliefStyle newstyle) |
void | set_use_stock (bool use_stock=true) |
If true, the label set on the button is used as a stock id to select the stock item for the button. | |
void | set_use_underline (bool use_underline=true) |
If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key. | |
Glib::SignalProxy0<void> | signal_activate () |
Glib::SignalProxy0<void> | signal_clicked () |
Glib::SignalProxy0<void> | signal_enter () |
Glib::SignalProxy0<void> | signal_leave () |
Glib::SignalProxy0<void> | signal_pressed () |
Glib::SignalProxy0<void> | signal_released () |
virtual | ~Button () |
Protected Member Functions | |
virtual void | on_activate () |
virtual void | on_clicked () |
virtual void | on_enter () |
virtual void | on_leave () |
virtual void | on_pressed () |
virtual void | on_released () |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Button* | wrap (GtkButton* object, bool take_copy=false) |
|
|
|
Create an empty button. With an empty button, you can Gtk::Button::add() a widget such as a Gtk::Pixmap or Gtk::Box. If you just wish to add a Gtk::Label, you may want to use the Gtk::Button(const Glib::ustring& label) ctor directly instead. |
|
Simple Push Button with label. Create a button with the given label inside. You won't be able to add a widget in this button since it already has a Gtk::Label in it |
|
Creates a new Button containing the image and text from a stock item. Stock ids have identifiers like Gtk::Stock::OK and Gtk::Stock::APPLY.
|
|
|
|
|
|
Gets the alignment of the child in the button.
|
|
Returns whether the button grabs focus when it is clicked with the mouse. See set_focus_on_click().
|
|
Gets the widget that is currenty set as the image of button . This may have been explicitly set by set_image() or specified as a stock item to the constructor. newin2p6 |
|
Gets the widget that is currenty set as the image of button . This may have been explicitly set by set_image() or specified as a stock item to the constructor. newin2p6 |
|
Fetches the text from the label of the button, as set by set_label().
If the label text has not been set the return value will be
|
|
|
|
Returns whether the button label is a stock item.
|
|
Returns whether an embedded underline in the button label indicates a mnemonic. See set_use_underline().
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Bin. Reimplemented in Gtk::CheckButton, Gtk::ColorButton, Gtk::FontButton, Gtk::LinkButton, Gtk::OptionMenu, Gtk::RadioButton, and Gtk::ToggleButton. |
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Bin. Reimplemented in Gtk::CheckButton, Gtk::ColorButton, Gtk::FontButton, Gtk::LinkButton, Gtk::OptionMenu, Gtk::RadioButton, and Gtk::ToggleButton. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Whether the button grabs focus when it is clicked with the mouse. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Whether the button grabs focus when it is clicked with the mouse. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Child widget to appear next to the button text. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Child widget to appear next to the button text. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The position of the image relative to the text. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The position of the image relative to the text. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Text of the label widget inside the button. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Text of the label widget inside the button. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The border relief style. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The border relief style. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Horizontal position of child in available space. 0.0 is left aligned You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Horizontal position of child in available space. 0.0 is left aligned You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Vertical position of child in available space. 0.0 is top aligned You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Vertical position of child in available space. 0.0 is top aligned You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
|
|
Sets the alignment of the child. This property has no effect unless the child is a Gtk::Misc or a Gtk::Aligment.
|
|
Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application.
|
|
Set the image of button to the given widget. Note that it depends on the gtk-button-images setting whether the image will be displayed or not, you don't have to call Gtk::Widget::show() on image yourself.
|
|
|
|
|
|
Sets the text of the label of the button to str . This text is also used to select the stock item if set_use_stock() is used. This will also clear any previously set labels.
|
|
|
|
If true, the label set on the button is used as a stock id to select the stock item for the button.
|
|
If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|