I wish to manually move widgets in Tkinter, now I have successfully done it,
but with odd results, I would like to move the widgets with a much smoother
manner, and better precision.
Any help is greatly appreciated.
--
here is snip of working code:
from Tkinter import *
class blah:
def MoveWindow(self , event):
self.root.updat e_idletasks()
self.f.place_co nfigure(x=event .x_root, y=event.y_root-20)
def __init__(self):
self.root = Tk()
self.root.title ("...")
self.root.resiz able(0,0)
self.root.geome try("%dx%d%+d%+ d"%(640, 480, 0, 0))
self.f = Frame(self.root , bd=1, relief=SUNKEN)
self.f.place(x= 0, y=0, width=200, height=200)
self.l = Label(self.f, bd=1, relief=RAISED, text="Test")
self.l.pack(fil l=X, padx=1, pady=1)
self.l.bind('<B 1-Motion>', self.MoveWindow )
self.f.bind('<B 1-Motion>', self.MoveWindow )
self.root.mainl oop()
x = blah()
but with odd results, I would like to move the widgets with a much smoother
manner, and better precision.
Any help is greatly appreciated.
--
here is snip of working code:
from Tkinter import *
class blah:
def MoveWindow(self , event):
self.root.updat e_idletasks()
self.f.place_co nfigure(x=event .x_root, y=event.y_root-20)
def __init__(self):
self.root = Tk()
self.root.title ("...")
self.root.resiz able(0,0)
self.root.geome try("%dx%d%+d%+ d"%(640, 480, 0, 0))
self.f = Frame(self.root , bd=1, relief=SUNKEN)
self.f.place(x= 0, y=0, width=200, height=200)
self.l = Label(self.f, bd=1, relief=RAISED, text="Test")
self.l.pack(fil l=X, padx=1, pady=1)
self.l.bind('<B 1-Motion>', self.MoveWindow )
self.f.bind('<B 1-Motion>', self.MoveWindow )
self.root.mainl oop()
x = blah()
Comment