Logo Search packages:      
Sourcecode: nabi version File versions

gtk1.c

#include <locale.h>
#include <gtk/gtk.h>

void on_destroy(GtkWidget *widget, gpointer data)
{
    gtk_main_quit();
}

int
main(int argc, char *argv[])
{
    GtkWidget *window;
    GtkWidget *vbox;
    GtkWidget *entry;
    GtkWidget *text;

    gtk_set_locale();
    gtk_init(&argc, &argv);

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_signal_connect(GTK_OBJECT(window), "destroy",
                   GTK_SIGNAL_FUNC(on_destroy), NULL);
    gtk_widget_set_usize(window, 300, 200);

    vbox = gtk_vbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(window), vbox);

    entry = gtk_entry_new();
    gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, TRUE, 0);

    text = gtk_text_new(NULL, NULL);
    gtk_text_set_editable(GTK_TEXT(text), TRUE);
    gtk_box_pack_start(GTK_BOX(vbox), text, TRUE, TRUE, 0);

    gtk_widget_show_all(window);

    gtk_main();

    return 0;
}

Generated by  Doxygen 1.6.0   Back to index