Re: [gtkmm] how to get MenuItem text ?



Well, this is not exactly what you're looking for, but maybe it helps.
You can use optionmenu1.get_history() to get the index. And since i
usually set the index from a list/vector/whatever it's quite easy to
find the corresponding text.

If someone knows a more efficient way to do this I'd be glad to hear it
;)

regards,

Bart

On Tue, 2003-12-02 at 01:09, SMS WebMaster wrote:
> Hi
> 
> I want to get the MenuItem text but I didn't find any function for that !!!
> 
> Any help on that ?
> 
> because I am using the "OptionMenu" and I want to get the text of the 
> item the user selected, here is my code :
> 
> 
> void PrefWindow::on_optionmenu1_changed()
> {
> 
> Gtk::Menu *me = optionmenu1->get_menu();
> Gtk::MenuItem *myItem = me->get_active();
> 
> set_title(*myItem->GET_TEXT_FUNTION);
> 
> }
> 
> 




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