Re: [gtkmm] add a button into a TreeModel of Treeview ???



On Tue, 2004-06-22 at 18:50 +0100, Roger Leigh wrote:
> cedric <cedric probesys com> writes:
> 
> > i ve a problem with a Gtk::TreeModel::ColumnRecord: i want to put a
> > button in it, but i don t manage to do it! :'(
> 
> >From my understanding of the TreeView, you would need to provide a new
> CellRenderer, CellRendererButton, which would render a button for you.

A button is not data, so it's silly to put it in the model or to try to
render it.

This does need a custom cellrenderer, but I don't think it needs to be
connected to anything in the model. There is a customcellrenderer
example.

> It would implement properties such as property_label and
> property_clicked_slot as a label and slot to call when clicked.  You
> would then put the label and slot into the TreeModel, and tie them to
> the properties with Gtk::TreeViewColumn::add_attribute().
> 
> Point of interest: can the slots be copied by value and stored in the
> TreeModel?
> 
> 
> Regards,
> Roger
> 
-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com





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