Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise SystemExit("error loading %s: %s" % (THEME_FILE, e))
self._edje.size = self._evas.size
self._evas.data["login_window"] = self._edje
self._edje.on_key_down_add(self.__on_key_down)
self.password = etk.Entry()
embed = etk.Embed(self._evas.evas)
embed.add(self.password)
embed.show_all()
self.password.password_mode = True
self._edje.part_swallow("login_screen.password", embed.object)
self.status = etk.Entry()
embed = etk.Embed(self._evas.evas)
embed.add(self.status)
embed.show_all()
self._edje.part_swallow("login_screen.status", embed.object)
self.username = etk.Entry()
embed = etk.Embed(self._evas.evas)
embed.add(self.username)
embed.show_all()
self._edje.part_swallow("login_screen.username", embed.object)
if self._edje.part_exists("login_screen.signin"):
self.signin = etk.Button()
embed = etk.Embed(self._evas.evas)
embed.add(self.signin)
embed.show_all()
self._edje.part_swallow("login_screen.signin", embed.object)
# Setup callback for resize
def resize_cb(ee):
r = ee.evas.rect
ee.data["edje"].size = r.size
ecore_evas.callback_resize = resize_cb
def item_cb(e):
print "Item changed in combobox %s into item : %s" % (e, e.active_item)
return True
ecore_evas.show()
edj.show()
embed1 = etk.Embed(ecore_evas.evas)
entry1 = etk.ComboboxEntry()
embed1.add(entry1)
embed1.show_all()
embed1.pointer_method_set(set_pointer, ecore_evas)
embed1.position_method_set(get_position, ecore_evas)
entry1.item_append("First item")
entry1.item_append("2 item")
entry1.item_append("last item")
embed2 = etk.Embed(ecore_evas.evas)
entry2 = etk.Entry()
entry2.password_mode = True
embed2.add(entry2)
embed2.show_all()
ecore_evas.show()
edj.show()
embed1 = etk.Embed(ecore_evas.evas)
entry1 = etk.ComboboxEntry()
embed1.add(entry1)
embed1.show_all()
embed1.pointer_method_set(set_pointer, ecore_evas)
embed1.position_method_set(get_position, ecore_evas)
entry1.item_append("First item")
entry1.item_append("2 item")
entry1.item_append("last item")
embed2 = etk.Embed(ecore_evas.evas)
entry2 = etk.Entry()
entry2.password_mode = True
embed2.add(entry2)
embed2.show_all()
embed2.pointer_method_set(set_pointer, ecore_evas)
edj.part_swallow("entry1", embed1.object)
edj.part_swallow("entry2", embed2.object)
edj.focus = True
def text_changed(o):
print "Text changed : %s - %s" % (o, o.text)
return True
def set_pointer(user_data, pointer):
if pointer == etk.Embed.POINTER_NONE:
user_data.x_window_cursor_shape_set(0)
elif pointer == etk.Embed.POINTER_TEXT_EDIT:
user_data.x_window_cursor_shape_set(ecore.x.ECORE_X_CURSOR_XTERM)
else:
user_data.x_window_cursor_shape_set(ecore.x.ECORE_X_CURSOR_LEFT_PTR)
self.password = etk.Entry()
embed = etk.Embed(self._evas.evas)
embed.add(self.password)
embed.show_all()
self.password.password_mode = True
self._edje.part_swallow("login_screen.password", embed.object)
self.status = etk.Entry()
embed = etk.Embed(self._evas.evas)
embed.add(self.status)
embed.show_all()
self._edje.part_swallow("login_screen.status", embed.object)
self.username = etk.Entry()
embed = etk.Embed(self._evas.evas)
embed.add(self.username)
embed.show_all()
self._edje.part_swallow("login_screen.username", embed.object)
if self._edje.part_exists("login_screen.signin"):
self.signin = etk.Button()
embed = etk.Embed(self._evas.evas)
embed.add(self.signin)
embed.show_all()
self._edje.part_swallow("login_screen.signin", embed.object)
self.signin.label = "Sign in"
self.signin.connect("clicked", self.__signin_button_cb)
else:
self._edje.signal_callback_add("signin", "*", self.__signin_cb)
self._edje.focus = True