| 108 | |
| 109 | class DirSelectBox(ttk.Frame): |
| 110 | def __init__(self, master=None, **kw): |
| 111 | ttk.Frame.__init__(self, master, **kw) |
| 112 | self.dir_var = StringVar() |
| 113 | self.entry = ttk.Entry(self, textvariable = self.dir_var) |
| 114 | self.entry.pack(fill=BOTH, expand=1,side=LEFT) |
| 115 | self.entry.configure(width = 50) |
| 116 | |
| 117 | self.browser_button = ttk.Button(self, text="Browser", command=self.browser) |
| 118 | self.browser_button.pack(side=RIGHT) |
| 119 | |
| 120 | def browser(self): |
| 121 | dir = tkFileDialog.askdirectory(parent=self, title='Open directory', initialdir=self.dir_var.get()) |