[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: Widget type name
From:       Murray Cumming <murrayc () murrayc ! com>
Date:       2005-03-30 8:21:17
Message-ID: 1112170877.5578.1.camel () localhost ! localdomain
[Download RAW message or body]

On Wed, 2005-03-30 at 00:16 +0200, Bo Lorentsen wrote:
> Hi ...
> 
> I have been playing a little with the "glademm", and I ended up looking 
> all over th doc. for at widget type string, to identify a widget found 
> in a glade file.
> 
> I hoped for something like :
> 
> Gtk::Widget *pWidget;
> m_refGlade->get_widget( "test_widget", pWidget );
> if( pWidget->get_typename() == "GtkEntry" ) {
>     // Attach relevant code
> }
> 
> Is this somehow possible, or is dynamic casting the only possible solution ?

Normal C++ RTTI can give you a string, but dynamic_cast<> is the only
sensible way to do this.

-- 
Murray Cumming
murrayc@murrayc.com
www.murrayc.com
www.openismus.com

_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic