Back to index

python3.2  3.2.2
Classes | Functions | Variables
idlelib.TreeWidget Namespace Reference

Classes

class  TreeNode
class  TreeItem
class  FileTreeItem
class  ScrolledCanvas

Functions

def listicons
def test
def test2

Variables

string ICONDIR = "Icons"
tuple _icondir = os.path.join(os.path.dirname(__file__), ICONDIR)

Function Documentation

def idlelib.TreeWidget.listicons (   icondir = ICONDIR)
Utility to display the available icons.

Definition at line 36 of file TreeWidget.py.

00036 
00037 def listicons(icondir=ICONDIR):
00038     """Utility to display the available icons."""
00039     root = Tk()
00040     import glob
00041     list = glob.glob(os.path.join(icondir, "*.gif"))
00042     list.sort()
00043     images = []
00044     row = column = 0
00045     for file in list:
00046         name = os.path.splitext(os.path.basename(file))[0]
00047         image = PhotoImage(file=file, master=root)
00048         images.append(image)
00049         label = Label(root, image=image, bd=1, relief="raised")
00050         label.grid(row=row, column=column)
00051         label = Label(root, text=name)
00052         label.grid(row=row+1, column=column)
00053         column = column + 1
00054         if column >= 10:
00055             row = row+2
00056             column = 0
00057     root.images = images
00058 

Here is the call graph for this function:

Definition at line 454 of file TreeWidget.py.

00454 
00455 def test():
00456     from idlelib import PyShell
00457     root = Toplevel(PyShell.root)
00458     root.configure(bd=0, bg="yellow")
00459     root.focus_set()
00460     sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
00461     sc.frame.pack(expand=1, fill="both")
00462     item = FileTreeItem("C:/windows/desktop")
00463     node = TreeNode(sc.canvas, None, item)
00464     node.expand()

Definition at line 465 of file TreeWidget.py.

00465 
00466 def test2():
00467     # test w/o scrolling canvas
00468     root = Tk()
00469     root.configure(bd=0)
00470     canvas = Canvas(root, bg="white", highlightthickness=0)
00471     canvas.pack(expand=1, fill="both")
00472     item = FileTreeItem(os.curdir)
00473     node = TreeNode(canvas, None, item)
00474     node.update()
00475     canvas.focus_set()

Here is the caller graph for this function:


Variable Documentation

idlelib.TreeWidget._icondir = os.path.join(os.path.dirname(__file__), ICONDIR)

Definition at line 28 of file TreeWidget.py.

Definition at line 24 of file TreeWidget.py.