Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Drag and drop with selection

by blogan (Monk)
on May 27, 2005 at 14:45 UTC ( [id://461087]=perlquestion: print w/replies, xml ) Need Help??

blogan has asked for the wisdom of the Perl Monks concerning the following question:

I'm looking for a way to implement drag and drop of multiple items. I've seen Tk::DragDrop and Tk::DropSite and played with the demo. It still seems like I'm playing with individual drawings. Ideally, what I would like is to have something that I could select multiple items, have a context menu if I right-click on a item or group of items, drag multiple items, etc. Similar to how some file managers behave. However, all the file managers I've found that use Perl/Tk mostly use just text lists. Or do I just need to bite the bullet and implement the selection and context-menus myself?

Replies are listed 'Best First'.
Re: Drag and drop with selection
by Courage (Parson) on May 27, 2005 at 17:20 UTC
Re: Drag and drop with selection
by japhy (Canon) on May 28, 2005 at 04:10 UTC
    I've implemented a multi-item d-n-d in Gtk2, but I'm not sure how translatable to Tk that is.

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
      I would also be interested in seeing this. I'm not too picky on the library I'll be using.
Re: Drag and drop with selection
by scmason (Monk) on May 27, 2005 at 23:07 UTC
    I wrote a file manager in perl once. What I did was place 'clickable icons' on a canvas (which was really a subclassed label). When you right clicked on these 'icons' you could select 'copy to', 'move to', 'delete' etc. I never implemented drag and drop.

    I did plan to though. I was going to use tk's tell function to do it. Essentially, I was going to TK's drag and drop along with tell pass enough information to move/copy/delete files. The problem I found was that in order to make it work right, and feel right to the user, I would have to construct a lot of the features/feels myself. In the end, it would have seemed like a MUNGed up hack.

    You can check out the 'clickable icon' i mentioned from the source here: Perlbox - Desktop

    Good luck. Keep us posted on how you do.

    "Never take yourself too seriously, because everyone knows that fat birds dont fly" -FLC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://461087]
Approved by holli
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-11-05 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (28 votes). Check out past polls.