Idle

Description Before using GTK+, you need to initialize it; initialization connects to the window system display, and parses some standard command line arguments. The gtk_init() function initializes GTK+. gtk_init() exits the application if errors occur; to avoid this, use gtk_init_check(). gtk_init_check() allows you to recover from a failed GTK+ initialization - you might start up your application in text mode instead. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ sits in the main loop and waits for input. If the user performs some action - say, a mouse click - then the main loop "wakes up" and delivers an event to GTK+. GTK+ forwards the event to one or more widgets. When widgets receive an event, they frequently emit one or more signals. Signals notify your program that "something interesting happened" by invoking functions you've connected to the signal with g_signal_connect(). Functions connected to a signal are often termed callbacks. When your callbacks are invoked, you would typically take some action - for example, when an Open button is clicked you might display a GtkFileSelectionDialog. After a callback finishes, GTK+ will return to the main loop and await more user input. It's OK to use the GLib main loop directly instead of gtk_main(), though it involves slightly more typing. See GMainLoop in the GLib documentation.

Constructors

this
this(bool delegate() dlg, bool fireNow)

Creates a new idle cycle.

Destructor

~this
~this()

Removes the idle from gtk

Members

Functions

addListener
void addListener(bool delegate() dlg, bool fireNow)

Adds a new delegate to this idle cycle

stop
void stop()

Static functions

add
uint add(GtkFunction funct, void* data)

Warning gtk_idle_add has been deprecated since version 2.4 and should not be used in newly-written code. Use g_idle_add() instead. Causes the mainloop to call the given function whenever no events with higher priority are to be processed. The default priority is GTK_PRIORITY_DEFAULT, which is rather low.

addFull
uint addFull(int priority, GtkFunction funct, GtkCallbackMarshal marshal, void* data, GDestroyNotify destroy)

Warning gtk_idle_add_full has been deprecated since version 2.4 and should not be used in newly-written code. Use g_idle_add_full() instead. Like gtk_idle_add() this function allows you to have a function called when the event loop is idle. The difference is that you can give a priority different from GTK_PRIORITY_DEFAULT to the idle function.

addPriority
uint addPriority(int priority, GtkFunction funct, void* data)

Warning gtk_idle_add_priority has been deprecated since version 2.4 and should not be used in newly-written code. Use g_idle_add_full() instead. Like gtk_idle_add() this function allows you to have a function called when the event loop is idle. The difference is that you can give a priority different from GTK_PRIORITY_DEFAULT to the idle function.

idleCallback
bool idleCallback(Idle idle)

The callback execution from glib

remove
void remove(uint idleHandlerId)

Warning gtk_idle_remove has been deprecated since version 2.4 and should not be used in newly-written code. Use g_source_remove() instead. Removes the idle function with the given id.

removeByData
void removeByData(void* data)

Warning gtk_idle_remove_by_data has been deprecated since version 2.4 and should not be used in newly-written code. Use g_idle_remove_by_data() instead. Removes the idle function identified by the user data.

Variables

idleID
uint idleID;

our gtk idle ID

idleListeners
bool delegate()[] idleListeners;

Holds all idle delegates

Meta