manpagez: man pages & more
html files: pygtk
Home | html | info | man
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.

Functions

gtk.check_version

    def gtk.check_version(required_major, required_minor, required_micro)

required_major :

the required major version number

required_minor :

the required minor version number

required_micro :

the required micro version number

Returns :

None if the underlying GTK+ library is compatible or a string describing the mismatch

The 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_cursor

    def gtk.draw_insertion_cursor(widget, drawable, area, location, is_primary, direction, draw_arrow)

widget :

a gtk.Widget

drawable :

a gtk.gdk.Drawable

area :

the rectangle to which the output is clipped, or None if the output should not be clipped

location :

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_RTL

draw_arrow :

if True draw a directional arrow on the cursor. Should be False unless the cursor is split.

Note

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_language

    def gtk.get_default_language()

Returns :

a pango.Language object for the default language

The gtk.get_default_language() function returns a pango.Language describing the default language.

gtk.events_pending

    def gtk.events_pending()

Returns :

True if any events are pending

The 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_event

    def gtk.main_do_event()

event :

a gtk.gdk.Event to process

The 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:

  1. 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.
  2. 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().
  3. Then the event is passed on a stack so you can query the currently handled event with gtk.get_current_event().
  4. 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.

  5. After finishing the delivery the event is popped from the event stack.

gtk.main

    def gtk.main()

The 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_level

    def gtk.main_level()

Returns :

the nesting level of the current invocation of the main loop

The 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_quit

    def gtk.main_quit()

The 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_iteration

    def gtk.main_iteration(block=True)

block :

if True block if no events are pending

Returns :

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_do

    def gtk.main_iteration_do(block=True)

block :

if True block if no events are pending

Returns :

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_current

    def gtk.grab_get_current()

Returns :

the gtk.Widget that has the grab currently or None if no grab is active

The gtk.grab_get_current() function returns the gtk.Widget that has the grab or None if no grab is active.

gtk.quit_add

    def gtk.quit_add(level, func, ...)

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 func

Returns :

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_remove

    def gtk.quit_remove(quit_handler_id)

quit_handler_id :

the ID of a quit handler

The gtk.quit_remove() function removes the quit handler specified by quit_handler_id from the list of quit handlers.

gtk.get_current_event

    def gtk.get_current_event()

Returns :

a copy of the current event or None

Note

This 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_state

    def gtk.get_current_event_state()

Returns :

the state of the current event if any or None if there is no current event or state

Note

This 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_time

    def gtk.get_current_event_time()

Returns :

the timestamp of the current event or 0L

The gtk.get_current_event_time() function returns the timestamp from the current event or 0L if there is no current event.

gtk.init_check

    def gtk.init_check()

Returns :

True if GTK has been successfully initialized

The gtk.init_check() function tries to initialize GTK and returns True if successful.

gtk.remove_log_handlers

    def gtk.remove_log_handlers()

Note

This function is available in PyGTK 2.10 and above.

The gtk.remove_log_handlers() function removes the default PyGTK log handlers,

gtk.add_log_handlers

    def gtk.add_log_handlers()

Note

This function is available in PyGTK 2.10 and above.

The gtk.add_log_handlers() function installs the default PyGTK log handlers,

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.