gui control flow working with text, need hooking after trace state processing of...
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Draw_Item.c
index eccfef0fea5f876b46b58ab4c06bd5c499d28020..6e5e41f90f86a6502003473a97dab62073e63585 100644 (file)
@@ -98,20 +98,43 @@ gboolean draw_text( void *hook_data, void *call_data)
 
        PangoContext *context;
        PangoLayout *layout;
+       PangoAttribute *attribute;
+       PangoAttrList* attrib_list;// = pango_attr_list_new();
        PangoFontDescription *FontDesc;// = pango_font_description_new();
        gint Font_Size;
        PangoRectangle ink_rect;
                
-       gdk_gc_set_foreground(Draw_Context->gc, Properties->foreground);
-       gdk_gc_set_background(Draw_Context->gc, Properties->background);
+       //gdk_gc_set_foreground(Draw_Context->gc, Properties->foreground);
+       //gdk_gc_set_background(Draw_Context->gc, Properties->background);
 
        layout = Draw_Context->pango_layout;
        context = pango_layout_get_context(layout);
        FontDesc = pango_context_get_font_description(context);
+       attrib_list = pango_layout_get_attributes(layout);
+       if(attrib_list == NULL)
+       {
+               attrib_list = pango_attr_list_new();
+       }
        pango_font_description_set_size(FontDesc, Properties->size*PANGO_SCALE);
-       
+       pango_layout_context_changed(layout);
+
+       attribute = pango_attr_foreground_new(Properties->foreground->red,
+                                                                                                                                                               Properties->foreground->green,
+                                                                                                                                                               Properties->foreground->blue);
+       //pango_attr_list_change(attrib_list, attribute);
+       pango_attr_list_change(attrib_list, attribute);
+       //pango_attribute_destroy(attribute);
+       attribute = pango_attr_background_new(Properties->background->red,
+                                                                                                                                                               Properties->background->green,
+                                                                                                                                                               Properties->background->blue);
+       pango_attr_list_change(attrib_list, attribute);
+       pango_layout_set_attributes(layout, attrib_list);
+
+       //pango_attr_list_unref(attrib_list);
+
        pango_layout_set_text(layout, Properties->Text, -1);
        pango_layout_get_pixel_extents(layout, &ink_rect, NULL);
+       pango_layout_context_changed(layout);
        switch(Properties->position) {
                case OVER:
                                                        gdk_draw_layout(Draw_Context->drawable, Draw_Context->gc,
This page took 0.02353 seconds and 4 git commands to generate.