Re: SimpleList drag and drop- works :-)



On Fri, 22 Sep 2006 11:22:37 +0200
"Ratcliffe, Jeffrey (Peters)" <Jeffrey Ratcliffe External eads com> wrote:

How did you check what event-types occurred? Did you write some code to tell you? Or was it just experience?

Muppet showed us this awhile back, and on occaision
I needed to use it. It just watches all events on a widget.

$window->signal_connect (event => sub {
   my ($item, $event) = @_;
   warn "event ".$event->type."\n";
   return 0;  #return 1 prevents window from closing
  # return 0 lets the signal thru
});


And work it does very nicely, thank you. If someone wants to suggest a better event, I am all ears, but for 
the moment it does the job.

Well the reason I got interested in this, was to gain more familiarity
with the Drag-n-Drop functionality of Gtk2. So I would bet that
there is some variety of  "drag-dest-...." callback ( as shown in perldoc Gtk2::Widget ),
that would be the best thing to use. 

What I did was sort of rudimentary drop detection, but it was easier than figuring
out all those Gtk2::Widget callbacks.


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html



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