GtkCombo Win32



Woops I think that the last e-mail I sent went to the wrong place so here it is again just in case.

I seem to be having a problem with GtkCombo under win32 heres the error msg I get, well all of the errors 
seem to have todo with the entry part of the gtkcombo box.

errors:

GtkCombobox.exe (pid:1204): GLib-GObject-WARNING **: invalid cast from (NULL) pointer to `GtkEntry'

GtkCombobox.exe (pid:1204): GLib-GObject-WARNING **: invalid cast from (NULL) pointer to `GObject'

GtkCombobox.exe (pid:1204): GLib-GObject-WARNING **: invalid (NULL) pointer instance

GtkCombobox.exe (pid:1204): GLib-GObject-CRITICAL **: file gsignal.c: line 1600(g_signal_connect_data): 
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

the following code is what generated the errors this is the first time I've had a problem like this under 
win32.

#include <gtk/gtk.h>

void select_print (GtkWidget *widget, GtkWidget *entry);

main (gint argc, gchar *argv[])
{
    GtkWidget *window;
    GtkWidget *combobox;
    GList *glist = NULL;

    gtk_init (&argc, &argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (window), "GtkCombobox");
    g_signal_connect (G_OBJECT (window), "destroy",
                      G_CALLBACK (gtk_main_quit),
                      NULL);

    combobox = gtk_combo_new ();
    /*GTK_COMBO (combobox)->entry = gtk_entry_new ();*/
    glist = g_list_append (glist, "AM");
    glist = g_list_append (glist, "PM");
    gtk_combo_set_popdown_strings (GTK_COMBO (combobox), glist);
    /*gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combobox)->entry), "AM");*/

    g_free (glist);

    gtk_combo_set_use_arrows (GTK_COMBO (combobox), TRUE);
    gtk_container_add (GTK_CONTAINER (window), combobox);
    g_signal_connect (G_OBJECT (GTK_ENTRY (GTK_COMBO (combobox)->entry)), "activate",
                      G_CALLBACK (select_print), combobox);

    gtk_widget_show (combobox);
    gtk_widget_show (window);

    gtk_main ();
     
    return 0;

}


void select_print (GtkWidget *widget, GtkWidget *combo)
{
    g_print ("\n combobox set to: %s \n", gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (combo)->entry)));
}    

is it just user error and I'm doing some thing wrong or does it have to do with the win32 port of Gtk? Any 
help on this would be greatly aprechated.

thx in advance.


_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus



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