Main

Main — Library initialization.

Synopsis

void                hildon_init                         (void);
void                hildon_gtk_init                     (int *argc,
                                                         char ***argv);

Description

Before using Hildon, you need to initialize it; initialization connects to the window system display, and parses some standard command line arguments. See also gtk_init() to know more details on this topic.

Hildon should be initialized by using hildon_gtk_init(). Note that this function also initializes gtk by calling gtk_init(). In case you need a customized initialization of the GTK+ library you have to use hildon_init() after the customized GTK+ initialization.

Example 1. Typical main function for a Hildon application

int
main (int argc, char **argv)
{
  /* Initialize i18n support */
  gtk_set_locale ();

  /* Initialize the widget set */
  hildon_gtk_init (&argc, &argv);

  /* Create the main window */
  mainwin = hildon_stackable_window_new();

  /* Set up our GUI elements */
 ...

  /* Show the application window */
  gtk_widget_show_all (mainwin);

  /* Enter the main event loop, and wait for user interaction */
  gtk_main ();

  /* The user lost interest */
  return 0;
}
 


Details

hildon_init ()

void                hildon_init                         (void);

Initializes the hildon library. Call this function after calling gtk_init() and before using any hildon or GTK+ functions in your program.

Since 2.2


hildon_gtk_init ()

void                hildon_gtk_init                     (int *argc,
                                                         char ***argv);

Convenience function to initialize the GTK+ and hildon libraries. Use this function to replace a call to gtk_init() and also initialize the hildon library. See hildon_init() and gtk_init() for details.

argc : Address of the argc parameter of your main() function. Changed if any arguments were handled.
argv : Address of the argv parameter of main(). Any parameters understood by gtk_init() are stripped before return.

Since 2.2