searchable.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:bokken 作者: thestr4ng3r 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号