How to draw a text in widget?



I am trying to draw some text in a widget, I search in the document then
came up with these code:

        GdkGC *pgc;
        GdkColor col;
        GdkFont *pfnt;
        pgc=widget->style->fg_gc[0];
        col.red=65535,col.green=0;col.blue=0;col.pixel=0;
        gdk_gc_set_rgb_fg_color(pgc,&col);
        pfnt=gdk_font_load("");
        gdk_draw_string(widget->window,pfnt,pgc,5,10," ABCDEFG abcdefg
012345");
        gdk_font_unref(pfnt);

I still don't know how to clips the text. 
Also gdk_draw_string and gdk_font_unref are all deprecated.

Any one can show me a better way to draw text in widget?

Thanks a lot.




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