Re: [gtkmm] Activating a Window from a MenuItem



>On Tue, 2002-07-09 at 17:49, Stephen G. Tashiro wrote:
>> I understand that it is easy to write code that causes  a MenuItem to
>> activate another MenuItem.   Often a chain of such things must lead to
>> activating  some Window, like a FileSelection.  Is there a "one liner"
>> way to write this last activation ?
>> 
>> So far, the only way I see to do it  is to use  something like
>> 
>>  list.push_back(MenuElem("Last Menu Label",slot(
>> global_function_that_creates_the_FileSelection) ) );
>
>I'm affraid it's the only way to do it.

if the FS already exists:

 list.push_back (MenuElem ("The Label", 
    slot (*(static_cast<Gtk::Widget *> (&fileSelector)), &Gtk::Widget::show)));

its too bad that gcc's templates can't understand that
Gtk::FileSelection IS-A Gtk::Widget, but without the cast you get
strange results (IIRC).

--p




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