Initializing GTK...



I am not using GTK in an application as such, but am using GTK as part
of a library I'm building.

Things aren't quite working as I expected them to, and I think one of
the reasons this might be is that I'm not initializing the library
properly.

When things didn't work the way I expected them to, I ripped some code
out of another file I had written that had worked and placed it directly
following my initializtion in the library to see if things were working:

---
    int arg;
    int *argc;
    char *empty[1];

    GtkWidget *button, *fixed, *window;

    empty[0] = "jclgtkawt";

    printf("Initializing gtk...\n");

    arg = 1;
    argc = &arg;

    gtk_init(argc, &empty);
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    fixed = gtk_fixed_new();
    gtk_widget_set_usize(GTK_WIDGET(fixed), 200, 200);
    button = gtk_button_new_with_label("Hello World");
    gtk_container_add(GTK_CONTAINER(fixed), button);
    gtk_container_add(GTK_CONTAINER(window), fixed);

    gtk_widget_show(button);
    gtk_widget_show(fixed);
    gtk_widget_show(window);
    gtk_main();

    return 0;

---

I'm geting the "Initializing gtk..." message, but nothing is happening.
Am I initializing gtk correctly? Is there another way to go about this?

Doug
-- 
My wasted space --- http://www.squirrel.net/~dsouth



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]