Main application class Every application must have one of these objects.
It may not be global and must be the first Gtk object created. It is a singleton so declaring more than one will simply access the first created.
Normal use of this class is in the main() function to give argc and argv to the gtk initialization. Widgets can use Gtk::Main::quit() to exit from the application.
The internals of the widget have been disguised as signals so that the user can easily connect using the same methods used throughout the widget interface.
Minimal gtkmm application is something like this:
int main(int argc, char *argv[]) {
Gtk::Main kit(argc, argv);
... create some widgets ...
kit.run();
}
Scans the argument vector, and strips off all parameters known to GTK+.
Your application may then handle the remaining arguments.
Note: The argument strings themself won't be modified, although the pointers to them might change. This makes it possible to create your own argv of string literals, which have the type 'const char[]' in standard C++. (You might need to use const_cast<>, though.)
KeySnooper signal Allows you to channel keypresses to a signal handler without registering with the widget.
Parameters:
GtkWidget*
widget.
GdkEventAny&
event
Returns:
int
It is the responsibility of the snooper to pass the keypress to the widget, however, care must be taken that the keypress is not passed twice.
QuitSig& Gtk::Main::signal_quit
(
)
[static]
Quit signal You can connect signal handlers to invoke actions when Gtk::Main::quit() has been called.
Note that main loops can be nested by calling Gtk::Main::run() recursively, therefore receiving this signal doesn't necessarily mean the application is about to be terminated. If you want to receive a signal only when the last main loop quits, call connect() with main_level = 1.