Workaround the visibility name in a simpler way

This commit is contained in:
Davide Andreoli 2015-01-24 20:12:50 +01:00
parent 6422f5a149
commit 31320ca2e8
1 changed files with 11 additions and 13 deletions

View File

@ -135,12 +135,10 @@ def _widget_generate(self, name, parent_name=None):
if 'Properties' in w_data:
for eo_name, p_vals in w_data['Properties'].items():
p_name = eo_name.split('.')[-1]
if p_name == 'visibility': # TODO implement this property in Evas.Object
if p_vals[0] is True:
w.show()
elif p_name == 'constructor':
pass
else:
if p_name == 'visibility': # TODO remove this hack when Eo will be fixed
p_name = 'visible'
if p_name != 'constructor':
self._print('property %s => %s' % (p_name, p_vals))
p_vals = _params_list_parse(mod, p_vals)
if p_name == 'file':
@ -231,13 +229,13 @@ def _param_parse(mod, p_value):
def _property_modify_cb(obj, self, widget_name, prop_name, values):
w = self._widgets[widget_name]
if prop_name == 'visibility': # TODO implement this property in Evas.Object
w.show() if values[0] is True else w.hide()
else:
if prop_name == 'file':
values = _resource_find(self, values)
values = (values[0]) # ARGHHHHHHHHHHH TODO FIX THE FILE PROP
setattr(w, prop_name, values[0] if len(values) == 1 else values)
if prop_name == 'visibility': # TODO remove this hack when Eo will be fixed
prop_name = 'visible'
if prop_name == 'file':
values = _resource_find(self, values)
values = (values[0]) # ARGHHHHHHHHHHH TODO FIX THE FILE PROP
setattr(w, prop_name, values[0] if len(values) == 1 else values)
def _widget_create_cb(obj, self, widget_name, parent_name):