There's probably not much difference here practically speaking.
Theoretically dynamic_cast might be safer since it does some run-time
type-checking to make sure that the cast is legal. dynamic_cast is
"the C++ way", but the other way is still valid.
Jonner
On 1/10/06, ZeeGeek <[EMAIL PROTECTED]> wrote:
> On 1/11/06, Bob Caryl <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
> _______________________________________________
> gtkmm-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list