Function

Gtk-4.0Gtkinit

  • Initializes GTK.

    This function must be called before using any other GTK functions in your GUI applications.

    It will initialize everything needed to operate the toolkit. In particular, it will open the default display (see Gdk.Display.get_default).

    If you are using Gtk.Application, you usually don't have to call this function; the Gio.Application.startup handler does it for you. Though, if you are using Gio.Application methods that will be invoked before startup, such as local_command_line, you may need to initialize GTK explicitly.

    This function will terminate your program if it was unable to initialize the windowing system for some reason. If you want your program to fall back to a textual interface, call Gtk.init_check instead.

    GTK calls signal (SIGPIPE, SIG_IGN) during initialization, to ignore SIGPIPE signals, since these are almost never wanted in graphical applications. If you do need to handle SIGPIPE for some reason, reset the handler after gtk_init(), but notice that other libraries (e.g. libdbus or gvfs) might do similar things.

    Returns void