Re: clearing or resetting the popdown strings of a Gtkmm Combo box



On Thu, Jun 09, 2005 at 02:51:45PM -0400, Bob Huston wrote:
>  
> I have a series of combo boxes that a change in one needs to update the
> contents of the next one.
>  
> I fill each combo like this:
>  
> std::list<Glib::ustring> combo1Strings;
> combo1Strings.push_back("string1");
> combo1Strings.push_back("string2");
>  
> pCombo1->set_popdown_strings(combo1Strings);
>  
> I then catch the "on_changed" signal for pCombo and in that handler, try and
> reset the contents of
> a second combo box in the same basic way.
>  
> void CMyClass::on_Combo1Changed()
> {
>     std::list<Glib::ustring> combo2Strings;
>     // call out to build the correct contents, based on state of combo1
>     BuildCombo2Strings(pCombo1, combo2Strings);
>     pCombo2->set_popdown_strings(combo2Strings);
> }
>  
>  
> What happens is that everytime I change pCombo2's drop down strings, it
> works in the application, but
> the terminal window running the application logs the following:
>  
> Gtk_CRITICAL **: gtk_combo_set_popdown_strings: assertion 'strings != NULL'
> failed
Maybe you should not use a local variable as the argument of
set_popdown_strings(), rather you should use a long-term-exist object,
eg. a static object or a pointer initialized by 'new'. 
>  
> I have tried several approaches from calling "get_popdown_strings", clearing
> it and resetting it in, and
> accessing the C object for the combo and passing NULL as the string list
> ptr.
>  
> Can't get the assertion to go away.
>  
> How do you either clear or reset the pop down strings for a Gtkmm combo box?
>  
> --Bob
>  

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

-------------------------

-- 
Q:	What is purple and commutes?
A:	An Abelian grape.




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