Re: GtkCombo Win32
- From: TORRI Vincent <Vincent Torri math u-bordeaux fr>
- To: it s big <jonv0 lycos com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: GtkCombo Win32
- Date: Fri, 21 Feb 2003 10:08:38 +0100 (CET)
On Thu, 20 Feb 2003, it s big wrote:
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);
Hello,
under linux, it seems that freeing this list is not appreciated (seg
fault). gtk_combo_set_popdown_strings seems to use the list and not a copy
it. Try without this line.
regards
Vincent TORRI
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
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
TORRI Vincent
Mathematiques Appliquees Bordeaux
Institut de Mathematiques
Universite Bordeaux 1
351 cours de la liberation
33 405 Talence cedex - France
Tel : 33 (0)5 57 96 21 42
Fax : 33 (0)5 56 84 26 26
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]