Kyle R . Burton on Wed, 25 Jul 2001 09:37:11 -0400


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

drag and drop with Perl/Tk under Win32


Sorry for the long post, I'm just trying to make sure there is enough
background to understand the issue.  My question surrounds drag and drop
with perl/Tk and problems setting up multiple drag sites with multiple
drop sites.  

Does anyone have any advice or insight relating to drag and drop with
Perl/Tk?  Specificly Local dropsites?


=====

I'm working on a Tk application (under win32) that utilizes drag and
drop.  I've based my code off of the following example:

  http://www.perlmonth.com/columns/perl_tk/localdnd.pl.txt

I've tried to design the application to support something like the MDI
paradigm where you can have more than one document open at a time.

Other than the drag and drop with Tk under Win32 being a little flaky,
everything seems to work well and we've been pretty happy with it.  The
drag and drop seems to randomly discard the drag token mid way through
some of the drag and drop operations.  Although annoying, users can
overcome this by just trying again.

The main issue I'm having is with the multiple document aspect and the
drag and drop.  For the first view [document] constructed, the drag and
drop works normaly, but for the second view it ceases to function.  

I have the views set up as seperate objects (they only use member
variables), where the main application has a 'current view' which is the
only one that's visible.  When the user selects a different view, the
application asks the current view to withdraw itself (packForget) and
asks the new view to make itself visible (pack).

There are two listboxes and a tree [HList] in each view.  Users can drag
items from each listbox into the tree.  I tried to set up two DropSites
on the tree widget, but that didn't seem to work (only one seemed to
take).  To get around that, I started using member variables to store
the originating listbox (the drag origin), and the value that the user
selected.  Then just branching in the drop handler.

The problem manifests itself when creating a second view.  I have print
statements in the start drag handler showing the value of the origin
being stored, and the value being dragged.  For the first view in the
drop handler, these member variables show up fine and the code branches
and handles the drop successfuly.  In the second view, the dragging
starts fine and the print statements show the correct stored member
vairables, but in the drop handler, the member variables are undefined.


Hrm...now that I've explained that, maybe I should check the value of
$self to see if one of the drop handlers are in fact different.  Perhaps
there can only be 1 DropSite?


Any help at all will be appriciated.

Kyle


-- 

------------------------------------------------------------------------------
Your mind free, silent and sufficient,
It exists above all forms.
        -- Yuan-wu
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**