flowblok / Presenter (http://flowblok.selfip.net:8001/trac/presenter)
The presentation tool for control freaks.
Clone this repository (size: 380.5 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/flowblok/presenter/
| commit 189: | 93b41d800925 |
| parent 188: | 219b4b845959 |
| branch: | default |
Made terminal semi-resizable.
Changed (Δ373 bytes):
raw changeset »
presenter/handlers/terminal_handler.py (17 lines added, 1 lines removed)
Up to file-list presenter/handlers/terminal_handler.py:
| … | … | @@ -24,14 +24,30 @@ class TerminalHandler(Handler): |
24 |
24 |
def __init__(self, *args, **kwargs): |
25 |
25 |
super(TerminalHandler, self).__init__(*args, **kwargs) |
26 |
26 |
self.terminal = tempfile.NamedTemporaryFile() |
27 |
self.size = None |
|
27 |
28 |
|
28 |
29 |
def get_editor_control(self): |
29 |
30 |
terminal = vte.Terminal() |
30 |
31 |
terminal.fork_command('script', ['script', '-f', '-q', self.terminal.name]) |
32 |
||
33 |
def resize(terminal, event): |
|
34 |
self.size = ( |
|
35 |
terminal.get_column_count(), |
|
36 |
terminal.get_row_count(), |
|
37 |
) |
|
38 |
||
39 |
terminal.connect('size-allocate', resize) |
|
31 |
40 |
return terminal |
32 |
41 |
|
33 |
42 |
def get_output_control(self): |
43 |
align = gtk.Alignment(0.5, 0.5) |
|
44 |
||
34 |
45 |
terminal = vte.Terminal() |
35 |
46 |
terminal.fork_command('tail', ['tail', '-n', '+0', '-f', self.terminal.name]) |
36 |
|
|
47 |
if self.size: |
|
48 |
terminal.set_size(*self.size) |
|
37 |
49 |
|
50 |
align.add(terminal) |
|
51 |
||
52 |
return align |
|
53 |
