Re: Canvas widget problem (example included)



All,
  I've done some more debugging on this and have found the behavior
to be even more odd than previously thought.

If I execute this command I will NOT get all motion and button press
events, I'll only get those that occur over the canvas item.

gnome_canvas_item_grab(item,
		       GDK_POINTER_MOTION_MASK|
		       GDK_BUTTON_PRESS_MASK,
		       NULL,
		       GDK_CURRENT_TIME)


But If I do this command I'll get all the motion and button releases.
Somehow the events only work if a GDK_BUTTON_RELEASE is expected. 

gnome_canvas_item_grab(item,
		       GDK_POINTER_MOTION_MASK|
		       GDK_BUTTON_RELEASE_MASK,
		       NULL,
		       GDK_CURRENT_TIME)


 You can verify this yourself by changing the above lines in the code I
sent earlier. You'll also want to change the if() to the line below
so you can get your pointer back after the grab :)

  if((event->type == GDK_BUTTON_PRESS) ||
     (event->type == GDK_BUTTON_RELEASE)) {



  -SOTTEK



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