Re: [gtkmm] Gtk::Combo get_list()->children().clear() howto?



Murray Cumming Comneon com wrote:
http://bugzilla.gnome.org/show_bug.cgi?id=110206


Thanks,

It's a bug.  Thanks for the URL.

By the way, for gtkmm 2.2 these are the workarounds that I can think of:
1. Remove all the items and add them again. (Removing might need 2.)
2. Use GTK+ functions, after using gobj() to get the C instance.

O.K. Cool. I think this might put me back on track. I can grab the C instance hidden in the Gtk::Combo, use the GTK+ functions to manipulate my combo box and then I might be home on time for supper!

Regards,

Jeffrey S. Gavin

Murray Cumming
murrayc usa net
www.murrayc.com

-----Original Message-----
From: Jeff Gavin [mailto:jeff ezclick net] Sent: Dienstag, 3. Juni 2003 03:15
To: gtkmm-list gnome org
Subject: [gtkmm] Gtk::Combo get_list()->children().clear() howto?


I am using a combo box as a search entry. As the user types into the combo box, a database lookup happens, and the top match is displayed in the entry. If the user clicks on the drop-down button, a list of matching entries is displayed. Just like your mozilla browser does when you type on the address line.

I can populate the combo box on the first search, but CANNOT figure out how to delete and repopulate the combo box on subsequent searches.

I have tried:

	combo->get_list()->children().clear();

but this crashes. It's not clear to me that this is a bug, or I don't know how to program it correctly. The debugger says:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1086466976 (LWP 15014)]
0x4012322f in Gtk::ComboDropDown_Helpers::ComboDropDownList::erase(Glib::Lis t_Iterator<Gtk::ComboDropDownItem>) (this=0x827f2b8, position={<List_Iterator_Base<Gtk::ComboDropDownItem>> = {<No data fields>}, head_ = 0x829c804, node_ = 0x82a4e9c}) at combo.h:105 in combo.h

How do you manage (delete and add) the items in a dynamic combo box like this? Is it possible? Certainly someone out there does this.

I have read the list archives and discovered that MANY people have had this problem in the past, but I cannot find any message that posts a solution, workaround or an example. All of the examples that I can find for Gtk::Combo are static combo boxes.

It would be nice if one could simply myCombo->clear(); and get a fresh empty combo box to repopulate, but I cannot make this happen. Any help would be great!

If and when I get this working, I will update the combo example to show future gtkmm programmers how to do this.

Thanks,

Jeffrey S. Gavin

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list








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