Re: [gtkmm] TreeView::get_column_cell_renderer



Sorry if I'm over critical, but dynamic_cast is a really very basic
C++ concept. It should really be child's play.

Barnaby

On Thu, Jul 10, 2003 at 09:17:36AM -0600, Peter Gasper wrote:
> My apologies. The documentation said to use a dynamic cast and I had
> never heard of such a thing before, nor seen any example anywhere on how
> to do it; this seemed to be as good a place as any to ask. I will be
> more careful in the future. 
> 
> thanks.
> 
> On Thu, 2003-07-10 at 00:53, Murray Cumming Comneon com wrote:
> > Murray Cumming
> > murrayc usa net
> > www.murrayc.com
> > 
> > > -----Original Message-----
> > > From: Peter Gasper [mailto:pgasper designadvantage com] 
> > > Sent: Mittwoch, 9. Juli 2003 17:50
> > > To: gtkmm-list gnome org
> > > Subject: [gtkmm] TreeView::get_column_cell_renderer
> > > 
> > > 
> > > I want to modify the properties of a cell renderer. I can use the
> > > following function to get the cell renderer for a column. But I am not
> > > sure how to do the syntax for the dynamic cast descriped below:
> > > 
> > > CellRenderer* Gtk::TreeView::get_column_cell_renderer 
> > > (
> > > int 
> > >   n
> > > ) 
> > > 
> > > 
> > >  
> > > Gets the CellRenderer for that
> > > column.
> > > 
> > > You should dynamic_cast<> to the
> > > expected derived CellRenderer type.
> > > This assumes that the TreeViewColumn
> > > contains only one CellRenderer. 
> > > 
> > > 
> > > If I try the following it complains because get_column_cell_renderer
> > > returns a CellRenderer and not a CellRendererToggle:
> > > 
> > > 	Gtk::CellRendererToggle *cell=get_column_cell_renderer(column);
> > 
> > It would be nice if you asked pure C++ questions somewhere more appropriate.
> > 
> > Gtk::CellRendererToggle* cell = dynamic_cast<Gtk::CellRendererToggle*>(
> > get_column_cell_renderer(column) );
> > 
> > > 	cell->set_radio(true);
> > > 
> > > thanks.
> > > 
> > > -- 
> > > Peter Gasper <pgasper designadvantage com>
> > > 
> > > _______________________________________________
> > > gtkmm-list mailing list
> > > gtkmm-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > > 
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> -- 
> Peter Gasper <pgasper designadvantage com>
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
> 



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