Re: changing a combo's popdown strings from select-list callback?



On Tue, 30 Oct 2001, you wrote:
> I can stimulate a segmentation violation if I change the popdown strings of
> a GtkCombo while it is popped up.  This simple Python script is sufficient
> to generate a core file:
> 
>     #!/usr/bin/env python
> 
>     import gtk
> 
>     recursive = 0
>     def fill_new(l, item, combo):
>         global recursive
>         if not recursive:
>             recursive = 1
>             combo.set_popdown_strings(["a","b","c"])
> 
>     def main():
>         window = gtk.Window(gtk.WINDOW_TOPLEVEL)
>         window.set_title("Today's Menu - Pick an Entree")
>         window.connect("destroy", gtk.mainquit)
> 
>         combo = gtk.Combo()
>         combo.set_popdown_strings(["Spam", "Eggs", "Ham"])
>         combo.entry.set_text("pick an entree")
>         combo.list.connect("select-child", fill_new, combo)
>         window.add(combo)
> 
>         window.show_all()
> 
>         gtk.mainloop()
> 
>     if __name__ == "__main__":
>         main()
> 
> How do I work around that?  Presumably, I need to wait until the Combo has
> popped down (and no longer has a pointer grab?) to change its popdown
> strings.
> 
> (I'm using the CVS version of Gtk+, but I doubt it matters.)
> 
> Thx,
> 
> -- 
> Skip Montanaro (skip pobox com)

I have the same problem when changing the popdown strings (in Gtk C ) even if
I change it when it's not popped down. The problem appears when I use the
arrows keys to parse the popdown strings; a Gtk warning message is displayed and
after 4-5 steps a segmentation fault occurs.
The warning message is:
Gtk-CRITICAL **: file gtkcontainer.c: line 1209 (gtk_container_set_focus_child): assertion `GTK_IS_WIDGET (widget)' failed.

Attached is an example (in "interface.c" is my code).

Please help.

Thanks,
Cosmin Bonea 






Attachment: example.tar.gz
Description: GNU Zip compressed data



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