event callback order



Hello All,

Can I change the order in which Gtk2 event callbacks are made? I've been reviewing the FAQ and googling without luck. I have an object that inherits from Gnome2::Canvas::Group as follows:

use Glib::Object::Subclass
   Gnome2::Canvas::Group::,

   signals => {
       event => \&_item_event
   },

   properties => [ a bunch of properties
   ];

and then later,

sub _item_event
{
   my ($item, $event) = @_;

   my $event_type = $event->type;

   print "MAP_ITEM, item: $item  event_type: $event_type\n";
}


I also have a driver, called canvas10, that connects to events associated with this object and spits out a similar message. What I see is the following when I run the program:

CANVAS10, event type: motion-notify  coords: 100 86
MAP_ITEM, item: MapItem=HASH(0x841e94c)  event_type: motion-notify
CANVAS10, event type: motion-notify  coords: 102 86
MAP_ITEM, item: MapItem=HASH(0x841e94c)  event_type: motion-notify
CANVAS10, event type: leave-notify  coords: 110 86
MAP_ITEM, item: MapItem=HASH(0x841e94c)  event_type: leave-notify

Based on this output I'd say that the driver program is handling the event before the object that it instantiates, but I'd really like the MapItem to have first dibs. Any insights and help appreciated.

-James




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