gtk.ToolPalette — a tool palette with categories (new in PyGTK 2.22)
class gtk.ToolPalette(gtk.Container): |
|
|
gtk.Container Signal Prototypes
def callback( |
This widget is available in PyGTK 2.22 and above.
A gtk.ToolPalette
is used together with gtk.ToolPalette
to add gtk.ToolItem
objects to
a palette like container with different categories and drag and drop support.
gtk.ToolPalette ()
Returns : | a new gtk.ToolPalette |
This constructor is available in PyGTK 2.22 and above.
Creates a new tool palette.
def set_group_position(group
, position
)
| a gtk.ToolPalette which is a child of palette |
| a new index for group |
This method is available in PyGTK 2.22 and above.
The set_group_position
() method sets the position of the group as an index of the tool palette.
If position is 0 the group will become the first child, if position is
-1 it will become the last child.
def set_exclusive(group
, exclusive
)
| a gtk.ToolPalette which is a child of palette |
| whether the group should be exclusive or not |
This method is available in PyGTK 2.22 and above.
Sets whether the group should be exclusive or not. If an exclusive group is expanded all other groups are collapsed.
def set_expand(group
, expand
)
| a gtk.ToolPalette which is a child of palette |
| whether the group should be given extra space |
This method is available in PyGTK 2.22 and above.
Sets whether the group should be given extra space.
def get_group_position(group
)
| a gtk.ToolPalette |
Returns : | the index of group or -1 if group is not a child of palette |
This method is available in PyGTK 2.22 and above.
Gets the position of group
in palette
as index.
See gtk.ToolPalette.set_group_position
.
def get_exclusive(group
)
| a gtk.ToolPalette which is a child of palette |
Returns : | True if group is exclusive |
This method is available in PyGTK 2.22 and above.
Gets whether group
is exclusive or not.
See gtk.ToolPalette.set_exclusive
.
def get_expand(group
)
| a gtk.ToolPalette which is a child of palette |
Returns : | True if group should be given extra space, False otherwise |
This method is available in PyGTK 2.22 and above.
Gets whether group should be given extra space.
See gtk.ToolPalette.set_expand
.
def set_icon_size(icon_size
)
| one of the GTK Icon Size Constants that icons in the tool palette shall have |
This method is available in PyGTK 2.22 and above.
The set_icon_size
() method sets the size of icons in the tool palette.
def unset_icon_size()
This method is available in PyGTK 2.22 and above.
Unsets the tool palette icon size set with gtk.ToolPalette.set_icon_size
,
so that user preferences will be used to determine the icon size.
def set_style(style
)
| one of the GTK Toolbar Style Constants that items in the tool palette shall have |
This method is available in PyGTK 2.22 and above.
The set_style
() method sets the style (text, icons or both) of items in the tool palette.
def unset_style()
This method is available in PyGTK 2.22 and above.
Unsets a toolbar style set with gtk.ToolPalette.set_style
,
so that user preferences will be used to determine the toolbar style.
def get_icon_size()
Returns : | one of the GTK Icon Size Constants |
This method is available in PyGTK 2.22 and above.
Gets the size of icons in the tool palette.
See gtk.ToolPalette.set_icon_size
.
def get_style()
Returns : | one of the GTK Toolbar Style Constants |
This method is available in PyGTK 2.22 and above.
Gets the style (icons, text or both) of items in the tool palette.
def get_drop_item(x
, y
)
| the x position |
| the y position |
Returns : | the gtk.ToolItem at position or None if there is no such item |
This method is available in PyGTK 2.22 and above.
Gets the item at position (x, y).
See gtk.ToolPalette.get_drop_group
.
def get_drop_group(x
, y
)
| the x position |
| the y position |
Returns : | the gtk.ToolPalette at position or None if there is no such group |
This method is available in PyGTK 2.22 and above.
Gets the group at position (x, y).
def get_drag_item(selection
)
| a gtk.SelectionData |
Returns : | the dragged item in selection |
This method is available in PyGTK 2.22 and above.
Get the dragged item from the selection.
This could be a gtk.ToolItem
or a gtk.ToolPalette
.
def set_drag_source(targets
)
| the GtkToolPaletteDragTarget s which the widget should support |
This method is available in PyGTK 2.22 and above.
The set_drag_source
() method sets the tool palette as a drag source.
Enables all groups and items in the tool palette as drag sources
on button 1 and button 3 press with copy and move actions.
See gtk.Widget.drag_source_set
.
def add_drag_dest(widget
, flags
, targets
, actions
)
| a gtk.Widget which should be a drag destination for palette |
| the flags that specify what actions GTK+ should take for drops on that widget |
| the GtkToolPaletteDragTarget s which the widget should support |
| the GdkDragAction s which the widget should suppport |
This method is available in PyGTK 2.22 and above.
Sets palette
as drag source (see gtk.ToolPalette.set_drag_source
)
and sets widget
as a drag destination for drags from palette
.
See gtk.Widget.drag_dest_set
.
def callback(toolpalette
, hadjustment
, vadjustment
, user_param1
, ...
)
| the toolpalette that received the signal |
| the horizontal adjustment |
| the vertical adjustment |
| the first user parameter (if any) specified with the connect () |
| additional user parameters (if any) |
This signal is available in GTK+ 2.20 and above.
The "set-scroll-adjustments" signal is emitted when one or both
adjustments (specified by hadjustment
and
vadjustment
) are set on textview.