Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
idlelib.ToolTip.ToolTipBase Class Reference
Inheritance diagram for idlelib.ToolTip.ToolTipBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def enter
def leave
def schedule
def unschedule
def showtip
def showcontents
def hidetip

Public Attributes

 button
 tipwindow
 id
 x
 y

Private Attributes

 _id1
 _id2
 _id3

Detailed Description

Definition at line 8 of file ToolTip.py.


Constructor & Destructor Documentation

def idlelib.ToolTip.ToolTipBase.__init__ (   self,
  button 
)

Definition at line 10 of file ToolTip.py.

00010 
00011     def __init__(self, button):
00012         self.button = button
00013         self.tipwindow = None
00014         self.id = None
00015         self.x = self.y = 0
00016         self._id1 = self.button.bind("<Enter>", self.enter)
00017         self._id2 = self.button.bind("<Leave>", self.leave)
00018         self._id3 = self.button.bind("<ButtonPress>", self.leave)

Here is the caller graph for this function:


Member Function Documentation

def idlelib.ToolTip.ToolTipBase.enter (   self,
  event = None 
)

Definition at line 19 of file ToolTip.py.

00019 
00020     def enter(self, event=None):
00021         self.schedule()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 56 of file ToolTip.py.

00056 
00057     def hidetip(self):
00058         tw = self.tipwindow
00059         self.tipwindow = None
00060         if tw:
00061             tw.destroy()

Here is the caller graph for this function:

def idlelib.ToolTip.ToolTipBase.leave (   self,
  event = None 
)

Definition at line 22 of file ToolTip.py.

00022 
00023     def leave(self, event=None):
00024         self.unschedule()
00025         self.hidetip()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 26 of file ToolTip.py.

00026 
00027     def schedule(self):
00028         self.unschedule()
00029         self.id = self.button.after(1500, self.showtip)

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.ToolTip.ToolTipBase.showcontents (   self,
  text = "Your text here" 
)

Definition at line 50 of file ToolTip.py.

00050 
00051     def showcontents(self, text="Your text here"):
00052         # Override this in derived class
00053         label = Label(self.tipwindow, text=text, justify=LEFT,
00054                       background="#ffffe0", relief=SOLID, borderwidth=1)
00055         label.pack()

Here is the caller graph for this function:

Definition at line 36 of file ToolTip.py.

00036 
00037     def showtip(self):
00038         if self.tipwindow:
00039             return
00040         # The tip window must be completely outside the button;
00041         # otherwise when the mouse enters the tip window we get
00042         # a leave event and it disappears, and then we get an enter
00043         # event and it reappears, and so on forever :-(
00044         x = self.button.winfo_rootx() + 20
00045         y = self.button.winfo_rooty() + self.button.winfo_height() + 1
00046         self.tipwindow = tw = Toplevel(self.button)
00047         tw.wm_overrideredirect(1)
00048         tw.wm_geometry("+%d+%d" % (x, y))
00049         self.showcontents()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 30 of file ToolTip.py.

00030 
00031     def unschedule(self):
00032         id = self.id
00033         self.id = None
00034         if id:
00035             self.button.after_cancel(id)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 15 of file ToolTip.py.

Definition at line 16 of file ToolTip.py.

Definition at line 17 of file ToolTip.py.

Definition at line 11 of file ToolTip.py.

Definition at line 13 of file ToolTip.py.

Definition at line 12 of file ToolTip.py.

Definition at line 14 of file ToolTip.py.

Definition at line 14 of file ToolTip.py.


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