gtk Functionsmiscellaneous functionsSynopsisgtk.AboutDialog Functionsgtk.about_dialog_set_email_hookfuncdatagtk.about_dialog_set_url_hookfuncdatagtk.AccelGroup Functionsgtk.accelerator_validkeyvalmodifiersgtk.accelerator_parseacceleratorgtk.accelerator_nameaccelerator_keyaccelerator_modsgtk.accelerator_set_default_mod_maskdefault_mod_maskgtk.accelerator_get_default_mod_maskgtk.accelerator_get_labelaccelerator_keyaccelerator_modsgtk.accel_groups_from_objectobjectgtk.AccelMap Functionsgtk.accel_map_add_entryaccel_pathaccel_keyaccel_modsgtk.accel_map_lookup_entryaccel_pathgtk.accel_map_change_entryaccel_pathaccel_keyaccel_modsreplacegtk.accel_map_foreachforeach_funcdataNonegtk.accel_map_foreach_unfilteredforeach_funcdataNonegtk.accel_map_getgtk.accel_map_loadfile_namegtk.accel_map_savefile_namegtk.accel_map_load_fdfdgtk.accel_map_save_fdfdgtk.accel_map_lock_pathaccel_pathgtk.accel_map_unlock_pathaccel_pathgtk.accel_map_add_filterfilter_patterngtk.CellView Functionsgtk.cell_view_new_with_texttextgtk.cell_view_new_with_markupmarkupgtk.cell_view_new_with_pixbufpixbufgtk.Clipboard Functionsgtk.clipboard_getgtk.ColorSelection Functionsgtk.color_selection_palette_from_stringstrgtk.color_selection_palette_to_stringcolorsgtk.ComboBox Functionsgtk.combo_box_new_textgtk.ComboBoxEntry Functionsgtk.combo_box_entry_new_textgtk.ComboBoxText Functionsgtk.combo_box_text_new_with_entrygtk.Container Functionsgtk.container_class_install_child_propertyklassproperty_idpspecgtk.container_class_list_child_propertiesklassgtk.Dialog Functionsgtk.alternative_dialog_button_orderscreenNonegtk.Expander Functionsgtk.expander_new_with_mnemoniclabelgtk.IconFactory Functionsgtk.icon_factory_lookup_defaultstock_idgtk.IconSource Functionsgtk.icon_size_lookupicon_sizegtk.icon_size_lookup_for_settingssettingsicon_sizegtk.icon_size_registernamewidthheightgtk.icon_size_register_aliasaliastargetgtk.icon_size_from_namenamegtk.icon_size_get_namesizegtk.IconTheme Functionsgtk.icon_theme_get_defaultgtk.icon_theme_get_for_screenscreengtk.icon_theme_add_builtin_iconicon_namesizepixbufgtk.Image Functionsgtk.image_new_from_stockstock_idsizegtk.image_new_from_icon_seticon_setsizegtk.image_new_from_animationanimationgtk.image_new_from_icon_nameicon_namesizegtk.ItemFactory Functionsgtk.item_factory_from_widgetwidgetgtk.item_factory_path_from_widgetwidgetgtk.LinkButton Functionsgtk.link_button_set_uri_hookfuncdataNonegtk.Object Functionsgtk.bindings_activateobjectkeyvalmodifiersgtk.bindings_activate_eventobjecteventgtk.binding_entry_add_signalobjectkeyvalmodifierssignal_name...gtk.binding_entry_removeclass_typekeyvalmodifiersgtk.PaperSize Functionsgtk.paper_size_new_from_ppdppd_nameppd_display_namewidthheightgtk.paper_size_new_cutomnamedisplay_namewidthheightunitgtk.paper_size_get_defaultgtk.Plug Functionsgtk.plug_new_for_displaydisplaysocket_idgtk.RcStyle Functionsgtk.rc_add_default_filefilenamegtk.rc_set_default_filesfilenamesgtk.rc_get_default_filesgtk.rc_get_style_by_pathssettingswidget_pathclass_pathtypegtk.rc_reparse_all_for_settingssettingsforce_loadgtk.rc_reset_stylessettingsgtk.rc_parsefilenamegtk.rc_parse_stringrc_stringgtk.rc_reparse_allgtk.rc_find_module_in_pathmodule_filegtk.rc_get_theme_dirgtk.rc_get_module_dirgtk.rc_get_im_module_pathgtk.rc_get_im_module_filegtk.RecentManager Functionsgtk.recent_manager_get_defaultgtk.recent_manager_get_for_screenscreengtk.SelectionData Functionsgtk.selection_owner_set_for_displaydisplaywidgetselectiontime0gtk.target_list_add_image_targetslistNoneinfo0writableFalsegtk.target_list_add_text_targetslistNoneinfo0gtk.target_list_add_uri_targetslistNoneinfo0gtk.Settings Functionsgtk.settings_get_defaultgtk.settings_get_for_screenscreengtk.StatusIcon Functionsgtk.status_icon_new_from_pixbufpixbufgtk.status_icon_new_from_filefilenamegtk.status_icon_new_from_stockstock_idgtk.status_icon_new_from_icon_nameicon_namegtk.status_icon_position_menumenustatusicongtk.Tooltips Functionsgtk.tooltips_data_getwidgetgtk.TreeModel Functionsgtk.tree_row_reference_insertedproxypathgtk.tree_row_reference_deletedproxypathgtk.Widget Functionsgtk.widget_push_colormapcmapgtk.widget_push_composite_childgtk.widget_pop_composite_childgtk.widget_pop_colormapgtk.widget_get_default_stylegtk.widget_set_default_colormapcolormapgtk.widget_get_default_colormapgtk.widget_get_default_visualgtk.widget_set_default_directiondirgtk.widget_get_default_directiongtk.widget_class_list_style_propertieswidgetgtk.widget_class_install_style_propertywidgetpspecgtk.Window Functionsgtk.window_set_default_iconicongtk.window_set_default_icon_from_filefilenamegtk.window_set_default_icon_list...gtk.window_get_default_icon_listgtk.window_set_auto_startup_notificationsettinggtk.window_list_toplevelsgtk.window_set_default_icon_namenameStock Item Functionsgtk.stock_additemsgtk.stock_lookupstock_idgtk.stock_list_idsMiscellaneous Functionsgtk.check_versionrequired_majorrequired_minorrequired_microgtk.draw_insertion_cursorwidgetdrawablearealocationis_primarydirectiondraw_arrowgtk.get_default_languagegtk.events_pendinggtk.main_do_eventeventgtk.maingtk.main_levelgtk.main_quitgtk.main_iterationblockgtk.main_iteration_doblockgtk.grab_get_currentgtk.quit_addlevelfunc...gtk.quit_removequit_handler_idgtk.get_current_eventgtk.get_current_event_stategtk.get_current_event_timegtk.init_checkgtk.remove_log_handlersgtk.add_log_handlersgtk.set_interactiveinteractivegtk.show_uriscreenuritimestampDescriptionAll PyGTK functions for the gtk module are
listed above categorized by class. Those functions associated with a class
have their descriptions included with the class reference. Those functions
that are not associated with a specific class are described below.Functionsgtk.check_versiongtk.check_versionrequired_majorrequired_minorrequired_microrequired_major :the required major version
numberrequired_minor :the required minor version
numberrequired_micro :the required micro version
numberReturns :None if the underlying
GTK+ library is compatible or a string describing the
mismatchThe gtk.check_version() function checks the
underlying GTK+ library version against the version
specified by required_major,
required_minor and
required_micro. If the library is compatible this
function returns None; otherwise it returns a string
describing the mismatch.gtk.draw_insertion_cursorgtk.draw_insertion_cursorwidgetdrawablearealocationis_primarydirectiondraw_arrowwidget :a gtk.Widgetdrawable :a gtk.gdk.Drawablearea :the rectangle to which the output is clipped, or
None if the output should not be clippedlocation :the location to draw the cursor
(location.width is
ignored)is_primary : if True the cursor should
be the primary cursor color.direction :the direction of the cursor; either
gtk.TEXT_DIR_LTR or
gtk.TEXT_DIR_RTLdraw_arrow :if True draw a directional
arrow on the cursor. Should be False unless the
cursor is split.This function is available in PyGTK 2.4 and above.The gtk.draw_insertion_cursor() function
draws a text caret on the gtk.gdk.Drawable
specified by drawable at the position specified by
location. area specifies a
clipping rectangle or is None if the output should not be
clipped. If is_primary is True the
cursor should be the primary cursor color. direction
specifies whether the cursor is right-to-left or left-to-right. This is a
convenience function for drawing the standard cursor shape.gtk.get_default_languagegtk.get_default_languageReturns :a pango.Language
object for the default languageThe gtk.get_default_language() function
returns a pango.Language
describing the default language.gtk.events_pendinggtk.events_pendingReturns :True if any events are
pendingThe gtk.events_pending() function returns
True if any events are pending. This can be used to
update the user interface and invoke timeouts etc. while doing some time
intensive computation.gtk.main_do_eventgtk.main_do_eventevent :a gtk.gdk.Event to
processThe gtk.main_do_event() function processes
a single gtk.gdk.Event. This
function is public only to allow filtering of events between
GDK and GTK+. You will not usually
need to call this function directly. While you should not call this function
directly, you might want to know how exactly events are handled. So here is
what this function does with the event:Compress enter/leave notify events. If the event passed
builds an enter-leave pair together with the next event (peeked from
GDK) both events are thrown away. This is to avoid a
backlog of (de-)highlighting widgets crossed by the pointer.Find the widget which got the event. If the widget can't
be determined the event is thrown away unless it belongs to a
INCR transaction. In that case it is passed to
gtk_selection_incr_event().Then the event is passed on a stack so you can query the
currently handled event with gtk.get_current_event().The event is sent to a widget. If a grab is active all
events for widgets that are not in the contained in the grab widget are sent
to the latter with a few exceptions:Deletion and destruction events are still sent to the
event widget for obvious reasons. Events which directly relate to the visual
representation of the event widget. Leave events are delivered to the event widget if
there was an enter event delivered to it before without the paired leave
event. Drag events are not redirected because it is unclear
what the semantics of that would be. Another point of interest might be that all key events
are first passed through the key snooper functions if there are any. Read
the description of gtk_key_snooper_install() if you
need this feature.After finishing the delivery the event is popped from the
event stack. gtk.maingtk.mainThe gtk.main() function runs the main loop
until the gtk.main_quit()
function is called. You can nest calls to gtk.main().
In that case the call to the gtk.main_quit()
function will make the innermost invocation of the main loop return.gtk.main_levelgtk.main_levelReturns :the nesting level of the current invocation of
the main loopThe gtk.main_level() function returns the
current nesting level of the main loop. The nesting level is increased by
calling the gtk.main() function
and reduced by calling the gtk.main_quit()
function.gtk.main_quitgtk.main_quitThe gtk.main_quit() function terminates the
current main loop level started by the most recent call to the gtk.main()
function. The nesting level of the main loop is reduced by calling this
function.gtk.main_iterationgtk.main_iterationblockTrueblock :if True block if no events
are pendingReturns :True if the gtk.main_quit()
function has been called for the innermost main loop.The gtk.main_iteration() function runs a
single iteration of the mainloop. If no events are waiting to be processed
PyGTK will block until the next event is noticed if
block is True. This function is
identical to the gtk.main_iteration_do()
function.gtk.main_iteration_dogtk.main_iteration_doblockTrueblock :if True block if no events
are pendingReturns :True if the gtk.main_quit()
function has been called for the innermost main loop.The gtk.main_iteration_do() function runs a
single iteration of the main loop. If block is
True block until an event occurs. This function is
identical to the gtk.main_iteration()
function.gtk.grab_get_currentgtk.grab_get_currentReturns :the gtk.Widget that has
the grab currently or None if no grab is
activeThe gtk.grab_get_current() function returns
the gtk.Widget
that has the grab or None if no grab is active.gtk.quit_addgtk.quit_addlevelfunc...level :the level at which termination
func shall be called. You can pass 0 here to have
func run at the termination of the current main
loop.func :the function to call - it should return 0 to be
removed from the list of quit handlers... :optional parameter(s) to be passed to
funcReturns :a handle for this quit handler (you need this
for the gtk.quit_remove()
function).The gtk.quit_add() function registers a
function specified by func to be called when the
specified main loop level is exited.
func should return 0 to be removed from the list of
quit handlers. This function returns a handler ID that is used when removing
the handler with the gtk.quit_remove()
function.gtk.quit_removegtk.quit_removequit_handler_idquit_handler_id :the ID of a quit handlerThe gtk.quit_remove() function removes the
quit handler specified by quit_handler_id from the
list of quit handlers.gtk.get_current_eventgtk.get_current_eventReturns :a copy of the current event or
NoneThis function is available in PyGTK 2.6 and above.The gtk.get_current_event() function
returns a copy of the event currently being processed by GTK+. For example,
if you get a "clicked" signal from gtk.Button, the
current event will be the GdkEventButton that triggered the "clicked"
signal. If there is no current event, the function returns
None.gtk.get_current_event_stategtk.get_current_event_stateReturns :the state of the current event if any or
None if there is no current event or
stateThis function is available in PyGTK 2.6 and above.The gtk.get_current_event_state() function
returns the state of the current event or None if there
is no current event or state.gtk.get_current_event_timegtk.get_current_event_timeReturns :the timestamp of the current event or
0LThe gtk.get_current_event_time() function
returns the timestamp from the current event or 0L if there is no current
event.gtk.init_checkgtk.init_checkReturns :True if GTK has been
successfully initializedThe gtk.init_check() function tries to
initialize GTK and returns True if
successful.gtk.remove_log_handlersgtk.remove_log_handlersThis function is available in PyGTK 2.10 and above.The gtk.remove_log_handlers() function
removes the default PyGTK log handlers,gtk.add_log_handlersgtk.add_log_handlersThis function is available in PyGTK 2.10 and above.The gtk.add_log_handlers() function
installs the default PyGTK log handlers,gtk.set_interactivegtk.set_interactiveinteractiveinteractive :If True interactive usage is enabledThis function is available in PyGTK 2.16 and above.The gtk.set_interactive() function can be used to
enable or disable interactive usage of PyGTK. By default, interactive usage is switched
on when importing gtk. You can then use PyGTK from the Python command prompt and see the
results immediately without having to call gtk.main().gtk.show_urishow_uriscreenuritimestampscreen :A
gtk.gdk.Screen
to show the uri on or None for the default screen.
uri :the uri to show.timestamp :a timestamp to prevent focus stealing.
This function is available in PyGTK 2.14 and above.
The show_uri() function is a convenience
function for launching the default application to show the uri.
The uri must be of a form understood by GIO. Typical examples are:
file:///home/gnome/pict.jpg
http://www.gnome.org
mailto:me@gnome.org
Ideally the timestamp is taken from the event triggering the
gtk.show_uri()
call. If timestamp is not known you can take gtk.gdk.CURRENT_TIME.
This function can be used as a replacement for gnome_vfs_url_show() and gnome_url_show().