Re: Custom CellRendererText



i have tried to do this:


///////////////////////////////////////////////////
const Glib::ustring title_text = property_text();

		Glib::RefPtr<Pango::Layout> title;
		Cairo::RefPtr<Cairo::Context> context; 
		
		context = window->create_cairo_context();
		
		context->set_font_size(14);

		title->create(context);
		title->set_text(title_text);
		
		//widget.get_window()->dra
		window->draw_layout(refGC, 1, cell_area.get_y() + y_offset + cell_ypad,
title);


////////////////////////////////////////////////////////

Compiles, but when i run on windows crashes..


any other idea or method?

thanks..

On Wed, 30 Jan 2008 11:00:33 +0100, Iker Perez de Albeniz <ialbeniz cbt es>
wrote:
> 
> 
> I have found draw_layout so we can draw a pango:layout... oon the
> documentation apears that its posible to set text to the layout.. but
when
> a ida a pango.layout element to my code i have this error..
> 
> C2512: 'Pango::Layout' : no suitable contructor available
> 
> 
> any idea?
> 
> thanks..
> 
> On Wed, 30 Jan 2008 10:34:23 +0100, Iker Perez de Albeniz
> <ialbeniz cbt es>
> wrote:
>>
>> Hi,
>>
>> I am tring to make my own CellRendererText from a CellRenderer... i have
>> made other cellrenderers drawing (windoiw->draw...) on ::render_vfunc.
>>
>> Now i want to add text but when i do window-> dont apear draw_string
>> (window is a Gdk::Drawable[1]), i have search gtk::CellrendererText code
>> to
>> see how this is done but ai dont know how it do.. can somebody explain
> me
>> how to do it or how CellrenderText do??
>>
>> thanks
>>
>>
>> [1] void CellRendererTitle::render_vfunc(const
>> Glib::RefPtr<Gdk::Drawable>&
>> window, Gtk::Widget& widget, const Gdk::Rectangle& background_area,
> const
>> Gdk::Rectangle& cell_area, const Gdk::Rectangle& expose_area,
>> Gtk::CellRendererState flags)
>>
>>
>> _______________________________________________
>> 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



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