Languages

Menu
Sites
Language
WebView on Dialog window.

I want to open a webview on dialog box.

View Selected Answer

Responses

14 Replies
Mark as answer
pius lee

Just attach webview to popup!

#include <EWebKit.h>

static void btn_click_cb(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *popup = data;
	Evas_Object *webview = elm_object_content_get(popup);
	ewk_view_url_set(webview, "http://google.com");
	evas_object_show(popup);
}

Evas_Object *btn = elm_button_add(ad->conform);
elm_object_text_set(btn, "webview popup");
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(ad->conform, btn);
evas_object_show(btn);

Evas_Object *popup = elm_popup_add(ad->win);
Evas_Object *webview = ewk_view_add(evas_object_evas_get(popup));
evas_object_size_hint_min_set(webview, 100, 400);
elm_object_content_set(popup, webview);
evas_object_show(webview);

evas_object_smart_callback_add(btn, "clicked", btn_click_cb, popup);

 

rohit sijwali

Hi everything working fine. i want to destroy the win object how can i do that.

 

pius lee

You mean win object from elm_win_add or popup from elm_popup_add ?

Anyway just call evas_object_del(obj);

 

rohit sijwali

I need to delete window  but when i call evas_object_del() with win as argument the window is still apperring.I need the solution for-

1) To delete-To delete the window so that it will not show.

                                        OR

2)Hide window-so that it will not appear.                 

pius lee

You can hide window with elm_win_lower().

If you just want finish your application, just call ui_app_exit().

rohit sijwali

I tried elm_win_lower(). but its not working. Basically i have a window in which i have button.On the button click event i created new window in which i have webview. So in case of back button i want to either hide web view or delete it, so that my winow with button apperars.

pius lee

Ok, Actually, Evas_Object from elm_popup_add is not real window.

If you want remove or hide "popup", just call evas_object_hide(popup) or evas_object_del(popup);

 

rohit sijwali

Ok evas_object_hide(popup) and evas_object_hide(win) working.But evas_object_del(popup) not working.Anyway my problem is solved.

Alex Dem

Hi,
Strange. In UI Controls example evas_object_del(popup) works without any issues.
Alexey.

rohit sijwali

Can you suggest a site where i can find out the basics of ELF library.

colin Rao

Possible this link is useful for you. https://www.enlightenment.org/docs

rohit sijwali

is it necessary to add network.get privileage to use libcurl.

rohit sijwali

Hi i have made a shared library to open webview. I used it it is working fine.I have set

elm_win_wm_rotation_preferred_rotation_set( ad->popup_win,90);

How can i make it change the rotation according to application rotation.