Initialize settings for context block. editwin is the Editor window for the context block. self.text is the editor window text widget. self.context displays the code context text above the editor text. Initially None, it is toggled via < >.
(self, editwin)
| 47 | UPDATEINTERVAL = 100 # millisec |
| 48 | |
| 49 | def __init__(self, editwin): |
| 50 | """Initialize settings for context block. |
| 51 | |
| 52 | editwin is the Editor window for the context block. |
| 53 | self.text is the editor window text widget. |
| 54 | |
| 55 | self.context displays the code context text above the editor text. |
| 56 | Initially None, it is toggled via <<toggle-code-context>>. |
| 57 | self.topvisible is the number of the top text line displayed. |
| 58 | self.info is a list of (line number, indent level, line text, |
| 59 | block keyword) tuples for the block structure above topvisible. |
| 60 | self.info[0] is initialized with a 'dummy' line which |
| 61 | starts the toplevel 'block' of the module. |
| 62 | |
| 63 | self.t1 and self.t2 are two timer events on the editor text widget to |
| 64 | monitor for changes to the context text or editor font. |
| 65 | """ |
| 66 | self.editwin = editwin |
| 67 | self.text = editwin.text |
| 68 | self._reset() |
| 69 | |
| 70 | def _reset(self): |
| 71 | self.context = None |