I've no idea here...
[gtkD.git] / src / gtk / Duit.d
bloba88a734f954f8112a43060d2db9f55d22204bad7
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gtk-General.html
26 * outPack = gtk
27 * outFile = Duit
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = Duit
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_
40 * omit structs:
41 * omit prefixes:
42 * - gtk_true
43 * - gtk_false
44 * - gtk_timeout_
45 * - gtk_idle_
46 * omit code:
47 * imports:
48 * - gdk.Event
49 * - gtk.Widget
50 * - gtk.ObjectGtk
51 * - glib.Str
52 * - lib.gtk
53 * - gtk.gtktypes
54 * - lib.gtk
55 * - gtk.gtktypes
56 * - gthread.Thread;
57 * - gdk.Threads;
58 * structWrap:
59 * - GdkEvent* -> Event
60 * - GtkObject* -> ObjectGtk
61 * - GtkWidget* -> Widget
62 * local aliases:
65 module gtk.Duit;
67 private import gtk.gtktypes;
69 private import lib.gtk;
71 private import gdk.Event;
72 private import gtk.Widget;
73 private import gtk.ObjectGtk;
74 private import glib.Str;
75 private import lib.gtk;
76 private import gtk.gtktypes;
77 private import lib.gtk;
78 private import gtk.gtktypes;
79 private import gthread.Thread;;
80 private import gdk.Threads;;
82 /**
83 * Description
84 * Before using GTK+, you need to initialize it; initialization connects
85 * to the window system display, and parses some standard command line
86 * arguments. The gtk_init() function initializes GTK+. gtk_init() exits
87 * the application if errors occur; to avoid this, use gtk_init_check().
88 * gtk_init_check() allows you to recover from a failed GTK+
89 * initialization - you might start up your application in text mode instead.
90 * Like all GUI toolkits, GTK+ uses an event-driven programming
91 * model. When the user is doing nothing, GTK+ sits in the
92 * main loop and waits for input. If the user
93 * performs some action - say, a mouse click - then the main loop "wakes
94 * up" and delivers an event to GTK+. GTK+ forwards the event to one or
95 * more widgets.
96 * When widgets receive an event, they frequently emit one or more
97 * signals. Signals notify your program that
98 * "something interesting happened" by invoking functions you've
99 * connected to the signal with g_signal_connect(). Functions connected
100 * to a signal are often termed callbacks.
101 * When your callbacks are invoked, you would typically take some action
102 * - for example, when an Open button is clicked you might display a
103 * GtkFileSelectionDialog. After a callback finishes, GTK+ will return
104 * to the main loop and await more user input.
105 * Example1.Typical main function for a GTK+ application
106 * int
107 * main (int argc, char **argv)
109 * /+* Initialize i18n support +/
110 * gtk_set_locale ();
111 * /+* Initialize the widget set +/
112 * gtk_init (argc, argv);
113 * /+* Create the main window +/
114 * mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
115 * /+* Set up our GUI elements +/
116 * ...
117 * /+* Show the application window +/
118 * gtk_widget_show_all (mainwin);
119 * /+* Enter the main event loop, and wait for user interaction +/
120 * gtk_main ();
121 * /+* The user lost interest +/
122 * return 0;
124 * It's OK to use the GLib main loop directly instead of gtk_main(),
125 * though it involves slightly more typing. See GMainLoop in the GLib
126 * documentation.
128 public class Duit
132 * Call this function before using any other GTK+ functions in your GUI applications.
134 public static void init(char[][] args)
136 char** argv = (new char*[args.length]).ptr;
137 int argc = 0;
138 foreach (char[] p; args)
140 argv[argc++] = cast(char*)p;
143 init(&argc,&argv);
147 * This initiates Duit to supports multi threaded programs.
148 * read full documantation at http://gtk.org/faq/#AEN482
149 * from the FAQ:
150 * "There is a single global lock that you must acquire with
151 * gdk_threads_enter() before making any GDK calls,
152 * and release with gdk_threads_leave() afterwards throughout your code."
153 * This is to be used on any call to GDK not executed from the main thread.
155 public static void initMultiThread(char[][] args)
157 Thread.init(null);
158 gdkThreadsInit();
159 init(args);
167 * Initializes internationalization support for GTK+. gtk_init()
168 * automatically does this, so there is typically no point
169 * in calling this function.
170 * If you are calling this function because you changed the locale
171 * after GTK+ is was initialized, then calling this function
172 * may help a bit. (Note, however, that changing the locale
173 * after GTK+ is initialized may produce inconsistent results and
174 * is not really supported.)
175 * In detail - sets the current locale according to the
176 * program environment. This is the same as calling the C library function
177 * setlocale (LC_ALL, "") but also takes care of the
178 * locale specific setup of the windowing system used by GDK.
179 * Returns:
180 * a string corresponding to the locale set, typically in the
181 * form lang_COUNTRY, where lang is an ISO-639 language code, and
182 * COUNTRY is an ISO-3166 country code. On Unix, this form matches the
183 * result of the setlocale(); it is also used on other machines, such as
184 * Windows, where the C library returns a different result. The string is
185 * owned by GTK+ and should not be modified or freed.
187 public static char[] setLocale()
189 // gchar* gtk_set_locale (void);
190 return Str.toString(gtk_set_locale() );
194 * Prevents gtk_init(), gtk_init_check(), gtk_init_with_args() and
195 * gtk_parse_args() from automatically
196 * calling setlocale (LC_ALL, ""). You would
197 * want to use this function if you wanted to set the locale for
198 * your program to something other than the user's locale, or if
199 * you wanted to set different values for different locale categories.
200 * Most programs should not need to call this function.
202 public static void disableSetlocale()
204 // void gtk_disable_setlocale (void);
205 gtk_disable_setlocale();
209 * Returns the PangoLanguage for the default language currently in
210 * effect. (Note that this can change over the life of an
211 * application.) The default language is derived from the current
212 * locale. It determines, for example, whether GTK+ uses the
213 * right-to-left or left-to-right text direction. See
214 * _gtk_get_lc_ctype() for notes on behaviour on Windows.
215 * Returns:
216 * the default language as a PangoLanguage, must not be
217 * freed
219 public static PangoLanguage* getDefaultLanguage()
221 // PangoLanguage* gtk_get_default_language (void);
222 return gtk_get_default_language();
226 * Parses command line arguments, and initializes global
227 * attributes of GTK+, but does not actually open a connection
228 * to a display. (See gdk_display_open(), gdk_get_display_arg_name())
229 * Any arguments used by GTK+ or GDK are removed from the array and
230 * argc and argv are updated accordingly.
231 * You shouldn't call this function explicitely if you are using
232 * gtk_init(), or gtk_init_check().
233 * argc:
234 * a pointer to the number of command line arguments.
235 * argv:
236 * a pointer to the array of command line arguments.
237 * Returns:
238 * TRUE if initialization succeeded, otherwise FALSE.
240 public static int parseArgs(int* argc, char*** argv)
242 // gboolean gtk_parse_args (int *argc, char ***argv);
243 return gtk_parse_args(argc, argv);
247 * Call this function before using any other GTK+ functions in your GUI
248 * applications. It will initialize everything needed to operate the
249 * toolkit and parses some standard command line options. argc and
250 * argv are adjusted accordingly so your own code will
251 * never see those standard arguments.
252 * Note that there are some alternative ways to initialize GTK+:
253 * if you are calling gtk_parse_args(), gtk_init_check(),
254 * gtk_init_with_args() or g_option_context_parse() with
255 * the option group returned by gtk_get_option_group(), you
256 * don't have to call gtk_init().
257 * Note
258 * This function will terminate your program if it was unable to initialize
259 * the GUI for some reason. If you want your program to fall back to a
260 * textual interface you want to call gtk_init_check() instead.
261 * Note
262 * argc:
263 * Address of the argc parameter of your
264 * main() function. Changed if any arguments were handled.
265 * argv:
266 * Address of the argv parameter of main().
267 * Any parameters understood by gtk_init() are stripped before return.
269 public static void init(int* argc, char*** argv)
271 // void gtk_init (int *argc, char ***argv);
272 gtk_init(argc, argv);
276 * This function does the same work as gtk_init() with only
277 * a single change: It does not terminate the program if the GUI can't be
278 * initialized. Instead it returns FALSE on failure.
279 * This way the application can fall back to some other means of communication
280 * with the user - for example a curses or command line interface.
281 * argc:
282 * Address of the argc parameter of your
283 * main() function. Changed if any arguments were handled.
284 * argv:
285 * Address of the argv parameter of main().
286 * Any parameters understood by gtk_init() are stripped before return.
287 * Returns:
288 * TRUE if the GUI has been successfully initialized,
289 * FALSE otherwise.
291 public static int initCheck(int* argc, char*** argv)
293 // gboolean gtk_init_check (int *argc, char ***argv);
294 return gtk_init_check(argc, argv);
298 * This function does the same work as gtk_init_check().
299 * Additionally, it allows you to add your own commandline options,
300 * and it automatically generates nicely formatted
301 * --help output. Note that your program will
302 * be terminated after writing out the help output.
303 * argc:
304 * a pointer to the number of command line arguments.
305 * argv:
306 * a pointer to the array of command line arguments.
307 * parameter_string:
308 * a string which is displayed in
309 * the first line of --help output, after
310 * programname [OPTION...]
311 * entries:
312 * a NULL-terminated array of GOptionEntrys
313 * describing the options of your program
314 * translation_domain:
315 * a translation domain to use for translating
316 * the --help output for the options in entries
317 * with gettext(), or NULL
318 * error:
319 * a return location for errors
320 * Returns:
321 * TRUE if the GUI has been successfully initialized,
322 * FALSE otherwise.
323 * Since 2.6
325 public static int initWithArgs(int* argc, char*** argv, char[] parameterString, GOptionEntry* entries, char[] translationDomain, GError** error)
327 // gboolean gtk_init_with_args (int *argc, char ***argv, char *parameter_string, GOptionEntry *entries, char *translation_domain, GError **error);
328 return gtk_init_with_args(argc, argv, Str.toStringz(parameterString), entries, Str.toStringz(translationDomain), error);
332 * Returns a GOptionGroup for the commandline arguments recognized
333 * by GTK+ and GDK. You should add this group to your GOptionContext
334 * with g_option_context_add_group(), if you are using
335 * g_option_context_parse() to parse your commandline arguments.
336 * open_default_display:
337 * whether to open the default display
338 * when parsing the commandline arguments
339 * Returns:
340 * a GOptionGroup for the commandline arguments recognized
341 * by GTK+
342 * Since 2.6
344 public static GOptionGroup* getOptionGroup(int openDefaultDisplay)
346 // GOptionGroup* gtk_get_option_group (gboolean open_default_display);
347 return gtk_get_option_group(openDefaultDisplay);
351 * Warning
352 * gtk_exit is deprecated and should not be used in newly-written code. Use the standard exit() function instead.
353 * Terminates the program and returns the given exit code to the caller.
354 * This function will shut down the GUI and free all resources allocated
355 * for GTK+.
356 * error_code:
357 * Return value to pass to the caller. This is dependent on the
358 * target system but at least on Unix systems 0 means success.
360 public static void exit(int errorCode)
362 // void gtk_exit (gint error_code);
363 gtk_exit(errorCode);
367 * Checks if any events are pending. This can be used to update the GUI
368 * and invoke timeouts etc. while doing some time intensive computation.
369 * Example2.Updating the GUI during a long computation.
370 * /+* computation going on +/
371 * ...
372 * while (gtk_events_pending ())
373 * gtk_main_iteration ();
374 * ...
375 * /+* computation continued +/
376 * Returns:
377 * TRUE if any events are pending, FALSE otherwise.
379 public static int eventsPending()
381 // gboolean gtk_events_pending (void);
382 return gtk_events_pending();
386 * Runs the main loop until gtk_main_quit() is called. You can nest calls to
387 * gtk_main(). In that case gtk_main_quit() will make the innermost invocation
388 * of the main loop return.
390 public static void main()
392 // void gtk_main (void);
393 gtk_main();
397 * Asks for the current nesting level of the main loop. This can be useful
398 * when calling gtk_quit_add().
399 * Returns:
400 * the nesting level of the current invocation of the main loop.
402 public static uint mainLevel()
404 // guint gtk_main_level (void);
405 return gtk_main_level();
409 * Makes the innermost invocation of the main loop return when it regains
410 * control.
412 public static void mainQuit()
414 // void gtk_main_quit (void);
415 gtk_main_quit();
419 * Runs a single iteration of the mainloop. If no events are waiting to be
420 * processed GTK+ will block until the next event is noticed. If you don't
421 * want to block look at gtk_main_iteration_do() or check if any events are
422 * pending with gtk_events_pending() first.
423 * Returns:
424 * TRUE if gtk_main_quit() has been called for the innermost mainloop.
426 public static int mainIteration()
428 // gboolean gtk_main_iteration (void);
429 return gtk_main_iteration();
433 * Runs a single iteration of the mainloop. If no events are available either
434 * return or block dependent on the value of blocking.
435 * blocking:
436 * TRUE if you want GTK+ to block if no events are pending.
437 * Returns:
438 * TRUE if gtk_main_quit() has been called for the innermost mainloop.
440 public static int mainIterationDo(int blocking)
442 // gboolean gtk_main_iteration_do (gboolean blocking);
443 return gtk_main_iteration_do(blocking);
447 * Processes a single GDK event. This is public only to allow filtering of events
448 * between GDK and GTK+. You will not usually need to call this function directly.
449 * While you should not call this function directly, you might want to know
450 * how exactly events are handled. So here is what this function does with
451 * the event:
452 * Compress enter/leave notify events. If the event passed build an
453 * enter/leave pair together with the next event (peeked from GDK)
454 * both events are thrown away. This is to avoid a backlog of (de-)highlighting
455 * widgets crossed by the pointer.
456 * Find the widget which got the event. If the widget can't be determined
457 * the event is thrown away unless it belongs to a INCR transaction. In that
458 * case it is passed to gtk_selection_incr_event().
459 * Then the event is passed on a stack so you can query the currently handled
460 * event with gtk_get_current_event().
461 * The event is sent to a widget. If a grab is active all events for
462 * widgets that are not in the contained in the grab widget are sent to the
463 * latter with a few exceptions:
464 * Deletion and destruction events are still sent to the event widget for
465 * obvious reasons.
466 * Events which directly relate to the visual representation of the event
467 * widget.
468 * Leave events are delivered to the event widget if there was an enter
469 * event delivered to it before without the paired leave event.
470 * Drag events are not redirected because it is unclear what the semantics
471 * of that would be.
472 * Another point of interest might be that all key events are first passed
473 * through the key snooper functions if there are any. Read the description
474 * of gtk_key_snooper_install() if you need this feature.
475 * After finishing the delivery the event is popped from the event stack.
476 * event:
477 * An event to process (normally) passed by GDK.
479 public static void mainDoEvent(Event event)
481 // void gtk_main_do_event (GdkEvent *event);
482 gtk_main_do_event((event is null) ? null : event.getEventStruct());
490 * Makes widget the current grabbed widget. This means that interaction with
491 * other widgets in the same application is blocked and mouse as well as
492 * keyboard events are delivered to this widget.
493 * widget:
494 * The widget that grabs keyboard and pointer events.
496 public static void grabAdd(Widget widget)
498 // void gtk_grab_add (GtkWidget *widget);
499 gtk_grab_add((widget is null) ? null : widget.getWidgetStruct());
503 * Queries the current grab of the default window group.
504 * Returns:
505 * The widget which currently has the grab or NULL if no grab is active.
507 public static Widget grabGetCurrent()
509 // GtkWidget* gtk_grab_get_current (void);
510 return new Widget( gtk_grab_get_current() );
514 * Removes the grab from the given widget. You have to pair calls to gtk_grab_add()
515 * and gtk_grab_remove().
516 * widget:
517 * The widget which gives up the grab.
519 public static void grabRemove(Widget widget)
521 // void gtk_grab_remove (GtkWidget *widget);
522 gtk_grab_remove((widget is null) ? null : widget.getWidgetStruct());
526 * Registers a function to be called when the mainloop is started.
527 * function:
528 * Function to invoke when gtk_main() is called next.
529 * data:
530 * Data to pass to that function.
532 public static void initAdd(GtkFunction funct, void* data)
534 // void gtk_init_add (GtkFunction function, gpointer data);
535 gtk_init_add(funct, data);
539 * Trigger destruction of object in case the mainloop at level main_level
540 * is quit.
541 * main_level:
542 * Level of the mainloop which shall trigger the destruction.
543 * object:
544 * Object to be destroyed.
546 public static void quitAddDestroy(uint mainLevel, ObjectGtk object)
548 // void gtk_quit_add_destroy (guint main_level, GtkObject *object);
549 gtk_quit_add_destroy(mainLevel, (object is null) ? null : object.getObjectGtkStruct());
553 * Registers a function to be called when an instance of the mainloop is left.
554 * main_level:
555 * Level at which termination the function shall be called. You
556 * can pass 0 here to have the function run at the termination of the current
557 * mainloop.
558 * function:
559 * The function to call. This should return 0 to be removed from the
560 * list of quit handlers. Otherwise the function might be called again.
561 * data:
562 * Pointer to pass when calling function.
563 * Returns:
564 * A handle for this quit handler (you need this for gtk_quit_remove())
565 * or 0 if you passed a NULL pointer in function.
567 public static uint quitAdd(uint mainLevel, GtkFunction funct, void* data)
569 // guint gtk_quit_add (guint main_level, GtkFunction function, gpointer data);
570 return gtk_quit_add(mainLevel, funct, data);
574 * Registers a function to be called when an instance of the mainloop is left.
575 * In comparison to gtk_quit_add() this function adds the possibility to
576 * pass a marshaller and a function to be called when the quit handler is freed.
577 * The former can be used to run interpreted code instead of a compiled function
578 * while the latter can be used to free the information stored in data (while
579 * you can do this in function as well)... So this function will mostly be
580 * used by GTK+ wrappers for languages other than C.
581 * main_level:
582 * Level at which termination the function shall be called. You
583 * can pass 0 here to have the function run at the termination of the current
584 * mainloop.
585 * function:
586 * The function to call. This should return 0 to be removed from the
587 * list of quit handlers. Otherwise the function might be called again.
588 * marshal:
589 * The marshaller to be used. If this is non-NULL, function is
590 * ignored.
591 * data:
592 * Pointer to pass when calling function.
593 * destroy:
594 * Function to call to destruct data. Gets data as argument.
595 * Returns:
596 * A handle for this quit handler (you need this for gtk_quit_remove())
597 * or 0 if you passed a NULL pointer in function.
599 public static uint quitAddFull(uint mainLevel, GtkFunction funct, GtkCallbackMarshal marshal, void* data, GtkDestroyNotify destroy)
601 // guint gtk_quit_add_full (guint main_level, GtkFunction function, GtkCallbackMarshal marshal, gpointer data, GtkDestroyNotify destroy);
602 return gtk_quit_add_full(mainLevel, funct, marshal, data, destroy);
606 * Removes a quit handler by its identifier.
607 * quit_handler_id:
608 * Identifier for the handler returned when installing it.
610 public static void quitRemove(uint quitHandlerId)
612 // void gtk_quit_remove (guint quit_handler_id);
613 gtk_quit_remove(quitHandlerId);
617 * Removes a quit handler identified by its data field.
618 * data:
619 * The pointer passed as data to gtk_quit_add() or gtk_quit_add_full().
621 public static void quitRemoveByData(void* data)
623 // void gtk_quit_remove_by_data (gpointer data);
624 gtk_quit_remove_by_data(data);
636 * Warning
637 * gtk_input_add_full has been deprecated since version 2.4 and should not be used in newly-written code. Use g_io_add_watch_full() instead.
638 * Registers a function to be called when a condition becomes true
639 * on a file descriptor.
640 * source:
641 * a file descriptor.
642 * condition:
643 * the condition.
644 * function:
645 * The function to call.
646 * marshal:
647 * The marshaller to use instead of the function (if non-NULL).
648 * data:
649 * callback data passed to function.
650 * destroy:
651 * callback function to call with data when the input
652 * handler is removed, or NULL.
653 * Returns:
654 * A unique id for the event source; to be used with gtk_input_remove().
656 public static uint inputAddFull(int source, GdkInputCondition condition, GdkInputFunction funct, GtkCallbackMarshal marshal, void* data, GtkDestroyNotify destroy)
658 // guint gtk_input_add_full (gint source, GdkInputCondition condition, GdkInputFunction function, GtkCallbackMarshal marshal, gpointer data, GtkDestroyNotify destroy);
659 return gtk_input_add_full(source, condition, funct, marshal, data, destroy);
663 * Warning
664 * gtk_input_remove has been deprecated since version 2.4 and should not be used in newly-written code. Use g_source_remove() instead.
665 * Removes the function with the given id.
666 * input_handler_id:
667 * Identifies the function to remove.
669 public static void inputRemove(uint inputHandlerId)
671 // void gtk_input_remove (guint input_handler_id);
672 gtk_input_remove(inputHandlerId);
682 * Installs a key snooper function, which will get called on all key events
683 * before delivering them normally.
684 * snooper:
685 * a GtkKeySnoopFunc.
686 * func_data:
687 * data to pass to snooper.
688 * Returns:
689 * a unique id for this key snooper for use with gtk_key_snooper_remove().
691 public static uint keySnooperInstall(GtkKeySnoopFunc snooper, void* funcData)
693 // guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, gpointer func_data);
694 return gtk_key_snooper_install(snooper, funcData);
699 * Removes the key snooper function with the given id.
700 * snooper_handler_id:
701 * Identifies the key snooper to remove.
703 public static void keySnooperRemove(uint snooperHandlerId)
705 // void gtk_key_snooper_remove (guint snooper_handler_id);
706 gtk_key_snooper_remove(snooperHandlerId);
710 * Obtains a copy of the event currently being processed by GTK+. For
711 * example, if you get a "clicked" signal from GtkButton, the current
712 * event will be the GdkEventButton that triggered the "clicked"
713 * signal. The returned event must be freed with gdk_event_free().
714 * If there is no current event, the function returns NULL.
715 * Returns:
716 * a copy of the current event, or NULL if no current event.
718 public static Event getCurrentEvent()
720 // GdkEvent* gtk_get_current_event (void);
721 return new Event( gtk_get_current_event() );
725 * If there is a current event and it has a timestamp, return that
726 * timestamp, otherwise return GDK_CURRENT_TIME.
727 * Returns:
728 * the timestamp from the current event, or GDK_CURRENT_TIME.
730 public static uint getCurrentEventTime()
732 // guint32 gtk_get_current_event_time (void);
733 return gtk_get_current_event_time();
737 * If there is a current event and it has a state field, place
738 * that state field in state and return TRUE, otherwise return
739 * FALSE.
740 * state:
741 * a location to store the state of the current event
742 * Returns:
743 * TRUE if there was a current event and it had a state field
745 public static int getCurrentEventState(GdkModifierType* state)
747 // gboolean gtk_get_current_event_state (GdkModifierType *state);
748 return gtk_get_current_event_state(state);
752 * If event is NULL or the event was not associated with any widget,
753 * returns NULL, otherwise returns the widget that received the event
754 * originally.
755 * event:
756 * a GdkEvent
757 * Returns:
758 * the widget that originally received event, or NULL
760 public static Widget getEventWidget(Event event)
762 // GtkWidget* gtk_get_event_widget (GdkEvent *event);
763 return new Widget( gtk_get_event_widget((event is null) ? null : event.getEventStruct()) );
767 * Sends an event to a widget, propagating the event to parent widgets
768 * if the event remains unhandled. Events received by GTK+ from GDK
769 * normally begin in gtk_main_do_event(). Depending on the type of
770 * event, existence of modal dialogs, grabs, etc., the event may be
771 * propagated; if so, this function is used. gtk_propagate_event()
772 * calls gtk_widget_event() on each widget it decides to send the
773 * event to. So gtk_widget_event() is the lowest-level function; it
774 * simply emits the "event" and possibly an event-specific signal on a
775 * widget. gtk_propagate_event() is a bit higher-level, and
776 * gtk_main_do_event() is the highest level.
777 * All that said, you most likely don't want to use any of these
778 * functions; synthesizing events is rarely needed. Consider asking on
779 * the mailing list for better ways to achieve your goals. For
780 * example, use gdk_window_invalidate_rect() or
781 * gtk_widget_queue_draw() instead of making up expose events.
782 * widget:
783 * a GtkWidget
784 * event:
785 * an event
786 * See Also
787 * See the GLib manual, especially GMainLoop and signal-related
788 * functions such as g_signal_connect().
790 public static void propagateEvent(Widget widget, Event event)
792 // void gtk_propagate_event (GtkWidget *widget, GdkEvent *event);
793 gtk_propagate_event((widget is null) ? null : widget.getWidgetStruct(), (event is null) ? null : event.getEventStruct());