Add functions for emitting events

This commit is contained in:
Chris Jones 2009-11-20 00:18:21 -06:00
parent a51454e9f6
commit 39098fdefb
2 changed files with 15 additions and 0 deletions

View File

@ -143,6 +143,20 @@ class Terminator(Borg):
for group in todestroy: for group in todestroy:
self.groups.remove(group) self.groups.remove(group)
def group_emit(self, terminal, group, type, event):
"""Emit to each terminal in a group"""
dbg('Terminator::group_emit: emitting a keystroke for group %s' %
group)
for term in self.terminals:
if term != terminal and term.group == group:
term.vte.emit(type, event)
def all_emit(self, terminal, type, event):
"""Emit to all terminals"""
for term in self.terminals:
if term != terminal:
term.vte.emit(type, event)
def do_enumerate(self, widget, pad): def do_enumerate(self, widget, pad):
"""Insert the number of each terminal in a group, into that terminal""" """Insert the number of each terminal in a group, into that terminal"""
if pad: if pad:

View File

@ -394,6 +394,7 @@ class Terminal(gtk.VBox):
if self.group == name: if self.group == name:
# already in this group, no action needed # already in this group, no action needed
return return
dbg('Terminal::set_group: Setting group to %s' % name)
self.group = name self.group = name
self.titlebar.set_group_label(name) self.titlebar.set_group_label(name)
self.terminator.group_hoover() self.terminator.group_hoover()