Re: GdkFont->Pango replacement



Hi Havoc,

Havoc Pennington wrote:

>
> > *    To replace gdk_draw_string (), I do the following
> >            GtkWidget *area;
> >            PangoLayout *layout;
> >            GdkPixmap *pixmap;
> >            layout = gtk_widget_create_pango_layout (area, "");
> >            pango_layout_set_text (layout, string, -1);
> >            gtk_paint_layout (area->style,
> >                                           pixmap,
> >                                           GTK_WIDGET_STATE (area),
> >                                           FALSE,
> >                                           NULL,
> >                                           area,
> >                                           NULL,
> >                                           x,
> >                                           y,
> >                                           layout);
>
> That's right if the layout should be "themed", if it shouldn't be
> themed then it should just be gdk_draw_layout() instead of
> gtk_paint_layout().

Thanks Havoc!!  I don't need themes and hence I have now used gdk_draw_layout
() in my code. But the performance has really been affected.

I need a set of strings to be drawn to the window, in a scrolling manner. It
is happening now. But the rate at which it scrolls is pathetic. It causes
flicker also.

I am using gdk_window_invalidate_rect () to invalidate the area to be
redrawn. My expose_event handler is using  gdk_draw_drawable (). Should this
be changed?

Could you please tell me what I am doing wrong here. Is there any way by
which I can improve the time taken to draw the strings.

Thanks
Deepa




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