1
# -*- coding: utf-8 -*-
3
# Copyright (C) 2009-2010 Osmo Salomaa
5
# This file is part of Gaupol.
7
# Gaupol is free software: you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation, either version 3 of the License, or (at your option) any later
12
# Gaupol is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License along with
17
# Gaupol. If not, see <http://www.gnu.org/licenses/>.
19
"""Cell renderer for integer data."""
23
from gi.repository import GObject
24
from gi.repository import Gtk
26
__all__ = ("IntegerCellRenderer",)
29
class IntegerCellRenderer(Gtk.CellRendererText):
31
"""Cell renderer for integer data."""
33
__gtype_name__ = "IntegerCellRenderer"
36
"""Initialize a :class:`IntegerCellRenderer` object."""
37
GObject.GObject.__init__(self)
39
aeidon.util.connect(self, self, "editing-started")
41
def _on_editing_started(self, renderer, editor, path):
42
"""Set `editor` to use same font as `self`."""
43
editor.modify_font(self.props.font_desc)