Hi,
I solved the "problem" that I had with having to add some event handlers
to a GtkDrawingArea.
The GtkDrawingArea object is not known in the main section of an
application built with glade (or any other multi-section application).
By adding "gtk_widget_add_events" in the "expose_event" callback
function I could set the additional event(s) at the moment the
GtkDrawingArea pops up. I have included the sample code below. I don't
expect any problems to occur when the GtkDrawingArea pops up several
times ?
gboolean
on_xyx_drawingarea1_expose_event (GtkWidget *widget,
GdkEventExpose *event,
gpointer user_data)
{
gtk_widget_add_events( widget, GDK_BUTTON_PRESS_MASK );
gdk_draw_rgb_image (widget->window,
widget->style->fg_gc[GTK_STATE_NORMAL],
0, 0, WIDTH, HEIGHT,
GDK_RGB_DITHER_MAX, rgb_img, WIDTH * 3);
return FALSE;
}
Best regards,
Peter
============================================
Hi,
How do I use gtk_widget_add_events and GtkDrawingArea ? The
GtkDrawingArea pointer is unknown in the main loop of a program created
with Glade ? I need to let GtkDrawingArea catch mouse clicks.
I have about 3 different GtkDrawingArea's in my application and each of
them needs to respond to mouse clicks. I have added the necessary
callbacks, but they do not respond. How do Iget apointer to
GtkDrawingArea in the main section of the application ?
Best regards,
Peter
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list