Re: GdkDrawable from GtkDrawingArea and it's cairo surface

2011-07-25 Thread Carlos López Camey
mewhere. > and just for the record, there really is many, many ways to solve this > problem; you must strive to find the most appropriate solution that > satisfies all the specific requirements of your particular problem, and > sometimes this simply comes down to solving it over

GdkDrawable from GtkDrawingArea and it's cairo surface

2011-07-23 Thread Carlos López Camey
Hello again, Let's say I'd like to save a GtkDrawingArea 'screenshot' to a file. I'm able to do cairo_t *cr = gtkDrawingAreaWidget->window; cairo_surface_t *screenshot = cairo_get_target(cr); cairo_surface_write_to_png(screenshot,"screenshot.png"); but what this code does is save a screenshot fo

Re: How to improve performance of this example?

2011-07-23 Thread Carlos López Camey
t (canvas, 500, 600); > >   //gtk_widget_add_events(canvas, GDK_BUTTON_PRESS_MASK); >   gtk_widget_add_events(canvas, GDK_ALL_EVENTS_MASK); >   g_signal_connect(canvas, "button-press-event", G_CALLBACK(handle_mouse), > GINT_TO_POINTER(MOUSE_CLICK)); >   g_signal_connect(canva

How to improve performance of this example?

2011-07-23 Thread Carlos López Camey
Hello, I'm new to the list, GTK+ and C. I'm building a Paint-like application and was trying how to simulate the Brush tool with an example to see how it performs. I read about GtkImage, GtkBitmap and GtkPixmap but was recommended in #gtk+ over at irc.gnome.org to use a GtkDrawingArea + Cairo since