Name
gtk.ToggleAction — an action which can be
toggled between two states (new in PyGTK 2.4)
Signal Prototypes
"toggled" | def callback(toggleaction, user_param1, ...) |
Description
Note
This object is available in PyGTK 2.4 and above.
A gtk.ToggleAction
which is a subclass of gtk.Action
corresponds roughly to a gtk.CheckMenuItem. It
has an "active" state specifying whether the action has been checked or
not.
Constructor
gtk.ToggleAction(name, label, tooltip, stock_id)
|
name : | a unique name for the action |
label : | the label displayed in menu items and on
buttons |
tooltip : | a tooltip for the action |
stock_id : | the stock icon to display in widgets representing
the action |
Returns : | a new gtk.ToggleAction |
Note
This constructor is available in PyGTK 2.4 and above.
Creates a new gtk.ToggleAction
object. To add the action to a gtk.ActionGroup
and set the accelerator for the action, call the gtk.ActionGroup.add_action_with_accel()
method.
Methods
gtk.ToggleAction.toggled
Note
This method is available in PyGTK 2.4 and above.
The toggled() method emits the
"toggled" signal on the toggle action.
gtk.ToggleAction.set_active
def set_active(is_active)
|
is_active : | if TRUE the action should be
checked |
Note
This method is available in PyGTK 2.4 and above.
The set_active() method sets the
checked state on the toggle action.
gtk.ToggleAction.get_active
Returns : | TRUE if the toggle action is
checked |
Note
This method is available in PyGTK 2.4 and above.
The get_active() method returns
TRUE if the toggle action is checked.
gtk.ToggleAction.set_draw_as_radio
def set_draw_as_radio(draw_as_radio)
|
draw_as_radio : | if TRUE the action should
have proxies like a radio action |
Note
This method is available in PyGTK 2.4 and above.
The set_draw_as_radio() method sets the
"draw-as-radio" property to the value of
draw_as_radio. If
draw_as_radio is TRUE the action
should have proxies like a radio action.
gtk.ToggleAction.get_draw_as_radio
Returns : | TRUE if the action should
have proxies like a radio action. |
Note
This method is available in PyGTK 2.4 and above.
The get_draw_as_radio() method returns
the value of the "draw-as-radio" property. If "draw-as-radio" is
TRUE the action should have proxies like a radio
action.
Signals
The "toggled" Signal
def callback(toggleaction, user_param1, ...)
|
toggleaction : | the toggleaction that received the
signal |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
Note
This signal is available in GTK+ 2.4 and above.
The "toggled" signal is emitted when the toggle action changes
its active state.