Try retreiving the cairo context for the widget you want to draw in and try 
this:


    /* Create the default Layout */
    layout = pango_cairo_create_layout(cr);

    /* Atach the font descriptor */
    font_description = pango_font_description_new();

    /* Setup Fonts and color and other layout attributes*/
    pango_font_description_set_family(font_description,"Helvetica");
    cairo_set_source_rgba(cr, 0.3, 0.3, 0.3, 1.0); 
    pango_font_description_set_absolute_size(font_description, 0.28 * 
PANGO_SCALE);
    pango_font_description_set_weight(font_description,PANGO_WEIGHT_BOLD);


    pango_layout_set_font_description(layout,font_description);

   gchar * l1 = g_strdup_printf("%s-%d",label->aid,label->nid);

    cairo_move_to(cr, 0.05 * xmultip, 0.00 * ymultip);

    pango_layout_set_text(layout,l1,-1);

    pango_cairo_show_layout(cr,layout);


You can also use 

    pango_layout_set_markup(layout,l1,-1);


using Pango markup to change text style.





 EMAILING FOR THE GREATER GOOD
Join me

> Date: Sat, 27 Mar 2010 23:58:15 +0530
> Subject: displaying a number on screen
> From: rao.nisc...@gmail.com
> To: gtk-app-devel-list@gnome.org
> 
> Hi,
> 
> I am sorry if this is not the right mailing list.
> 
> For given x and y co-ordinates is it possible to display a particular number
> at that position? or in other words, is it possible to "paint" a number or
> character on the screen at a given point?
> 
> Thanks in advance.
> 
> -- 
> regards,
> Nischal E Rao
> blogs.sun.com/nischal
> 
> Join RVCE OSUM at http://osum.sun.com/group/rvceosum
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
                                          
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to