gtk_widget_show(drawing->scrollbar);
gtk_widget_show(drawing->hbox);
+ /* Allocate the colors */
+ GdkColormap* colormap = gdk_colormap_get_system();
+
+ gdk_colormap_alloc_colors(colormap, drawing_colors, NUM_COLORS, FALSE,
+ TRUE, NULL);
+
return drawing;
}
void drawing_destroy(Drawing_t *drawing)
{
g_info("drawing_destroy %p", drawing);
+
+ /* Free the colors */
+ GdkColormap* colormap = gdk_colormap_get_system();
+
+ gdk_colormap_free_colors(colormap, drawing_colors, NUM_COLORS);
+
+
+
// Do not unref here, Drawing_t destroyed by it's widget.
//g_object_unref( G_OBJECT(drawing->drawing_area));
if(drawing->gc != NULL)
PropertiesLine *properties = (PropertiesLine*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
- //gdk_gc_set_foreground(draw_context->gc, properties->color);
- gdk_gc_set_rgb_fg_color(draw_context->gc, &properties->color);
- //gdk_gc_set_foreground(gc, properties->color);
+ gdk_gc_set_foreground(draw_context->gc, &properties->color);
+ //gdk_gc_set_rgb_fg_color(draw_context->gc, &properties->color);
gdk_gc_set_line_attributes( draw_context->gc,
properties->line_width,
properties->style,
PropertiesArc *properties = (PropertiesArc*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
- //gdk_gc_set_foreground(draw_context->gc, properties->color);
- gdk_gc_set_rgb_fg_color(draw_context->gc, properties->color);
+ gdk_gc_set_foreground(draw_context->gc, properties->color);
+ //gdk_gc_set_rgb_fg_color(draw_context->gc, properties->color);
gint x=0, y=0;
gint *offset=NULL;
PropertiesBG *properties = (PropertiesBG*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
- //gdk_gc_set_foreground(draw_context->gc, properties->color);
- gdk_gc_set_rgb_fg_color(draw_context->gc, properties->color);
+ gdk_gc_set_foreground(draw_context->gc, properties->color);
+ //gdk_gc_set_rgb_fg_color(draw_context->gc, properties->color);
//g_critical("DRAWING RECT : x: %i, y: %i, w:%i, h:%i, val1 :%i, val2:%i ",
// draw_context->previous->over->x,