473,785 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drag and drop in Tkinter. How difficult is it?

Hi all,

I was thinking about developing a drag and drop application and was curious
how difficult it is to do. Basically I want to have a set of objects that I
move around the screen and drop into place.

Anyone else ever done it? Got any tips?

Thanks,
Marc
Jul 18 '05 #1
8 4425
In article <Ap************ ********@comcas t.com>,
Marc <lo********@com cast.net> wrote:
Hi all,

I was thinking about developing a drag and drop application and was curious
how difficult it is to do. Basically I want to have a set of objects that I
move around the screen and drop into place.

Jul 18 '05 #2
On Thu, 04 Sep 2003 09:14:08 -0000, rumours say that cl****@lairds.c om
(Cameron Laird) might have written:
In article <Ap************ ********@comcas t.com>,
Marc <lo********@com cast.net> wrote:
[Marc]
I was thinking about developing a drag and drop application and was curious
how difficult it is to do. Basically I want to have a set of objects that I
move around the screen and drop into place.


- Cameron -LOTS of applications--several I've written, I
know--do this sort of thing. You'll need to
learn about bind(), and most likely the events
<1>
<B1-Motion>
<ButtonReleas e-1>
in particular: you'll teach <1> to start a
drag, <B1-Motion> to display the dragged object
moving around the screen, and <ButtonReleas e-1>
to finish the drop.

Have you read <URL: http://
groups.google. com/groups?as_q=dra g+drop+tkinter& as_ugroup=comp. lang.python >?


I should add that drag and drop in the same application can be done
easily, but it's hard to do it between your application and others (too
much window manager dependencies... )
--
TZOTZIOY, I speak England very best,
Microsoft Security Alert: the Matrix began as open source.
Jul 18 '05 #3
In article <qe************ *************** *****@4ax.com>,
Christos "TZOTZIOY" Georgiou <tz**@sil-tec.gr> wrote:
Jul 18 '05 #4
Excellent. Thanks for the head start.

A couple of questions.

1) If I want to have a moving object, and not just a cursor that
represents the moving object, do I need to continually pack and unpack
the widget that holds the object and redraw it to give it the
appearance of moving? I know sometimes the redrawing can cause
applications to flicker too much, destroying the effect. I don't know
if there's an optimum way to do this.

2) Also, in reading I found an old module called Tkdnd (drag and
drop). It was an experimental module that was supposed to be updated
but never was. Now I can't find any more information on it. Does this
module still exist or work?

Thanks,
Marc
Jul 18 '05 #5

"Marc" <lo********@com cast.net> schrieb im Newsbeitrag
news:Ap******** ************@co mcast.com...
Hi all,

I was thinking about developing a drag and drop application and was curious how difficult it is to do. Basically I want to have a set of objects that I move around the screen and drop into place.

Anyone else ever done it? Got any tips?


There is a nice example here using an as well nice Tree widget:
http://www.esrf.fr/computing/bliss/g...Tree/Tree.html

Kindly
Michael
Jul 18 '05 #6
In article <43************ **************@ posting.google. com>,
Marc <mn******@airma il.net> wrote:
Jul 18 '05 #7
In article <43************ **************@ posting.google. com>,
Marc <mn******@airma il.net> wrote:
Jul 18 '05 #8

"Marc" <mn******@airma il.net> schrieb im Newsbeitrag
news:43******** *************** ***@posting.goo gle.com...
Excellent. Thanks for the head start.

A couple of questions.


I think they will be answered when you look at the link (Tree.py) I posted
yesterday ;-)

Kindly
Michael P
Jul 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1924
by: simon_s_li | last post by:
Hi, I am having problems using drag drop and re-ordering items. Example: When I drag and item from position 1 and drag it to position 3, I want to re-order all the items accordingly. This means an item in position 1 is now is position 3 and item 2 is now in postion 1 and item 3 is in position 2 and position 4 and 5 stay the same. I have searched the web.
2
4337
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put there? What about Drag/Drop; is there more than one way for the source to make data available Is it always OLE?
4
7273
by: zav | last post by:
Hi all i`m having a small problem with windows forms, i`m attempting to provide the following functionality to a form. Ability to drag and drop another form onto a form and then to dock this form... Quite a mouthful however a good example of this is within the VS.NET 6 IDE. Grab your solution explorer panel and drop it outside of the IDE, then drag/drop it back in and watch it dock.
4
2213
by: Qingdong Z. | last post by:
I have a VS.NET windows application which use drag-drop feather. It works fine when application start, but stops working after application run one or two days. The application is related to Video process, CPU/Memory extensive. The drag-drop is in a new windows form. It drags from TreeView Control to other control in the same form. It cannot trigger ItemDrag event of TreeView after drag-drop feather die. Can you give me any idea? Thanks.
1
1621
by: Kevin L | last post by:
I have a Panel control that I currently allow the user to drag and reposition on a form at runtime. This Panel control contains a Label control. I would like to allow the user to drag the PANEL by clicking on the LABEL and dragging. Is there a way to do this?
0
1781
by: Pesso | last post by:
I'm loading a text file to a RichTextBox control to drag a selection of a text and drop it into a tree view control. It works except after the drag and drop operation the RichTextBox scrolls to the top. This is very inconvenient because after the drag-drop operation the user has to scroll down to where he was before. Is there anyway to make the RichTextBox stop jumping to the top after a drag-drop from it?
1
5017
by: timnels | last post by:
I have created a muti-select treeview control. Problem is I am now trying to implement drag/drop in the application that uses it. It seems the mouse down and mouse move events fire before the OnBeforeSelect and OnAfterSelect events in the treeview. Since I want to start the drag/drop on the mouse move event, I have no clue that the current node has been selected yet. I tried moving all the code into the mouse down event (which actually...
0
1006
by: weird0 | last post by:
I have to build an application with drag-drop mechanism just as in Visual Studio 2005 where items from the toolbox can be dragged and drop. My application will contain images at the top, on the contrary. The image object should also be movable by keyboard. I know its really difficult. Can anyone give me any idea how can I build this ? What will be keyboard events to use to enable keyboard support too. Please let me know all the...
4
3655
by: Jeff | last post by:
Hello, I am trying to drag and drop a label control from one cell in a tablelayoutpanel to another (VB2005). There is no problem if both cells are visible, but i cannot get the tablelayoutpanel to scroll in any direction (autoscroll is on), when the cell i want to drag to is no currently visible and requires scrolling to get to see it. Any suggestions would be greatly appreciated.
2
3375
by: bob | last post by:
Hi all, I have a treeview that has drag drop. Works well enough but... If you drag out of bounds of the treeview the nodrop icon comes on. Fair enough. But when I move back inside the treeview the nodrop icon stays on and essentially the action is cancelled when I release the mouse. I would like to somehow 'retrieve' the drag action when the mouse moves back inside the treeview to a legitimate drop point. Any thoughts on how to do this...
0
10327
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.