tk_ui.py 文件源码

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

项目:pytknvim 作者: timeyyy 项目源码 文件源码
def _nvimtk_config(self, *args):
        '''required config'''
        # Hide tkinter cursor
        self.config(insertontime=0)

        # Remove Default Bindings and what happens on insert etc
        bindtags = list(self.bindtags())
        bindtags.remove("Text")
        self.bindtags(tuple(bindtags))

        self.bind('<Key>', self.nvim_handler.tk_key_pressed)

        self.bind('<Button-1>', lambda e: self.focus_set())

        # The negative number makes it pixels instead of point sizes
        size = self.make_font_size(13)
        self._fnormal = tkfont.Font(family='Monospace', size=size)
        self._fbold = tkfont.Font(family='Monospace', weight='bold', size=size)
        self._fitalic = tkfont.Font(family='Monospace', slant='italic', size=size)
        self._fbolditalic = tkfont.Font(family='Monospace', weight='bold',
                                 slant='italic', size=size)
        self.config(font=self._fnormal, wrap=tk.NONE)

        self.nvim_handler._colsize = self._fnormal.measure('M')
        self.nvim_handler._rowsize = self._fnormal.metrics('linespace')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号