| 208 | self.canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight) |
| 209 | |
| 210 | def makeTextFrame(self, root): |
| 211 | self.text_frame = text_frame = Frame(root) |
| 212 | self.text = text = Text(text_frame, name='text', padx=5, |
| 213 | wrap='none', width=45) |
| 214 | color_config(text) |
| 215 | |
| 216 | self.vbar = vbar = Scrollbar(text_frame, name='vbar') |
| 217 | vbar['command'] = text.yview |
| 218 | vbar.pack(side=RIGHT, fill=Y) |
| 219 | self.hbar = hbar = Scrollbar(text_frame, name='hbar', orient=HORIZONTAL) |
| 220 | hbar['command'] = text.xview |
| 221 | hbar.pack(side=BOTTOM, fill=X) |
| 222 | text['yscrollcommand'] = vbar.set |
| 223 | text['xscrollcommand'] = hbar.set |
| 224 | |
| 225 | text['font'] = tuple(txtfont) |
| 226 | shortcut = 'Command' if darwin else 'Control' |
| 227 | text.bind_all('<%s-minus>' % shortcut, self.decrease_size) |
| 228 | text.bind_all('<%s-underscore>' % shortcut, self.decrease_size) |
| 229 | text.bind_all('<%s-equal>' % shortcut, self.increase_size) |
| 230 | text.bind_all('<%s-plus>' % shortcut, self.increase_size) |
| 231 | text.bind('<Control-MouseWheel>', self.update_mousewheel) |
| 232 | text.bind('<Control-Button-4>', self.increase_size) |
| 233 | text.bind('<Control-Button-5>', self.decrease_size) |
| 234 | |
| 235 | text.pack(side=LEFT, fill=BOTH, expand=1) |
| 236 | return text_frame |
| 237 | |
| 238 | def makeGraphFrame(self, root): |
| 239 | # t._Screen is a singleton class instantiated or retrieved |