本文整理汇总了Python中kiwi.ui.proxywidget.ValidatableProxyWidgetMixin.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ValidatableProxyWidgetMixin.__init__方法的具体用法?Python ValidatableProxyWidgetMixin.__init__怎么用?Python ValidatableProxyWidgetMixin.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.ui.proxywidget.ValidatableProxyWidgetMixin
的用法示例。
在下文中一共展示了ValidatableProxyWidgetMixin.__init__方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=int):
# since the default data_type is str we need to set it to int
# or float for spinbuttons
gtk.SpinButton.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
self.props.data_type = data_type
self.set_property("xalign", 1.0)
示例2: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, **kwargs):
deprecationwarn(
'ProxyComboBoxEntry is deprecated, use ProxyComboEntry instead',
stacklevel=3)
BaseComboBoxEntry.__init__(self)
ValidatableProxyWidgetMixin.__init__(self, widget=self.entry)
# We need to create the helper before PropertyObject, since we
# need to access the helper in prop_set_list_editable, which
# PropertyObject might call
self._helper = _EasyComboBoxHelper(self)
PropertyObject.__init__(self, **kwargs)
self.set_text_column(ComboColumn.LABEL)
# here we connect the expose-event signal directly to the entry
self.child.connect('changed', self._on_child_entry__changed)
# HACK! we force a queue_draw because when the window is first
# displayed the icon is not drawn.
gobject.idle_add(self.queue_draw)
self.set_events(gtk.gdk.KEY_RELEASE_MASK)
self.connect("key-release-event", self._on__key_release_event)
示例3: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self):
entry = ProxyEntry()
ComboEntry.__init__(self, entry=entry)
ValidatableProxyWidgetMixin.__init__(self)
entry.connect('content-changed', self._on_entry__content_changed)
entry.connect('validation-changed',
self._on_entry__validation_changed)
示例4: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=int):
# since the default data_type is str we need to set it to int
# or float for spinbuttons
gtk.SpinButton.__init__(self)
PropertyObject.__init__(self, data_type=data_type)
ValidatableProxyWidgetMixin.__init__(self)
self._icon = IconEntry(self)
self.set_property('xalign', 1.0)
示例5: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=None):
self._block_changed = False
self._has_been_updated = False
KiwiEntry.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
self._data_type = data_type
# Hide currency symbol from the entry.
self.set_options_for_datatype(currency, symbol=False)
示例6: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self):
gtk.TextView.__init__(self)
self.props.data_type = str
ValidatableProxyWidgetMixin.__init__(self)
self._textbuffer = gtk.TextBuffer()
self._textbuffer.connect('changed',
self._on_textbuffer__changed)
self.set_buffer(self._textbuffer)
示例7: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self):
self._is_unset = True
gtk.TextView.__init__(self)
PropertyObject.__init__(self, data_type=str)
ValidatableProxyWidgetMixin.__init__(self)
self._textbuffer = gtk.TextBuffer()
self._textbuffer.connect('changed',
self._on_textbuffer__changed)
self.set_buffer(self._textbuffer)
示例8: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=int):
# since the default data_type is str we need to set it to int
# or float for spinbuttons
gtk.SpinButton.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
self.props.data_type = data_type
self.set_property('xalign', 1.0)
# We need to do this because spinbuttons are supposed to accept only
# numbers.
self.set_numeric(True)
示例9: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=None):
self._block_changed = False
self._has_been_updated = False
KiwiEntry.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
self._entry_data_type = data_type
# XXX: Sales -> New Loan Item requires this, figure out why
try:
self.props.data_type = data_type
except (AttributeError, TypeError):
pass
# Hide currency symbol from the entry.
self.set_options_for_datatype(currency, symbol=False)
示例10: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=None):
self._block_changed = False
self._has_been_updated = False
KiwiEntry.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
self._set_data_type(data_type)
# Hide currency symbol from the entry.
self.set_options_for_datatype(currency, symbol=False)
# This used to be an override, but after the gtk3 migration if we
# use the override or create a do_changed method GObject will break
# the object in a way that it will be considered a Gtk.SpinButton
# directly instead of a ProxySpinButton. The side effect of that
# would be that out custom events (e.g. validate) would not exist.
self.connect('changed', self._on_changed)
示例11: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self):
DateEntry.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
# Add some space to the entry, so it has rom for the icon, in case
# of a validation error.
#
# Since we set the widget's width based on the number of characters,
# get the width of a single char, so we can calculate how many
# 'chars' the icon takes.
layout = self.entry.get_layout()
context = layout.get_context()
metrics = context.get_metrics(context.get_font_description())
char_width = metrics.get_approximate_char_width() / pango.SCALE
current_width = self.entry.get_width_chars()
# We add 4 pixels to the width, because of the icon borders
icon_width = VALIDATION_ICON_WIDTH + 4
self.entry.set_width_chars(current_width + int(icon_width / char_width))
示例12: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, data_type=int):
# since the default data_type is str we need to set it to int
# or float for spinbuttons
Gtk.SpinButton.__init__(self)
ValidatableProxyWidgetMixin.__init__(self)
self.props.data_type = data_type
self.set_property('xalign', 1.0)
self.set_property("truncate-multiline", True)
# We need to do this because spinbuttons are supposed to accept only
# numbers.
self.set_numeric(True)
# This used to be an override, but after the gtk3 migration if we
# use the override or create a do_changed method GObject will break
# the object in a way that it will be considered a Gtk.SpinButton
# directly instead of a ProxySpinButton. The side effect of that
# would be that out custom events (e.g. validate) would not exist.
self.connect('changed', self._on_changed)
示例13: __init__
# 需要导入模块: from kiwi.ui.proxywidget import ValidatableProxyWidgetMixin [as 别名]
# 或者: from kiwi.ui.proxywidget.ValidatableProxyWidgetMixin import __init__ [as 别名]
def __init__(self, **kwargs):
deprecationwarn(
'ProxyComboBoxEntry is deprecated, use ProxyComboEntry instead',
stacklevel=3)
BaseComboBoxEntry.__init__(self)
ValidatableProxyWidgetMixin.__init__(self, widget=self.entry)
self._helper = _EasyComboBoxHelper(self)
for key, value in kwargs.items():
setattr(self.props, key, value)
self.set_text_column(ComboColumn.LABEL)
# here we connect the expose-event signal directly to the entry
self.child.connect('changed', self._on_child_entry__changed)
# HACK! we force a queue_draw because when the window is first
# displayed the icon is not drawn.
gobject.idle_add(self.queue_draw)
self.set_events(gtk.gdk.KEY_RELEASE_MASK)
self.connect("key-release-event", self._on__key_release_event)