Chaos Leagues Index du Forum
 
 
 
Chaos Leagues Index du ForumFAQRechercherS’enregistrerConnexion

A differen “Drag and Drop” images in Tkinter (Python 3.x)

 
Poster un nouveau sujet   Répondre au sujet    Chaos Leagues Index du Forum -> Un Peu de Tout -> Espace vidéo,images et pub !
Sujet précédent :: Sujet suivant  
Auteur Message
joeclark


Hors ligne

Inscrit le: 20 Juin 2017
Messages: 283
Localisation: usa
Masculin
Points Wifi MKWii (bataille) : :: 0
Experiences: 283
Moyenne de points: 1,00

MessagePosté le: Lun 9 Oct - 15:07 (2017)    Sujet du message: A differen “Drag and Drop” images in Tkinter (Python 3.x) Répondre en citant

I'm trying to make it possible for my program's user to drag an image from a widget and drop it in another without removing the image from its first position.


I thought on using a TopLevel for this. Upon a click+drag event, a TopLevel, containing the same image, would pop up right above the clicked image on the event.x and event.y position. Then it would change its position along with the mouse and only upon ButtonRelease-1 the TopLevel would be destroyed.


If the Button Release event was triggered on the master x and y coordinates corresponding to where is my other widget (in the case, a canvas), then it would trigger a canvas.create_image() using the event.x and event.y.


The problems I'm facing are:


Only 1 TopLevel should appear at once, but I had no success limiting it. Several windows overlap as I click and drag the mouse.
I can't make Toplevel.geometry use the bound event's x and y positions.
How to make the Toplevel display the same image as the user clicked, without magic numbers and variables?


I didn't find the right solution from the internet.
References:


Hand Drawn animation video







Revenir en haut
Publicité






MessagePosté le: Lun 9 Oct - 15:07 (2017)    Sujet du message: Publicité

PublicitéSupprimer les publicités ?
Revenir en haut
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    Chaos Leagues Index du Forum -> Un Peu de Tout -> Espace vidéo,images et pub ! Toutes les heures sont au format GMT + 2 Heures
Page 1 sur 1

 
Sauter vers:  

Portail | Index | Creer un forum | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
Template lost-kingdom_Tolede created by larme d'ange
Powered by phpBB © 2001, 2005 phpBB Group
Traduction par : phpBB-fr.com