Re: Gtk::DrawingArea gtk_widget_create_pango_layout()



Jeff Simpson wrote:

I'm trying to write text to a Gtk::Drawing area using it as a gdk
drawable and Pango, but I'm having trouble getting the pango layout
out of the widget.

Basically, every variation I try to use ends up with a deadend because
Gtk::DrawingArea isn't a GtkWidget and can't be cast as one. What is
the right method for getting a Pango Layout using gtkmm? Thanks!

  - Jeff


Look at
http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch14s06.html [here is an exapamle]
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Widget.html#a100

Gtk::DrawingArea is a Gtk::Widget as you may see at http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1DrawingArea.html [maybe you confuse that with Gdk::Drawable], so Glib::RefPtr<Pango::Layout> create_pango_layout (const Glib::ustring& text) should be exactly what you need.

antonio




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