| 377 | return "break" |
| 378 | |
| 379 | def set_status_bar(self): |
| 380 | self.status_bar = self.MultiStatusBar(self.top) |
| 381 | sep = Frame(self.top, height=1, borderwidth=1, background='grey75') |
| 382 | if sys.platform == "darwin": |
| 383 | # Insert some padding to avoid obscuring some of the statusbar |
| 384 | # by the resize widget. |
| 385 | self.status_bar.set_label('_padding1', ' ', side=RIGHT) |
| 386 | self.status_bar.set_label('column', 'Col: ?', side=RIGHT) |
| 387 | self.status_bar.set_label('line', 'Ln: ?', side=RIGHT) |
| 388 | self.status_bar.pack(side=BOTTOM, fill=X) |
| 389 | sep.pack(side=BOTTOM, fill=X) |
| 390 | self.text.bind("<<set-line-and-column>>", self.set_line_and_column) |
| 391 | self.text.event_add("<<set-line-and-column>>", |
| 392 | "<KeyRelease>", "<ButtonRelease>") |
| 393 | self.text.after_idle(self.set_line_and_column) |
| 394 | |
| 395 | def set_line_and_column(self, event=None): |
| 396 | line, column = self.text.index(INSERT).split('.') |