Static functions

void deviceGrabAdd(Widget widget, Device device, bool blockOthers)

Adds a GTK+ grab on device, so all the events on device and its associated pointer or keyboard (if any) are delivered to widget. If the block_others parameter is TRUE, any other devices will be unable to interact with widget during the grab.

void deviceGrabRemove(Widget widget, Device device)

Removes a device grab from the given widget.

void disableSetlocale()

Prevents gtk_init(), gtk_init_check(), gtk_init_with_args() and gtk_parse_args() from automatically calling setlocale (LC_ALL, ""). You would want to use this function if you wanted to set the locale for your program to something other than the user’s locale, or if you wanted to set different values for different locale categories.

void doEvent(Event event)

Processes a single GDK event.

bool eventsPending()

Checks if any events are pending.

Event getCurrentEvent()

Obtains a copy of the event currently being processed by GTK+.

Device getCurrentEventDevice()

If there is a current event and it has a device, return that device, otherwise return NULL.

bool getCurrentEventState(GdkModifierType state)

If there is a current event and it has a state field, place that state field in state and return TRUE, otherwise return FALSE.

uint getCurrentEventTime()

If there is a current event and it has a timestamp, return that timestamp, otherwise return GDK_CURRENT_TIME.

uint getDebugFlags()

Returns the GTK+ debug flags.

PgLanguage getDefaultLanguage()

Returns the PangoLanguage for the default language currently in effect. (Note that this can change over the life of an application.) The default language is derived from the current locale. It determines, for example, whether GTK+ uses the right-to-left or left-to-right text direction.

Widget getEventWidget(Event event)

If event is NULL or the event was not associated with any widget, returns NULL, otherwise returns the widget that received the event originally.

GtkTextDirection getLocaleDirection()

Get the direction of the current locale. This is the expected reading direction for text and UI.

OptionGroup getOptionGroup(bool openDefaultDisplay)

Returns a glib.OptionGroup for the commandline arguments recognized by GTK+ and GDK.

Widget grabGetCurrent()

Queries the current grab of the default window group.

void init(string[] argv)

Call this function before using any other GTK+ functions in your GUI applications. It will initialize everything needed to operate the toolkit and parses some standard command line options.

bool initCheck(string[] argv)

This function does the same work as gtk_init() with only a single change: It does not terminate the program if the commandline arguments couldn’t be parsed or the windowing system can’t be initialized. Instead it returns FALSE on failure.

void initMultiThread(string[] args)

This initiates GtkD to supports multi threaded programs. read full documantation at from the FAQ: "There is a single global lock that you must acquire with Threads.enter before making any GDK calls, and release with Threads.leave afterwards throughout your code." This is to be used on any call to GDK not executed from the main thread.

bool initWithArgs(string[] argv, string parameterString, GOptionEntry[] entries, string translationDomain)

This function does the same work as gtk_init_check(). Additionally, it allows you to add your own commandline options, and it automatically generates nicely formatted --help output. Note that your program will be terminated after writing out the help output.

bool iteration()

Runs a single iteration of the mainloop.

bool iterationDo(bool blocking)

Runs a single iteration of the mainloop. If no events are available either return or block depending on the value of blocking.

uint keySnooperInstall(GtkKeySnoopFunc snooper, void* funcData)

Installs a key snooper function, which will get called on all key events before delivering them normally.

void keySnooperRemove(uint snooperHandlerId)

Removes the key snooper function with the given id.

uint level()

Asks for the current nesting level of the main loop.

bool parseArgs(string[] argv)

Parses command line arguments, and initializes global attributes of GTK+, but does not actually open a connection to a display. (See, gdk_get_display_arg_name())

void propagateEvent(Widget widget, Event event)

Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled.

void quit()

Makes the innermost invocation of the main loop return when it regains control.

void run()

Runs the main loop until Main.quit is called.

void setDebugFlags(uint flags)

Sets the GTK+ debug flags.