def __init__(self, textview, small=False):
self.textview = textview
self.small = small
# By default, don't match case
self._matchCaseValue = False
# key definitions
self.key_f = Gdk.keyval_from_name("f")
self.key_g = Gdk.keyval_from_name("g")
self.key_G = Gdk.keyval_from_name("G")
self.key_F3 = Gdk.keyval_from_name("F3")
self.key_Esc = Gdk.keyval_from_name("Escape")
# signals
self.connect("key-press-event", self._key)
self.textview.connect("populate-popup", self._populate_popup)
# colors for textview and entry backgrounds
self.textbuf = self.textview.get_buffer()
self.textbuf.create_tag("yellow-background", background="yellow")
#MEOW
#colormap = self.get_colormap()
#self.bg_normal = colormap.alloc_color("white")
#self.bg_notfnd = colormap.alloc_color("red")
parse, self.bg_normal = Gdk.Color.parse('white')
parse, self.bg_notfnd = Gdk.Color.parse('red')
# build the search tab
self._build_search(None)
self.searching = True
self.timer_id = None
评论列表
文章目录