本文整理汇总了Python中kiwi.ui.widgets.entry.ProxyEntry.get_property方法的典型用法代码示例。如果您正苦于以下问题:Python ProxyEntry.get_property方法的具体用法?Python ProxyEntry.get_property怎么用?Python ProxyEntry.get_property使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.ui.widgets.entry.ProxyEntry
的用法示例。
在下文中一共展示了ProxyEntry.get_property方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_attach
# 需要导入模块: from kiwi.ui.widgets.entry import ProxyEntry [as 别名]
# 或者: from kiwi.ui.widgets.entry.ProxyEntry import get_property [as 别名]
def test_attach(self):
entry = ProxyEntry()
entry.data_type = currency
self.assertEqual(entry.get_property('secondary-icon-pixbuf'), None)
calc = CalculatorPopup(entry, CalculatorPopup.MODE_SUB)
pixbuf_pixels = calc.render_icon(STOQ_CALC,
gtk.ICON_SIZE_MENU).get_pixels()
self.assertEqual(
entry.get_property('secondary-icon-pixbuf').get_pixels(), pixbuf_pixels)
entry.set_sensitive(False)
self.assertEqual(entry.get_property('secondary-icon-pixbuf'), None)
entry.set_sensitive(True)
self.assertEqual(
entry.get_property('secondary-icon-pixbuf').get_pixels(), pixbuf_pixels)
spinbutton = ProxySpinButton()
spinbutton.data_type = currency
self.assertEqual(spinbutton.get_property('secondary-icon-pixbuf'), None)
calc = CalculatorPopup(spinbutton, CalculatorPopup.MODE_SUB)
pixbuf_pixels = calc.render_icon(STOQ_CALC,
gtk.ICON_SIZE_MENU).get_pixels()
self.assertEqual(
spinbutton.get_property('secondary-icon-pixbuf').get_pixels(), pixbuf_pixels)
spinbutton.set_sensitive(False)
self.assertEqual(spinbutton.get_property('secondary-icon-pixbuf'), None)
spinbutton.set_sensitive(True)
self.assertEqual(
spinbutton.get_property('secondary-icon-pixbuf').get_pixels(), pixbuf_pixels)
示例2: testIdleAddedProperly
# 需要导入模块: from kiwi.ui.widgets.entry import ProxyEntry [as 别名]
# 或者: from kiwi.ui.widgets.entry.ProxyEntry import get_property [as 别名]
def testIdleAddedProperly(self):
entry = ProxyEntry()
entry.set_property("data-type", "int")
while Gtk.events_pending():
Gtk.main_iteration()
self.assertEqual(entry.get_property('data_type'), 'int')
entry = ProxyEntry(data_type=str)
while Gtk.events_pending():
Gtk.main_iteration()
self.assertEqual(entry.get_property('data_type'), 'str')
entry.set_property("data-type", int)
self.assertEqual(entry.get_property('data_type'), 'int')
entry = ProxyEntry(data_type=str)
self.assertEqual(entry.get_property('data_type'), 'str')
entry.set_property("data-type", int)
while Gtk.events_pending():
Gtk.main_iteration()
self.assertEqual(entry.get_property('data_type'), 'int')