gtk.ToolButton — a gtk.ToolItem subclass that displays buttons (new in PyGTK 2.4)
class gtk.ToolButton(gtk.ToolItem): |
+-- gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.ToolItem +-- gtk.ToolButton |
|
This widget is available in PyGTK 2.4 and above.
A gtk.ToolButton is a sub class of gtk.ToolItem that contains a button. Use the gtk.ToolButton() constructor to create a new gtk.ToolButton specifying a widget to use as the icon and a label for the text. Alternatively use the other gtk.ToolButton() constructor to create a gtk.ToolButton from a stock item.
The label of a gtk.ToolButton is determined by the properties "label_widget", "label", and "stock_id". If "label_widget" specifies a gtk.Widget, that widget is used as the label. If "label-widget" is None, then the string in "label" is used as the label. If both "label-widget" and "label" are None, the label is determined by the stock item specified by "stock-id". Finally, if "label-widget", "label" and "stock-id" are all None, the button does not have a label.
The icon of a gtk.ToolButton is determined by the properties "icon-widget" and "stock-id". If "icon-widget" specifies a gtk.Widget, that widget is used as the icon. If "icon-widget" is None, the icon is determined by the stock item specified by "stock-id". If both "icon-widget" and "stock-id" are None, the button does not have an icon.
|
icon_widget : | a gtk.Widget that will be used as the icon widget, or None |
label : | a string that will be used as the label, or None |
Returns : | A new gtk.ToolButton |
This constructor is available in PyGTK 2.4 and above.
Creates a new gtk.ToolButton optionally using the icon specified by icon_widget and the label text specified by label. If both icon_widget and label are None, the tool button will be empty.
|
stock_id : | a string that specifies a stock item |
Returns : | A new gtk.ToolButton |
This constructor is available in PyGTK 2.4 and above.
Creates a new gtk.ToolButton using the stock item specified by stock_id to determine the icon and label text. It is an error if stock_id is not a name of a stock item.
|
label : | a string that will be used as label, or None. |
This method is available in PyGTK 2.4 and above.
The set_label() method sets the "label" property to the value of label. If the "label_widget" property is None, label will be used as the label of the tool button.
|
Returns : | The label, or None |
This method is available in PyGTK 2.4 and above.
The get_label() method returns the value of the "label" property that is used as the label of the tool button if the "label-widget" property is None.
|
use_underline : | if TRUE, an underline in the label string specifies a mnemonic key for the overflow menu |
This method is available in PyGTK 2.4 and above.
The set_use_underline() method sets the "use-underline" property to the value of use_underline. If use_underline is TRUE, an underline in the "label" property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu. For example, if the label property is "_Open" and use_underline is TRUE, the label on the tool button will be "Open" and the item on the overflow menu will have an underlined 'O'. Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu.
|
Returns : | TRUE if underscores in the "label" property are used as mnemonics on menu items on the overflow menu. |
This method is available in PyGTK 2.4 and above.
The get_use_underline() method returns the value of the "use-underline" property. If "use-underline" is TRUE, underscores in the label property are used as mnemonics on menu items on the overflow menu. See the set_use_underline() method for more information.
|
stock_id : | a name of a stock item, or None |
This method is available in PyGTK 2.4 and above.
The set_stock_id() method sets the "stock-id" property to the value of stock_id. The stock item specified by stock_id is used to determine the icon and label if not overridden by the "label" and "icon-widget" properties. See the gtk.ToolButton() constructor for more information.
|
Returns : | the name of the stock item. |
This method is available in PyGTK 2.4 and above.
The get_stock_id() method returns the value of the "stock-id" property that contains the name of a stock item or None. See the gtk.ToolButton() constructor for more information.
|
icon_name : | a name of a themed icon, or None |
This method is available in PyGTK 2.8 and above.
The set_icon_name() method sets the "icon-name" property to the value of icon_name. The themed icon name specified by icon_name is used to determine the icon for the toolbutton if not overridden by the "label", "stock-id" and "icon-widget" properties. See the gtk.ToolButton() constructor for more information.
In PyGTK 2.10 and above, icon_name may be None to unset the icon name.
|
Returns : | the name of the stock item. |
This method is available in PyGTK 2.8 and above.
The get_icon_name() method returns the value of the "icon_name" property that contains the name of a themed icon or None. See the gtk.ToolButton() constructor for more information.
|
icon_widget : | the widget used as icon, or None |
This method is available in PyGTK 2.4 and above.
The set_icon_widget() method sets the "icon-widget" property to the value of icon_widget. If icon_widget specifies a gtk.Widget, it is used as the icon of the tool button. If icon_widget is None the icon is determined by the "stock_id" property. If the "stock_id" property is also None, the tool button will not have an icon.
|
Returns : | The widget used as icon on button, or None. |
This method is available in PyGTK 2.4 and above.
The get_icon_widget() method returns the value of the "icon-widget" property that contains the gtk.Widget used as the icon on the tool button. See the set_icon_widget() method for more information.
|
label_widget : | the widget used as the label, or None |
This method is available in PyGTK 2.4 and above.
The set_label_widget() method sets the "label-widget" property to the gtk.Widget specified by label_widget that will be used as the label for the tool button. If label_widget is None the "label" property is used as label. If "label-widget" and "label" are both None, the label in the stock item determined by the "stock_id" property is used as the label. If "label-widget", "label" and "stock_id" are all None, the tool button will not have a label.
|
Returns : | The widget used as label on button, or None. |
This method is available in PyGTK 2.4 and above.
The get_label_widget() method returns the value of the "label-widget" property that is used as the label on the tool button. See the gtk.ToolButton.set_label_widget() method for more information.
|
toolbutton : | the toolbutton that received the signal |
user_param1 : | the first user parameter (if any) specified with the connect() method |
... : | additional user parameters (if any) |
The "clicked" signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.