cairo image refresh draw
Trying to redraw different image via changeimage button event. Any ideas how to make that happen?
cairo_surface_t *image; static gboolean pimage(GtkWidget *widget,GdkEventExpose *event,gpointer data) { cairo_t *cr; cr = gdk_cairo_create (widget->window); if(count==3) image = cairo_image_surface_create_from_png("first.png"); else image = cairo_image_surface_create_from_png("second.png"); cairo_set_source_surface(cr, image, 620, 81); cairo_paint(cr); cairo_destroy(cr); return FALSE; } void changeimage(GtkWidget *widget) { } g_signal_connect(window, "expose-event", G_CALLBACK (pimage), NULL); |
See if this thread helps you: http://www.linuxquestions.org/questi...ibrary-792804/
If not then consider shooting off a mail to: http://lists.cairographics.org/mailman/listinfo/cairo |
I'm not 100% sure what the part of the process your having trouble with is, but my best guess is that you want to cause the widget to redraw when changeimage() is called.
Here's my best guess at what you're looking for: Code:
void changeimage(GtkWidget *widget) P.S: please excuse any syntax errors, I work mostly in python, and my C is very rusty. |
yes! elemetary my dear watson, always overlooking the simple...
|
All times are GMT -5. The time now is 11:49 AM. |