signals...?




I do this:

*************************************************************
  area = gtk_drawing_area_new();
  gtk_drawing_area_size( GTK_DRAWING_AREA(area), 500, 200);

  gtk_signal_connect_object (GTK_OBJECT (area), "expose_event",
			     (GtkSignalFunc) area_expose_event, GTK_OBJECT(area));

  gtk_signal_connect (GTK_OBJECT (area), "button_press_event",
		      (GtkSignalFunc) area_button_press_event, GTK_OBJECT(area));

  gtk_widget_set_events (area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK |
			 GDK_BUTTON_RELEASE_MASK |
			 GDK_POINTER_MOTION_MASK | GDK_KEY_PRESS_MASK );
*************************************************************


and things work, when its exposed, it does stuff, when there is a button 
click, it does stuff......

the below is what i want, and DOESNT work:

*************************************************************
   image = gdk_image_new(GDK_IMAGE_FASTEST, visual,
			 CANVAS_WIDTH, CANVAS_HEIGHT);

   imageWidget = gtk_image_new( image, NULL );

   gtk_signal_connect_object (GTK_OBJECT (imageWidget), "expose_event",
			      (GtkSignalFunc) area_expose_event,
			      GTK_OBJECT(imageWidget));
   
   gtk_signal_connect (GTK_OBJECT (imageWidget), "button_press_event",
		       (GtkSignalFunc) area_button_press_event,
		       GTK_OBJECT(imageWidget));

   gtk_widget_set_events (imageWidget, GDK_EXPOSURE_MASK |
			  GDK_BUTTON_PRESS_MASK |
			  GDK_BUTTON_RELEASE_MASK |
			  GDK_POINTER_MOTION_MASK |
			  GDK_KEY_PRESS_MASK );
*************************************************************

both widgets show....i can draw pictures etc using image->mem.....
but one the drawingarea one registers signals.... :/

what fundamental thing am I missing? :)
beginning to bother me since I cannot seem to gleen the answer from source

thanks

Jeff



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]