Main

Undocumented in source.

Members

Static functions

deviceGrabAdd
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.

deviceGrabRemove
void deviceGrabRemove(Widget widget, Device device)

Removes a device grab from the given widget.

disableSetlocale
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.

doEvent
void doEvent(Event event)

Processes a single GDK event.

eventsPending
bool eventsPending()

Checks if any events are pending.

getCurrentEvent
Event getCurrentEvent()

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

getCurrentEventDevice
Device getCurrentEventDevice()

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

getCurrentEventState
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.

getCurrentEventTime
uint getCurrentEventTime()

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

getDebugFlags
uint getDebugFlags()

Returns the GTK+ debug flags.

getDefaultLanguage
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.

getEventWidget
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.

getLocaleDirection
GtkTextDirection getLocaleDirection()

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

getOptionGroup
OptionGroup getOptionGroup(bool openDefaultDisplay)

Returns a #GOptionGroup for the commandline arguments recognized by GTK+ and GDK.

grabGetCurrent
Widget grabGetCurrent()

Queries the current grab of the default window group.

init
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.

initCheck
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 windowing system can’t be initialized. Instead it returns %FALSE on failure.

initMultiThread
void initMultiThread(string[] args)

This initiates GtkD to supports multi threaded programs. read full documantation at http://gtk.org/faq/#AEN482 from the FAQ: "There is a single global lock that you must acquire with gdk_threads_enter() before making any GDK calls, and release with gdk_threads_leave() afterwards throughout your code." This is to be used on any call to GDK not executed from the main thread.

initWithArgs
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.

iteration
bool iteration()

Runs a single iteration of the mainloop.

iterationDo
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.

keySnooperInstall
uint keySnooperInstall(GtkKeySnoopFunc snooper, void* funcData)

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

keySnooperRemove
void keySnooperRemove(uint snooperHandlerId)

Removes the key snooper function with the given id.

level
uint level()

Asks for the current nesting level of the main loop.

parseArgs
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_display_open(), gdk_get_display_arg_name())

propagateEvent
void propagateEvent(Widget widget, Event event)

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

quit
void quit()

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

run
void run()

Runs the main loop until gtk_main_quit() is called.

setDebugFlags
void setDebugFlags(uint flags)

Sets the GTK+ debug flags.

Meta