Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
tkinter.dnd.Tester Class Reference

List of all members.

Public Member Functions

def __init__
def dnd_accept
def dnd_enter
def dnd_motion
def dnd_leave
def dnd_commit

Public Attributes

 top
 canvas
 dndid

Detailed Description

Definition at line 268 of file dnd.py.


Constructor & Destructor Documentation

def tkinter.dnd.Tester.__init__ (   self,
  root 
)

Definition at line 270 of file dnd.py.

00270 
00271     def __init__(self, root):
00272         self.top = tkinter.Toplevel(root)
00273         self.canvas = tkinter.Canvas(self.top, width=100, height=100)
00274         self.canvas.pack(fill="both", expand=1)
00275         self.canvas.dnd_accept = self.dnd_accept

Here is the caller graph for this function:


Member Function Documentation

def tkinter.dnd.Tester.dnd_accept (   self,
  source,
  event 
)

Definition at line 276 of file dnd.py.

00276 
00277     def dnd_accept(self, source, event):
00278         return self

def tkinter.dnd.Tester.dnd_commit (   self,
  source,
  event 
)

Definition at line 297 of file dnd.py.

00297 
00298     def dnd_commit(self, source, event):
00299         self.dnd_leave(source, event)
00300         x, y = source.where(self.canvas, event)
00301         source.attach(self.canvas, x, y)

Here is the call graph for this function:

def tkinter.dnd.Tester.dnd_enter (   self,
  source,
  event 
)

Definition at line 279 of file dnd.py.

00279 
00280     def dnd_enter(self, source, event):
00281         self.canvas.focus_set() # Show highlight border
00282         x, y = source.where(self.canvas, event)
00283         x1, y1, x2, y2 = source.canvas.bbox(source.id)
00284         dx, dy = x2-x1, y2-y1
00285         self.dndid = self.canvas.create_rectangle(x, y, x+dx, y+dy)
00286         self.dnd_motion(source, event)

def tkinter.dnd.Tester.dnd_leave (   self,
  source,
  event 
)

Definition at line 292 of file dnd.py.

00292 
00293     def dnd_leave(self, source, event):
00294         self.top.focus_set() # Hide highlight border
00295         self.canvas.delete(self.dndid)
00296         self.dndid = None

Here is the caller graph for this function:

def tkinter.dnd.Tester.dnd_motion (   self,
  source,
  event 
)

Definition at line 287 of file dnd.py.

00287 
00288     def dnd_motion(self, source, event):
00289         x, y = source.where(self.canvas, event)
00290         x1, y1, x2, y2 = self.canvas.bbox(self.dndid)
00291         self.canvas.move(self.dndid, x-x1, y-y1)


Member Data Documentation

Definition at line 272 of file dnd.py.

Definition at line 284 of file dnd.py.

Definition at line 271 of file dnd.py.


The documentation for this class was generated from the following file: