File: cellrenderertext.py

package info (click to toggle)
tryton-client 7.0.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,476 kB
  • sloc: python: 27,180; sh: 37; makefile: 18
file content (28 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This file is part of Tryton.  The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from gi.repository import GObject, Gtk


class CellRendererText(Gtk.CellRendererText):

    def __init__(self):
        super(CellRendererText, self).__init__()
        self.connect('editing-started', self.__class__.on_editing_started)

    def on_editing_started(self, editable, path):
        pass


class CellRendererTextCompletion(CellRendererText):

    def __init__(self, set_completion):
        super(CellRendererTextCompletion, self).__init__()
        self.set_completion = set_completion

    def on_editing_started(self, editable, path):
        super().on_editing_started(editable, path)
        self.set_completion(editable, path)


GObject.type_register(CellRendererText)
GObject.type_register(CellRendererTextCompletion)