Re: typecast from Gtk::Widget to Gtk::Toolbar?



On 1/11/06, Bob Caryl <bob fis-cal com> wrote:
> You should be able to write something like:
>
> Gtk::UIManager ui;
> // ui has been initialized somewhere in between
> Gtk::Toolbar *mytoolbar =  (Gtk::Toolbar *)ui.get_widget("/Toolbar");
>
> since Gtk::Toolbar is descended from Gtk::Widget, but be sure to check
> that the returned pointer is not NULL before using it.
>

B.Hakvoort <bart hakvoort be> wrote:
> maybe with a Gtk::Toolbar * p_toolbar =
> dynamic_cast<Gtk::Toolbar
> *>( Gtk::UIManager::get_widget("/Toolbar") ) ; ?

Both method work, thank you all!
Is there any differences between these two methods?

--
My blog: http://ihome.ust.hk/~cs_snx/blog/

Dell Inspiron 600m
Pentium-M 1.6G
512MB, 60G
ATI 9000 Mobility



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