Re: Adding Diffrent Gtk::CellRenderer in different rows of same column in Gtk::TreeView



Making custom cellrenderer is a good idea. But you won't need to use
GTK(MM) renderers, you should calculate widget allocation and draw cell
area all inside your custom class ("make it from scrap").

Look at sources of renderers you would to use (GTK) and implement their
code in your custom renderer (with GTKMM functions).

I have custom class that could draw text, numbers and datetime, even
more, when user would to edit cell it returns appropriate widget (combo,
spin, entry).

I am using Glib::PropertyProxy< void* > property_data_ to store cell
data in my custom model, where I am saving pointer to object that
describe everything I need to draw cell area.

regards,
-andrew

В Втр, 20/11/2012 в 10:06 -0800, Andrew Potter пишет:
> On Tue, Nov 20, 2012 at 10:03 AM, Andrew Potter <agpotter gmail com>
> wrote:
>         I would make a custom cellrenderer that, given the column
>         data, and for render_vfunc() simply decides what type of row
>         it is going to be and returns whatever render() returns from
>         an internal cellrenderer that does the right thing for the
>         row.
>         
>         
>         I have an example for subclassing CellRenderer here [1]. Just
>         take what it does and instead of adding the two cellrenderers
>         together, just choose one based on the property.
>         
> 
> 
> [1] https://github.com/talisein/Horizon/blob/master/src/summary_cellrenderer.hpp
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> https://mail.gnome.org/mailman/listinfo/gtkmm-list
-- 
Andrew E. Makeev <andrew solvo ru>
Solvo Logistic



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