PangoLayout - problem with (re)drawing



Hello,

I try to draw PangoLayout on window->notebook->scrolledwindow->gtklayout
using pango_x_render_layout() 

The program is based on viewer.c found in pango examples directory.
Gtk layout's expose_event is handled by layout_expose_handler()
which looks sth like this:

layout_expose_handler(...)
{
          gdk_draw_rectangle ...
          pango_x_render_layout ...
          sleep(1)  /* slowing things for debugging purposes */
}

PROBLEM: 
When the window appears on the screen first time, i get 
all may pango layouts (but the notebook is not drawn yet),
but after the second (sleep(1)) all they get cleared, and then
the notebook appears as well as rectangle, despite of
it was drawn before pangolayouts.

I looked into gtklabel sources and have not found any pango_x_render_layout's
It looks the label is rendered using gtk_paint_layout from gtkstyle instead.
Unfortunatelly, gtk_paint_layout is not documented.

Any docs, hints, examples on how to properly draw PangoLayout?

I use latest CVS versions of glib/pango/gtk.

Regards,
Rafal

-- 
Rafał Kleger-Rudomin (klakier pld org pl)




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