Module gwy :: Class SensitivityGroup
[hide private]
[frames] | no frames]

Class SensitivityGroup

source code

Instance Methods [hide private]
 
__init__()
Creates a new flag-based widget sensitivity group.
source code
 
add_widget(widget, mask)
Adds a widget to flag sensitivity group.
source code
 
set_state(affected_mask, state)
Sets the state of a widget flag sensitivity group.
source code
 
get_state()
Gets the current state of a widget flag sensitivity group.
source code
 
release_widget(widget)
Removes a widget from flag sensitivity group.
source code
 
get_widget_mask(widget)
Gets sensitivity flags of a widget in a flag sensitivity group.
source code
 
set_widget_mask(widget, mask)
Sets the flag mask of a widget in a flag sensitivity group.
source code
 
contains_widget(widget)
Checks whether a widget belongs to a sensitivity group.
source code
Method Details [hide private]

__init__()
(Constructor)

source code 

Creates a new flag-based widget sensitivity group.

Returns:
The newly created sensitivity group. It starts with zero state. (SensitivityGroup)

add_widget(widget, mask)

source code 

Adds a widget to flag sensitivity group.

Widget sensitivity should not be set manually after the addition as the result is likely to be a fight over sensitivity setting.

The added widget takes a reference on sensgroup. So the group is not destroyed when they are any widgets in, generally, you can release your initial reference after adding widgets to the group.

Parameters:
  • widget - Widget to add to sensgroup. (gtk.Widget)
  • mask - Which flags the widget is sensitive to. See SensitivityGroup.set_state() for details. (int)

set_state(affected_mask, state)

source code 

Sets the state of a widget flag sensitivity group.

Widget sensitivity states are then updated accordingly.

More precisely, widget will be made sensitive when all bits in its mask are set in current sensgroup state, insensitive otherwise. This means when mask is zero, widget will be always sensitive.

Parameters:
  • affected_mask - Which bits in state to copy to sensgroup state. 1's in affected_mask causes corresponding bits in sensgroup state to be set to the value of corresponding bit in state. 0's in affected_mask cause corresponding state bits to be kept on their current value. (int)
  • state - The new state of sensgroup (masked with affected_mask). (int)

get_state()

source code 

Gets the current state of a widget flag sensitivity group.

Returns:
The current state as set with SensitivityGroup.set_state(). (int)

release_widget(widget)

source code 

Removes a widget from flag sensitivity group.

Parameters:
  • widget - Widget to remove from sensgroup. (gtk.Widget)

get_widget_mask(widget)

source code 

Gets sensitivity flags of a widget in a flag sensitivity group.

Parameters:
  • widget - Widget to get flags of. (gtk.Widget)
Returns:
The mask as passed to SensitivityGroup.add_widget() or SensitivityGroup.set_widget_mask(). (int)

set_widget_mask(widget, mask)

source code 

Sets the flag mask of a widget in a flag sensitivity group.

Parameters:
  • widget - Widget to set flags of. (gtk.Widget)
  • mask - Which flags the widget is sensitive to. See SensitivityGroup.set_state() for details. (int)

contains_widget(widget)

source code 

Checks whether a widget belongs to a sensitivity group.

Parameters:
  • widget - Widget to test for membership. (gtk.Widget)
Returns:
True if widget is in sensgroup, False otherwise. (bool)

Since: 2.34