};
GError *error = NULL;
+ if (gdk_display_get_default () == NULL)
+ {
+ g_printerr ("Could not initialize windowing system\n");
+ exit (1);
+ }
+
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_add_main_entries (context, entries, NULL);
int
main (int argc, const char *argv[])
{
- gboolean has_display;
-
g_set_prgname ("gtk-builder-tool");
g_log_set_writer_func (log_writer_func, NULL, NULL);
- has_display = gtk_init_check ();
+ gtk_init_check ();
gtk_test_register_all_types ();
else if (strcmp (argv[0], "enumerate") == 0)
do_enumerate (&argc, &argv);
else if (strcmp (argv[0], "preview") == 0)
- {
- if (!has_display)
- {
- g_printerr ("Could not initialize windowing system\n");
- return 1;
- }
-
- do_preview (&argc, &argv);
- }
+ do_preview (&argc, &argv);
else
usage ();