Hi all, following the varoius guides, i managed to create a popup with an Entry object in it, to grap the input.
The only problem is that i'm not able to give the focus to the entry, so when the popup appear with the keyboard, the user can enter directly its input without having to tap on the Entry object first.
This is the code i used:
Evas_Object *popup, *layout; popup = elm_popup_add(parent); elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(popup, "title,text", "Use energy"); layout = elm_layout_add(popup); elm_layout_theme_set(layout, "layout", "drawer", "panel"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_content_set(popup, layout); Evas_Object *entry = elm_entry_add(layout); set_number_on_entry(entry, 0); elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBERONLY); elm_entry_input_panel_show(entry); elm_object_part_content_set(layout, "elm.swallow.content" , entry); dlog_print(DLOG_INFO, APP_TAG, elm_entry_entry_get(entry)); container->entry = entry; Evas_Object *button1; button1 = elm_button_add(popup); elm_object_text_set(button1, "OK"); elm_object_part_content_set(popup, "button1", button1); elm_object_style_set(button1, "popup"); evas_object_smart_callback_add(button1, "clicked", ok_pressed_energy, container); /* Add a "Cancel" button to popup */ button1 = elm_button_add(popup); elm_object_text_set(button1, "Cancel"); elm_object_part_content_set(popup, "button2", button1); evas_object_smart_callback_add(button1, "clicked", dismissed_cb, popup); evas_object_smart_callback_add(popup, "dismissed", dismissed_cb, NULL); container->popup = popup; evas_object_show(popup); elm_object_focus_set(entry, EINA_TRUE); elm_entry_cursor_end_set(entry);
What i'm doing wrong?
I tried also to move the elm_object_focus_set and elm_cursor_end_set before the show (i moved it after, because i read the focus has to be set after the object has shown).