コード例 #1
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *statusbar = NULL, *button = NULL, *hbox = NULL;

        statusbar = ewl_statusbar_new();
        ewl_container_child_append(EWL_CONTAINER(box), statusbar);
        ewl_statusbar_left_hide(EWL_STATUSBAR(statusbar));
        ewl_widget_show(statusbar);

        button_push_cb(NULL, NULL, statusbar);

        hbox = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox);
        ewl_widget_show(hbox);

        button = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(button), "push");
        ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_push_cb,
                                                                statusbar);
        ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(hbox), button);
        ewl_widget_show(button);

        button = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(button), "pop");
        ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_pop_cb,
                                                                statusbar);
        ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(hbox), button);
        ewl_widget_show(button);

        return 1;
}
コード例 #2
0
ファイル: project.c プロジェクト: playya/Enlightenment
/**
 * spawn a dialog to alter the settings on a particular file
 */
static void
project_file_settings( char *name )
{
	Ewl_Widget *hbox, *vbox;
	Ewl_Widget *label, *entry, *button;

	if( settings_win )
		return;

	settings_win = ewl_dialog_new(EWL_POSITION_BOTTOM);
	if( !settings_win )
		return;

	hbox = ewl_hbox_new();
	ewl_dialog_widget_add(EWL_DIALOG(settings_win), hbox);
	
	vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(hbox), vbox);

	label = ewl_text_new("Object Name");
	ewl_container_child_append(EWL_CONTAINER(vbox), label);
	ewl_widget_show(label);

	label = ewl_text_new("File Name");
	ewl_container_child_append(EWL_CONTAINER(vbox), label);
	ewl_widget_show(label);

	ewl_widget_show(vbox);

	vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(hbox), vbox);

	entry = ewl_entry_new(name);
	ewl_container_child_append(EWL_CONTAINER(vbox), entry);
	ewl_widget_show(entry);
	file_settings.name_entry = entry;

	entry = ewl_entry_new(project_file_get(name));
	ewl_container_child_append(EWL_CONTAINER(vbox), entry);
	ewl_widget_show(entry);
	file_settings.path_entry = entry;

	ewl_widget_show(vbox);
	ewl_widget_show(hbox);

	button = ewl_dialog_button_add(EWL_DIALOG(settings_win),
																 EWL_STOCK_SAVE, EWL_RESPONSE_SAVE);
	ewl_callback_append(button, EWL_CALLBACK_VALUE_CHANGED,
											project_file_settings_cb, name);
	ewl_widget_show(button);

	button = ewl_dialog_button_add(EWL_DIALOG(settings_win),
																 EWL_STOCK_CANCEL, EWL_RESPONSE_CANCEL);
	ewl_callback_append(button, EWL_CALLBACK_VALUE_CHANGED,
											project_file_settings_cb, name);
	ewl_widget_show(button);

	ewl_widget_show(settings_win);
}
コード例 #3
0
ファイル: ewl_notebook.c プロジェクト: playya/Enlightenment
/**
 * @param n: The Ewl_Notebook widget to initialize
 * @return Returns TRUE on success or NULL on failure.
 * @brief Initialize a notebook to default values and callbacks
 */
int
ewl_notebook_init(Ewl_Notebook *n)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, FALSE);

        if (!ewl_box_init(EWL_BOX(n)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_box_orientation_set(EWL_BOX(n), EWL_ORIENTATION_VERTICAL);

        ewl_widget_appearance_set(EWL_WIDGET(n), EWL_NOTEBOOK_TYPE);
        ewl_widget_inherit(EWL_WIDGET(n), EWL_NOTEBOOK_TYPE);

        n->tabbar_position = EWL_POSITION_TOP;

        n->body.tabbar = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(n), n->body.tabbar);
        ewl_object_fill_policy_set(EWL_OBJECT(n->body.tabbar),
                                EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(n->body.tabbar),
                                                EWL_FLAG_ALIGN_CENTER);
        ewl_widget_internal_set(n->body.tabbar, TRUE);
        ewl_widget_appearance_set(n->body.tabbar, "top/tabbar");
        ewl_widget_show(n->body.tabbar);

        n->body.pages = ewl_vbox_new();
        ewl_object_fill_policy_set(EWL_OBJECT(n->body.pages),
                                   EWL_FLAG_FILL_ALL);
        ewl_container_child_append(EWL_CONTAINER(n), n->body.pages);
        ewl_widget_internal_set(n->body.pages, TRUE);
        ewl_widget_layer_priority_set(n->body.pages, -1);
        ewl_widget_appearance_set(n->body.pages, "pages");
        ewl_widget_show(n->body.pages);

        ewl_container_redirect_set(EWL_CONTAINER(n),
                                        EWL_CONTAINER(n->body.pages));

        ewl_container_show_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_show);
        ewl_container_hide_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_hide);
        ewl_container_add_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_add);
        ewl_container_remove_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_remove);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
コード例 #4
0
ファイル: ewl_notebook.c プロジェクト: playya/Enlightenment
/**
 * @param n: The Ewl_Notebook to set the tab into
 * @param page: The page to associate the tab with
 * @param tab: The contents of the tab
 * @return Returns no value.
 * @brief Set the widget to use as the tab for the page @p page to widget @p tab
 */
void
ewl_notebook_page_tab_widget_set(Ewl_Notebook *n, Ewl_Widget *page,
                                                        Ewl_Widget *tab)
{
        Ewl_Widget *t;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(n);
        DCHECK_PARAM_PTR(page);
        DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE);
        DCHECK_TYPE(page, EWL_WIDGET_TYPE);

        if (!tab)
        {
                tab = ewl_label_new();
                ewl_widget_show(tab);
        }

        t = ewl_attach_widget_association_get(page);
        if (!t)
        {
                int idx = 0;

                t = ewl_hbox_new();
                ewl_widget_appearance_set(t, "tab");
                ewl_attach_widget_association_set(page, t);
                ewl_attach_widget_association_set(t, page);
                ewl_widget_show(t);

                ewl_callback_append(t, EWL_CALLBACK_CLICKED,
                                        ewl_notebook_cb_tab_clicked, n);

                idx = ewl_container_child_index_get(EWL_CONTAINER(n), page);
		ewl_container_child_insert(EWL_CONTAINER(n->body.tabbar), t,
                                idx);
        }
        else
                ewl_container_reset(EWL_CONTAINER(t));

        /* if this is the current page set it's tab to selected */
        if (n->cur_page == page)
                ewl_widget_state_add(t, EWL_STATE_SELECTED);

        ewl_container_child_append(EWL_CONTAINER(t), tab);

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
コード例 #5
0
ファイル: eke_gui_ewl.c プロジェクト: playya/Enlightenment
void
eke_gui_ewl_create(Eke *eke)
{
    Ewl_Widget *box, *body;

    eke->gui.ewl.win = ewl_window_new();
    ewl_window_title_set(EWL_WINDOW(eke->gui.ewl.win), PACKAGE);
    ewl_window_class_set(EWL_WINDOW(eke->gui.ewl.win), PACKAGE);
    ewl_window_name_set(EWL_WINDOW(eke->gui.ewl.win), PACKAGE);
    ewl_object_size_request(EWL_OBJECT(eke->gui.ewl.win), EKE_GUI_WIDTH, EKE_GUI_HEIGHT);
    ewl_callback_append(eke->gui.ewl.win, EWL_CALLBACK_DELETE_WINDOW,
                                                    eke_gui_ewl_exit_cb, NULL);
    ewl_widget_show(eke->gui.ewl.win);

    box = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(eke->gui.ewl.win), box);
    ewl_widget_show(box);

    eke->gui.ewl.menubar = ewl_hmenubar_new();
    ewl_container_child_append(EWL_CONTAINER(box), eke->gui.ewl.menubar);
    ewl_widget_show(eke->gui.ewl.menubar);

    eke_gui_ewl_menu_setup(eke);

    body = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(box), body);
    ewl_widget_show(body);

    eke->gui.ewl.notebook = ewl_notebook_new();
    ewl_container_child_append(EWL_CONTAINER(body), eke->gui.ewl.notebook);
    ewl_notebook_tabs_position_set(EWL_NOTEBOOK(eke->gui.ewl.notebook),
                                                        EWL_POSITION_LEFT);
    ewl_notebook_tabs_alignment_set(EWL_NOTEBOOK(eke->gui.ewl.notebook),
                                                        EWL_FLAG_ALIGN_TOP);
    ewl_widget_show(eke->gui.ewl.notebook);

    eke->gui.ewl.statusbar = ewl_statusbar_new();
    ewl_container_child_append(EWL_CONTAINER(box), eke->gui.ewl.statusbar);
    ewl_widget_show(eke->gui.ewl.statusbar);
}
コード例 #6
0
static int
create_test(Ewl_Container *box)
{
        int i;
        const Freebox_Test fbtests[] = {
                {
                        "Manual Placement",
                        EWL_FREEBOX_LAYOUT_MANUAL,
                        NULL
                       },
                {
                        "Auto Placement",
                        EWL_FREEBOX_LAYOUT_AUTO,
                        NULL
                },
                {
                        "Comparator Placement (by name)",
                        EWL_FREEBOX_LAYOUT_COMPARATOR,
                        ewl_freebox_cb_compare
                },
                { NULL, EWL_FREEBOX_LAYOUT_AUTO, NULL }
        };

        srand(time(NULL));

        ewl_object_fill_policy_set(EWL_OBJECT(box), EWL_FLAG_FILL_ALL);

        for (i = 0; fbtests[i].name != NULL; i++) {
                Ewl_Widget *border, *hbox, *fb, *pane, *o;

                border  = ewl_border_new();
                ewl_border_label_set(EWL_BORDER(border),
                                (char *)fbtests[i].name);
                ewl_object_fill_policy_set(EWL_OBJECT(border), EWL_FLAG_FILL_FILL);
                ewl_container_child_append(EWL_CONTAINER(box), border);
                ewl_widget_show(border);

                /* nest the freebox in a scrollpane */
                pane = ewl_scrollpane_new();
                ewl_container_child_append(EWL_CONTAINER(border), pane);
                ewl_widget_show(pane);

                /* create a freebox of the type for this test */
                fb = ewl_freebox_new();
                ewl_freebox_layout_type_set(EWL_FREEBOX(fb), fbtests[i].type);
                if (fbtests[i].compare) {
                        ewl_freebox_comparator_set(EWL_FREEBOX(fb),
                                        fbtests[i].compare);
                        sort_fb = fb;
                }
                ewl_container_child_append(EWL_CONTAINER(pane), fb);
                ewl_widget_show(fb);

                /* pack controls for the freebox */
                hbox = ewl_hbox_new();
                ewl_container_child_append(EWL_CONTAINER(border), hbox);
                ewl_object_fill_policy_set(EWL_OBJECT(hbox),
                                EWL_FLAG_FILL_NONE);
                ewl_object_alignment_set(EWL_OBJECT(hbox), EWL_FLAG_ALIGN_TOP);
                ewl_widget_show(hbox);

                o = ewl_button_new();
                ewl_button_label_set(EWL_BUTTON(o), "Add items");
                ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
                ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
                ewl_container_child_append(EWL_CONTAINER(hbox), o);
                ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                        ewl_freebox_cb_add, fb);
                ewl_widget_show(o);

                o = ewl_button_new();
                ewl_button_label_set(EWL_BUTTON(o), "Clear items");
                ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
                ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
                ewl_container_child_append(EWL_CONTAINER(hbox), o);
                ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                        ewl_freebox_cb_clear, fb);
                ewl_widget_show(o);
        }

        return 1;
}
コード例 #7
0
eth_panel* ethpanel_create(main_window* win)
{
    Ewl_Widget *hbox,*grid;
    Ewl_Widget *label;
    eth_panel* pnl;
    pnl=(eth_panel*)malloc((unsigned int)sizeof(eth_panel));

    pnl->interface = NULL;
    pnl->win = win;
    pnl->frame = ewl_border_new();
    pnl->apply = 0;
    ewl_border_label_set(EWL_BORDER(pnl->frame),"hehe");
    ewl_widget_show(pnl->frame);

    pnl->box_configuration = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->frame), pnl->box_configuration);
    ewl_widget_show(pnl->box_configuration);
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->box_configuration), EWL_FLAG_FILL_HFILL);
    ewl_object_alignment_set(EWL_OBJECT(pnl->box_configuration),EWL_FLAG_ALIGN_LEFT);


    //#########################################
    //## box_configuration: box_activate ##
    //#########################################
    pnl->box_activate = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), pnl->box_activate);
    pnl->btn_activate = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(pnl->btn_activate),_("Activate"));
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->btn_activate), EWL_FLAG_FILL_SHRINK);

    pnl->btn_deactivate = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(pnl->btn_deactivate),_("Deactivate"));
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->btn_deactivate), EWL_FLAG_FILL_SHRINK);

    ewl_container_child_append(EWL_CONTAINER(pnl->box_activate), pnl->btn_deactivate);
    ewl_container_child_append(EWL_CONTAINER(pnl->box_activate), pnl->btn_activate);
    ewl_widget_show(pnl->btn_activate);
    ewl_widget_show(pnl->btn_deactivate);
    ewl_widget_show(pnl->box_activate);
    ewl_callback_append(pnl->btn_activate, EWL_CALLBACK_CLICKED,
            ethpanel_btn_activate_clicked_cb, pnl);
    ewl_callback_append(pnl->btn_deactivate, EWL_CALLBACK_CLICKED,
            ethpanel_btn_deactivate_clicked_cb, pnl);



    //###################################################
    //## box_configuration: check list (static / dhcp) ##
    //###################################################

    hbox = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), hbox);

    pnl->check_static = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(pnl->check_static),_("Static address"));
    pnl->check_dhcp = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(pnl->check_dhcp),_("DHCP (Automatic configuration)"));
    ewl_radiobutton_chain_set(EWL_RADIOBUTTON(pnl->check_dhcp),
                              EWL_RADIOBUTTON(pnl->check_static));
    ewl_container_child_append(EWL_CONTAINER(hbox), pnl->check_static);
    ewl_container_child_append(EWL_CONTAINER(hbox), pnl->check_dhcp);
    ewl_widget_show(hbox);
    ewl_widget_show(pnl->check_dhcp);
    ewl_widget_show(pnl->check_static);
    ewl_callback_append(pnl->check_static, EWL_CALLBACK_CLICKED,
            ethpanel_set_static_dhcp_clicked_cb, pnl);
    ewl_callback_append(pnl->check_dhcp, EWL_CALLBACK_CLICKED,
            ethpanel_set_static_dhcp_clicked_cb, pnl);


    //###################################
    //## box_configuration: Entry list ##
    //###################################
    pnl->entry_ip = ewl_entry_new();
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->entry_ip), EWL_FLAG_FILL_FILL);
    ewl_object_alignment_set(EWL_OBJECT(pnl->entry_ip),EWL_FLAG_ALIGN_LEFT);

    pnl->entry_mask = ewl_entry_new();
    pnl->entry_gateway = ewl_entry_new();
    pnl->entry_cmd = ewl_entry_new();
    ewl_callback_append(pnl->entry_ip, EWL_CALLBACK_KEY_UP,
            ethpanel_textchanged_entry_cb, pnl);
    ewl_callback_append(pnl->entry_mask, EWL_CALLBACK_KEY_UP,
            ethpanel_textchanged_entry_cb, pnl);
    ewl_callback_append(pnl->entry_gateway, EWL_CALLBACK_KEY_UP,
            ethpanel_textchanged_entry_cb, pnl);

    grid = ewl_grid_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), grid);
    ewl_object_fill_policy_set(EWL_OBJECT(grid), EWL_FLAG_FILL_HFILL);
    ewl_grid_dimensions_set(EWL_GRID(grid), 2, 5);
    ewl_grid_column_relative_w_set(EWL_GRID(grid), 0, 0.20);

    label = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(label),_("Ip address: "));
    ewl_container_child_append(EWL_CONTAINER(grid), label);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_ip);
    ewl_widget_show(label);
    ewl_widget_show(pnl->entry_ip);

    label = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(label),_("Network mask: "));
    ewl_container_child_append(EWL_CONTAINER(grid), label);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_mask);
    ewl_widget_show(label);
    ewl_widget_show(pnl->entry_mask);

    label = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(label),_("Gateway: "));
    ewl_container_child_append(EWL_CONTAINER(grid), label);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_gateway);
    ewl_widget_show(label);
    ewl_widget_show(pnl->entry_gateway);

    pnl->lbl_cmd = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(pnl->lbl_cmd),_("Command: "));
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->lbl_cmd);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_cmd);
    ewl_widget_show(pnl->lbl_cmd);
    ewl_widget_show(pnl->entry_cmd);

    ewl_widget_show(grid);

    //#####################################
    //## box_configuration: Apply button ##
    //#####################################

    hbox = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), hbox);
    pnl->btn_apply = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(pnl->btn_apply), EWL_STOCK_APPLY);
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->btn_apply), EWL_FLAG_FILL_SHRINK);

    ewl_container_child_append(EWL_CONTAINER(hbox), pnl->btn_apply);
    ewl_widget_show(pnl->btn_apply);
    ewl_widget_show(hbox);

    ewl_callback_append(pnl->btn_apply, EWL_CALLBACK_CLICKED,
            ethpanel_btn_apply_clicked_cb, pnl);

    //########################################
    //## box_configuration: hbox_pbar	##
    //########################################

    pnl->hbox_pbar = ewl_hbox_new();
    pnl->pbar = ewl_progressbar_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), pnl->hbox_pbar);
    ewl_container_child_append(EWL_CONTAINER(pnl->hbox_pbar), pnl->pbar);

    ewl_progressbar_label_set(EWL_PROGRESSBAR(pnl->pbar), APPLY_TEXT);
    ewl_range_unknown_set(EWL_RANGE(pnl->pbar), TRUE);

    ewl_widget_show(pnl->pbar);
    ewl_widget_show(pnl->hbox_pbar);

    return pnl;
}
コード例 #8
0
        ewl_widget_show(o);

        return 1;
}

static void
run_window(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data __UNUSED__)
{
        Ewl_Widget *win, *b, *o;

        win = ewl_window_new();
        ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, del_window_cb, NULL);
        ewl_window_borderless_set(EWL_WINDOW(win), TRUE);
        ewl_widget_show(win);

        b = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(win), b);
        ewl_widget_show(b);

        o = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(o), "Flip borderless");
        ewl_callback_append(o, EWL_CALLBACK_CLICKED, flip_border_cb, win);
        ewl_container_child_append(EWL_CONTAINER(b), o);
        ewl_widget_show(o);
}

static void
del_window_cb(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
{
        ewl_widget_destroy(w);
}
コード例 #9
0
ファイル: ewl_tip.c プロジェクト: playya/Enlightenment
void ewl_entropy_tip_window_display()
{
    Ewl_Widget* tip_window = ewl_window_new();
    Ewl_Widget* vbox = ewl_vbox_new();
    Ewl_Widget* hbox = ewl_hbox_new();
    Ewl_Widget* button;
    Ewl_Widget* image = ewl_image_new();

    ewl_entropy_tip_window_create_tips();
    tip_number = 0;

    ewl_object_alignment_set(EWL_OBJECT(hbox), EWL_FLAG_ALIGN_BOTTOM);
    ewl_object_alignment_set(EWL_OBJECT(vbox), EWL_FLAG_ALIGN_BOTTOM);
    ewl_object_alignment_set(EWL_OBJECT(tip_window), EWL_FLAG_ALIGN_BOTTOM);
    ewl_object_fill_policy_set(EWL_OBJECT(tip_window), EWL_FLAG_FILL_FILL);
    ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_FILL);

    ewl_container_child_append(EWL_CONTAINER(tip_window), vbox);
    ewl_container_child_append(EWL_CONTAINER(vbox), hbox);

    text_tip = ewl_text_new();
    ewl_object_minimum_h_set(EWL_OBJECT(text_tip), 80);
    ewl_container_child_append(EWL_CONTAINER(hbox), text_tip);

    ewl_image_file_set(EWL_IMAGE(image), PACKAGE_DATA_DIR "/icons/tip.png", NULL);
    ewl_container_child_append(EWL_CONTAINER(hbox), image);
    ewl_widget_show(hbox);

    hbox = ewl_hbox_new();
    ewl_widget_show(hbox);
    ewl_container_child_append(EWL_CONTAINER(vbox), hbox);

    button = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(button), "Prev Tip");
    ewl_object_custom_h_set(EWL_OBJECT(button), 15);
    ewl_widget_show(button);
    ewl_container_child_append(EWL_CONTAINER(hbox), button);

    button = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(button), "Next Tip");
    ewl_object_custom_h_set(EWL_OBJECT(button), 15);
    ewl_callback_append(button, EWL_CALLBACK_CLICKED, ewl_entropy_tip_window_tip_next_cb, NULL);
    ewl_widget_show(button);
    ewl_container_child_append(EWL_CONTAINER(hbox), button);

    button = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(button), "Close");
    ewl_object_custom_h_set(EWL_OBJECT(button), 15);
    ewl_callback_append(button, EWL_CALLBACK_CLICKED, ewl_entropy_tip_window_destroy_cb, tip_window);
    ewl_widget_show(button);
    ewl_container_child_append(EWL_CONTAINER(hbox), button);


    ewl_callback_append(tip_window, EWL_CALLBACK_DELETE_WINDOW, ewl_entropy_tip_window_destroy_cb, tip_window);

    ewl_widget_show(tip_window);
    ewl_widget_show(vbox);
    ewl_widget_show(text_tip);
    ewl_widget_show(image);

    ewl_entropy_tip_window_tip_next_cb(NULL,NULL,NULL);

}
コード例 #10
0
ファイル: ewl_box_test.c プロジェクト: playya/Enlightenment
int
create_test(Ewl_Container *box)
{
        Ewl_Widget *vbox[2], *hbox[3];
        Ewl_Widget *vbox_button[2][3];
        Ewl_Widget *hbox_button[2][3];

        /*
         * Create the first horizontal box, this is positioned in the upper
         * left corner.
         */
        hbox[0] = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox[0]);
        ewl_widget_show(hbox[0]);

        /******************************************************************/
        /* Create a box for holding the horizontal alignment test buttons */
        /******************************************************************/
        vbox[0] = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(hbox[0]), vbox[0]);
        ewl_widget_show(vbox[0]);

        /*
         * Create and setup the button that starts in the left position.
         */
        vbox_button[0][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[0][0]), "Left");
        ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][0]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][0]),
                                  EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][0]),
                                 EWL_FLAG_ALIGN_LEFT);
        ewl_callback_append(vbox_button[0][0], EWL_CALLBACK_CLICKED,
                            toggle_child_horizontal_align, NULL);
        ewl_widget_show(vbox_button[0][0]);

        /*
         * Create and setup the button that starts in the center position.
         */
        vbox_button[0][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[0][1]), "Center");
        ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][1]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][1]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][1]),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[0][1], EWL_CALLBACK_CLICKED,
                            toggle_child_horizontal_align, NULL);
        ewl_widget_show(vbox_button[0][1]);

        /*
         * Create and setup the button that starts in the right position.
         */
        vbox_button[0][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[0][2]), "Right");
        ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][2]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][2]),
                                 EWL_FLAG_ALIGN_RIGHT);
        ewl_callback_append(vbox_button[0][2], EWL_CALLBACK_CLICKED,
                            toggle_child_horizontal_align, NULL);
        ewl_widget_show(vbox_button[0][2]);

        /****************************************************************/
        /* Create a box for holding the Fill test buttons               */
        /****************************************************************/
        vbox[1] = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(hbox[0]), vbox[1]);
        ewl_widget_show(vbox[1]);

        /*
         * Create and setup a button with no filling by default.
         */
        vbox_button[1][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[1][0]), "None");
        ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][0]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][0]),
                                   EWL_FLAG_FILL_NONE);
        ewl_box_orientation_set(EWL_BOX(vbox_button[1][0]),
                        EWL_ORIENTATION_VERTICAL);
        ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][0])->label_object),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[1][0], EWL_CALLBACK_CLICKED,
                            toggle_child_fill, NULL);
        ewl_widget_show(vbox_button[1][0]);

        /*
         * Create and setup a button with filling by default.
         */
        vbox_button[1][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[1][1]), "Fill");
        ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][1]);
        ewl_box_orientation_set(EWL_BOX(vbox_button[1][1]),
                       EWL_ORIENTATION_VERTICAL);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][1]),
                                   EWL_FLAG_FILL_FILL);
        ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][1])->label_object),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[1][1], EWL_CALLBACK_CLICKED,
                            toggle_child_fill, NULL);
        ewl_widget_show(vbox_button[1][1]);

        /*
         * Create and setup a button with no filling by default.
         */
        vbox_button[1][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[1][2]), "None");
        ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][2]);
        ewl_box_orientation_set(EWL_BOX(vbox_button[1][2]),
                        EWL_ORIENTATION_VERTICAL);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][2])->label_object),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[1][2], EWL_CALLBACK_CLICKED,
                            toggle_child_fill, NULL);
        ewl_widget_show(vbox_button[1][2]);

        /****************************************************************/
        /* Create a box for holding the vertical alignment test buttons */
        /****************************************************************/
        hbox[1] = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox[1]);
        ewl_widget_show(hbox[1]);

        /*
         * Create and setup a button with top alignment by default.
         */
        hbox_button[0][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[0][0]), "Top");
        ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][0]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][0]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][0]),
                                 EWL_FLAG_ALIGN_TOP);
        ewl_callback_append(hbox_button[0][0], EWL_CALLBACK_CLICKED,
                            toggle_child_vertical_align, NULL);
        ewl_widget_show(hbox_button[0][0]);

        /*
         * Create and setup a button with center alignment by default.
         */
        hbox_button[0][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[0][1]), "Center");
        ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][1]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][1]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][1]),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(hbox_button[0][1], EWL_CALLBACK_CLICKED,
                            toggle_child_vertical_align, NULL);
        ewl_widget_show(hbox_button[0][1]);

        /*
         * Create and setup a button with bottom alignment by default.
         */
        hbox_button[0][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[0][2]), "Bottom");
        ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][2]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][2]),
                                 EWL_FLAG_ALIGN_BOTTOM);
        ewl_callback_append(hbox_button[0][2], EWL_CALLBACK_CLICKED,
                            toggle_child_vertical_align, NULL);
        ewl_widget_show(hbox_button[0][2]);

        /****************************************************************/
        /* Create a box for holding the Shrink test buttons             */
        /****************************************************************/
        hbox[2] = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox[2]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox[2]), EWL_FLAG_FILL_HFILL);
        ewl_widget_show(hbox[2]);

        /*
         * Create and setup a button with no filling by default.
         */
        hbox_button[1][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[1][0]),
                             "Shrink This Box To Fit It's Parent");
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][0]),
                                   EWL_FLAG_FILL_HSHRINK);
        ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][0]);
        ewl_callback_append(hbox_button[1][0], EWL_CALLBACK_CLICKED,
                            toggle_child_shrink, NULL);
        ewl_widget_show(hbox_button[1][0]);

        /*
         * Create and setup a button with shrinking by default.
         */
        hbox_button[1][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[1][1]),
                             "Shrink This Box To Fit It's Parent");
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][1]),
                                   EWL_FLAG_FILL_HSHRINK);
        ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][1]);
        ewl_callback_append(hbox_button[1][1], EWL_CALLBACK_CLICKED,
                            toggle_child_shrink, NULL);
        ewl_widget_show(hbox_button[1][1]);

        /*
         * Create and setup a button with no filling by default.
         */
        hbox_button[1][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[1][2]),
                             "Don't shrink this box at all");
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][2]);
        ewl_callback_append(hbox_button[1][2], EWL_CALLBACK_CLICKED,
                            toggle_child_shrink, NULL);
        ewl_widget_show(hbox_button[1][2]);

        return 1;
}
コード例 #11
0
ファイル: ewl_tree_test.c プロジェクト: playya/Enlightenment
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *tree, *o, *o2, *o3;
        Ewl_Model *model;
        Ewl_View *view;
        void *data;

        o2 = ewl_hbox_new();
        ewl_container_child_append(box, o2);
        ewl_object_fill_policy_set(EWL_OBJECT(o2), EWL_FLAG_FILL_HFILL);
        ewl_widget_show(o2);

        /* create our data */
        data = tree_test_data_setup();

        /* the tree will only use one model. We could use a model per
         * column, but a single model will work fine for this test */
        model = ewl_model_new();
        ewl_model_data_fetch_set(model, tree_test_data_fetch);
        ewl_model_data_header_fetch_set(model,
                                tree_test_cb_header_data_fetch);
        ewl_model_data_sort_set(model, tree_test_data_sort);
        ewl_model_column_sortable_set(model, tree_test_column_sortable);
        ewl_model_data_count_set(model, tree_test_data_count_get);
        ewl_model_data_expandable_set(model, tree_test_data_expandable_get);
        ewl_model_expansion_data_fetch_set(model,
                                tree_test_data_expansion_fetch);

        view = ewl_view_new();
        ewl_view_widget_constructor_set(view, tree_test_cb_widget_fetch);
        ewl_view_widget_assign_set(view, tree_test_cb_widget_assign);
        ewl_view_header_fetch_set(view, tree_test_cb_header_fetch);

        tree = ewl_tree_new();
        ewl_container_child_append(EWL_CONTAINER(box), tree);
        ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL);
        ewl_callback_append(tree, EWL_CALLBACK_VALUE_CHANGED,
                                        tree_cb_value_changed, NULL);
        ewl_mvc_data_set(EWL_MVC(tree), data);
        ewl_mvc_model_set(EWL_MVC(tree), model);
        ewl_mvc_view_set(EWL_MVC(tree), view);
        ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_MULTI);
        ewl_tree_column_count_set(EWL_TREE(tree), 3);
        ewl_tree_row_expand(EWL_TREE(tree), data, 2);
        ewl_widget_name_set(tree, "tree");
        ewl_widget_show(tree);

        o3 = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(o2), o3);
        ewl_widget_show(o3);

        /* create the checkbuttons for the top box */
        o = ewl_checkbutton_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
        ewl_button_label_set(EWL_BUTTON(o), "Scroll headers");
        ewl_container_child_append(EWL_CONTAINER(o3), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_scroll_headers, tree);
        ewl_widget_show(o);

        o = ewl_checkbutton_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
        ewl_button_label_set(EWL_BUTTON(o), "Hide headers");
        ewl_container_child_append(EWL_CONTAINER(o3), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_hide_headers, tree);
        ewl_widget_show(o);

        o = ewl_checkbutton_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Plain view");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_plain_view, tree);
        ewl_widget_show(o);

        o = ewl_spinner_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_spinner_digits_set(EWL_SPINNER(o), 0);
        ewl_range_minimum_value_set(EWL_RANGE(o), 0);
        ewl_range_maximum_value_set(EWL_RANGE(o), 10000);
        ewl_range_value_set(EWL_RANGE(o), 5);
        ewl_range_step_set(EWL_RANGE(o), 1);
        ewl_widget_name_set(o, "rows_spinner");
        ewl_widget_show(o);

        o = ewl_button_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Set number of rows");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_set_rows_clicked, NULL);
        ewl_widget_show(o);

        o = ewl_button_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Row select");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                tree_cb_select_mode_change, NULL);
        ewl_widget_show(o);

	o = ewl_button_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Ensure visible");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                tree_cb_ensure_visible, NULL);
        ewl_widget_show(o);

        return 1;
}
コード例 #12
0
ファイル: project.c プロジェクト: playya/Enlightenment
/**
 * settings->options
 */
static EWL_CALLBACK_DEFN(options)
{
	Ewl_Widget *save, *cancel;
	Ewl_Widget *label_vbox, *entry_vbox, *hbox;
	Ewl_Widget *label, *entry;

	if( options_win )
		return;

	options_win = ewl_dialog_new(EWL_POSITION_BOTTOM);
	if( !options_win )
		return;

	hbox = ewl_hbox_new();
	ewl_dialog_widget_add(EWL_DIALOG(options_win), hbox);
	ewl_widget_show(hbox);

	label_vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(hbox), label_vbox);
	ewl_widget_show(label_vbox);

	label = ewl_text_new("Project Path:");
	ewl_container_child_append(EWL_CONTAINER(label_vbox), label);
	ewl_widget_show(label);

	label = ewl_text_new("Project Name:");
	ewl_container_child_append(EWL_CONTAINER(label_vbox), label);
	ewl_widget_show(label);

	label = ewl_text_new("Project File:");
	ewl_container_child_append(EWL_CONTAINER(label_vbox), label);
	ewl_widget_show(label);

	entry_vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(hbox), entry_vbox);
	ewl_widget_show(entry_vbox);

	entry = ewl_entry_new(active_project->path);
	ewl_container_child_append(EWL_CONTAINER(entry_vbox), entry);
	ewl_widget_show(entry);
	active_project_options.path_entry = entry;

	entry = ewl_entry_new(active_project->name);
	ewl_container_child_append(EWL_CONTAINER(entry_vbox), entry);
	ewl_widget_show(entry);
	active_project_options.name_entry = entry;

	entry = ewl_entry_new(active_project->filename);
	ewl_container_child_append(EWL_CONTAINER(entry_vbox), entry);
	ewl_widget_show(entry);
	active_project_options.filename_entry = entry;

	save = ewl_dialog_button_add(EWL_DIALOG(options_win),
															 EWL_STOCK_SAVE, EWL_RESPONSE_SAVE);
	ewl_callback_append(save, EWL_CALLBACK_VALUE_CHANGED, options_cb, NULL);
	ewl_widget_show(save);

	cancel = ewl_dialog_button_add(EWL_DIALOG(options_win),
																 EWL_STOCK_CANCEL, EWL_RESPONSE_CANCEL);
	ewl_callback_append(cancel, EWL_CALLBACK_VALUE_CHANGED, options_cb, NULL);
	ewl_widget_show(cancel);

	ewl_widget_show(options_win);
}
コード例 #13
0
void mime_add_dialog_show(char* type, char* exe) {
	Ewl_Widget* layout_box = ewl_vbox_new();
	Ewl_Widget* window = ewl_window_new();
	Ewl_Widget* hbox;
	
	Ewl_Widget* label;
	Ewl_Widget* button;
	
	ewl_widget_show(layout_box);
	ewl_object_minimum_size_set(EWL_OBJECT(window), 400, 150);
	ewl_container_child_append(EWL_CONTAINER(window), layout_box);


	/*---*/
	hbox = ewl_hbox_new();
	ewl_widget_show(hbox);
	ewl_container_child_append(EWL_CONTAINER(layout_box), hbox);

	label = ewl_label_new();
	ewl_label_text_set(EWL_LABEL(label), "MIME Type");
	ewl_widget_show(label);
	ewl_container_child_append(EWL_CONTAINER(hbox), label);

	entry_type = ewl_entry_new();
	if (type) ewl_text_text_set(EWL_TEXT(entry_type), type);
	ewl_container_child_append(EWL_CONTAINER(hbox), entry_type);
	ewl_widget_show(entry_type);
	/*---*/

	/*---*/
	hbox = ewl_hbox_new();
	ewl_widget_show(hbox);
	ewl_container_child_append(EWL_CONTAINER(layout_box), hbox);

	label = ewl_label_new();
	ewl_label_text_set(EWL_LABEL(label), "Action");
	ewl_widget_show(label);
	ewl_container_child_append(EWL_CONTAINER(hbox), label);

	entry_action = ewl_entry_new();
	if (exe) ewl_text_text_set(EWL_TEXT(entry_action), exe);	
	ewl_container_child_append(EWL_CONTAINER(hbox), entry_action);
	ewl_widget_show(entry_action);
	/*---*/

	
	hbox = ewl_hbox_new();
	ewl_widget_show(hbox);
	ewl_container_child_append(EWL_CONTAINER(layout_box), hbox);

	button = ewl_button_new();
	ewl_button_label_set(EWL_BUTTON(button), "Add");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, mime_add_cb, window);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	button = ewl_button_new();
	ewl_button_label_set(EWL_BUTTON(button), "Cancel");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, window_dismiss_cb, window);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	ewl_widget_show(window);
}
コード例 #14
0
void entropy_ewl_mime_dialog_display() {
	Ewl_Widget* window = ewl_window_new();
	Ewl_Widget* box = ewl_vbox_new();
	Ewl_Widget* button = ewl_button_new();
	Ewl_Widget* hbox;
	
	entropy_core* core = entropy_core_get_core();
	char* entries[3];
	char* key;
	entropy_mime_action* action;
	Ecore_List* keys;

	last_select_text = NULL;


	/*Init the mime tree*/
	mime_tree = ewl_tree_new(2);

	ewl_tree_mode_set(EWL_TREE(mime_tree), EWL_SELECTION_MODE_SINGLE);
	ewl_object_minimum_size_set(EWL_OBJECT(window), 530, 400);
	ewl_window_title_set(EWL_WINDOW(window), "Edit MIME Actions..");
	ewl_container_child_append(EWL_CONTAINER(window), box);
	ewl_container_child_append(EWL_CONTAINER(box), mime_tree);
	
	ewl_widget_show(box);

	keys = ecore_hash_keys(core->mime_action_hint);
	while ((key = ecore_list_first_remove(keys))) {
		Ewl_Widget* row;
		
		entries[0] = key;
		entries[1] = ((entropy_mime_action*)ecore_hash_get(core->mime_action_hint, key))->executable;
		entries[2] = NULL;

		row = ewl_tree_text_row_add(EWL_TREE(mime_tree), NULL,entries);
		ewl_widget_color_set(row,0,0,0,255);
		ewl_callback_append(row, EWL_CALLBACK_MOUSE_DOWN, 
			mime_row_click_cb, key);
	}
	ecore_list_destroy(keys);


	hbox = ewl_hbox_new();
	ewl_container_child_append(EWL_CONTAINER(box), hbox);
	ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_SHRINK);
	ewl_widget_show(hbox);


	/*Add Button*/
	ewl_button_label_set(EWL_BUTTON(button), "Add MIME Action");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, entropy_ewl_mime_add_display_cb, NULL);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	
	/*OK Button*/
	button = ewl_button_new();
	ewl_button_label_set(EWL_BUTTON(button), "Close");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, window_dismiss_cb, window);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	
	
	
	ewl_widget_show(window);
	ewl_widget_show(mime_tree);
	
}
コード例 #15
0
ファイル: ewl_icon_test.c プロジェクト: playya/Enlightenment
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *o, *o2, *hbox;

        hbox = ewl_hbox_new();
        ewl_container_child_append(box, hbox);
        ewl_widget_show(hbox);

        o = ewl_icon_new();
        ewl_box_orientation_set(EWL_BOX(o), EWL_ORIENTATION_HORIZONTAL);
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Draw");
        ewl_container_child_append(EWL_CONTAINER(hbox), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Fill None");
        ewl_container_child_append(EWL_CONTAINER(hbox), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Draw");
        ewl_container_child_append(EWL_CONTAINER(hbox), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Draw (Editable)");
        ewl_icon_editable_set(EWL_ICON(o), TRUE);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o2 = ewl_text_new();
        ewl_text_text_set(EWL_TEXT(o2), "This icon has\nextended data\n set "
                                        "on it.\n\n That data is just \n"
                                        "text, but could\nbe any widget.");
        ewl_widget_show(o2);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_extended_data_set(EWL_ICON(o), o2);
        ewl_icon_label_set(EWL_ICON(o), "World");
        ewl_icon_type_set(EWL_ICON(o), EWL_ICON_TYPE_LONG);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "This is a long title that is compressed.");
        ewl_icon_label_compressed_set(EWL_ICON(o), TRUE);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "This is a long title that is compressed.");
        ewl_icon_label_compressed_set(EWL_ICON(o), TRUE);
        ewl_icon_editable_set(EWL_ICON(o), TRUE);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_alt_text_set(EWL_ICON(o), "Icon Alt Text");
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        return 1;
}
コード例 #16
0
ファイル: edvi_ewl_test.c プロジェクト: Limsik/e17
int
main (int argc, char *argv[])
{
  Ecore_List     *str_data = NULL;
  Ewl_Widget     *window;
  Ewl_Widget     *hbox;
  Ewl_Widget     *list;
  Ewl_Model      *model;
  Ewl_View       *view;
  Ewl_Widget     *dvi;
  Ewl_Widget     *sp;
  const Edvi_Document  *document;
  int             page_count;
  int             i;

  if (argc == 1) {
    printf ("Usage: %s dvi_file\n", argv[0]);
    return EXIT_FAILURE;
  }

  printf ("[DVI] version       : %s\n", edvi_version_get ());
  if (!edvi_init (300, "cx", 4,
                  1.0, 1.0,
                  0, 255, 255, 255, 0, 0, 0))
    return EXIT_FAILURE;

  ewl_init (&argc, (char **)argv);
  str_data = ecore_list_new();
  ecore_list_free_cb_set (str_data, free);

  /* We open the dvi file */
  dvi = ewl_dvi_new ();
  if (!ewl_dvi_file_set (EWL_DVI (dvi), argv[1])) {
    printf ("Can not load the document %s\nExiting...", argv[1]);
    ecore_list_destroy (str_data);
    ewl_main_quit();
    return EXIT_FAILURE;
  }

  window = ewl_window_new ();
  ewl_window_title_set (EWL_WINDOW (window), "Ewl Dvi Test Application");
  ewl_callback_append (window, EWL_CALLBACK_DELETE_WINDOW,
                       _quit_cb, str_data);

  hbox = ewl_hbox_new ();
  ewl_box_homogeneous_set (EWL_BOX (hbox), FALSE);
  ewl_container_child_append (EWL_CONTAINER (window), hbox);
  ewl_widget_show (hbox);

  sp = ewl_scrollpane_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), sp);
  ewl_widget_show (sp);

  document = ewl_dvi_dvi_document_get (EWL_DVI (dvi));
  page_count = edvi_document_page_count_get (document);
  for (i = 0; i < page_count; i++) {
    char row_text[64];
    char *txt;

    snprintf (row_text, 64, "%d", i + 1);
    txt = strdup (row_text);
    ecore_list_append(str_data, txt);
  }

  model = ewl_model_ecore_list_instance();
  view = ewl_label_view_get();

  list = ewl_list_new ();
  ewl_mvc_model_set(EWL_MVC(list), model);
  ewl_mvc_view_set(EWL_MVC(list), view);
  ewl_mvc_data_set(EWL_MVC(list), str_data);
  ewl_callback_append (list,
                       EWL_CALLBACK_VALUE_CHANGED,
                       EWL_CALLBACK_FUNCTION (_change_page_cb),
                       dvi);
  ewl_container_child_append (EWL_CONTAINER (sp), list);
  ewl_widget_show (list);

  ewl_dvi_mag_set (EWL_DVI (dvi), 0.5);
  ewl_container_child_append (EWL_CONTAINER (hbox), dvi);
  ewl_widget_show (dvi);

  ewl_widget_show (window);

  ewl_main ();

  edvi_shutdown ();

  return EXIT_SUCCESS;
}
コード例 #17
0
void
_icon_editor_gui_init()
{
  if (!editor) return;

  editor->win = ewl_window_new();
  ewl_window_title_set(EWL_WINDOW(editor->win), "Iconbar Icon Editor");
  ewl_window_name_set(EWL_WINDOW(editor->win), "Iconbar Icon Editor");
  ewl_callback_append(editor->win, EWL_CALLBACK_DELETE_WINDOW,
                      _editor_close_win, NULL);

  /* boxes */
  editor->main_vbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->win), editor->main_vbox);
  ewl_widget_show(editor->main_vbox);
  
  editor->top_hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->main_vbox), editor->top_hbox);
  ewl_widget_show(editor->top_hbox);

  editor->bot_hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->main_vbox), editor->bot_hbox);
  ewl_widget_show(editor->bot_hbox);

  /* image */
  editor->icon_image = ewl_image_new("test.png", NULL);
  ewl_container_child_append(EWL_CONTAINER(editor->top_hbox), editor->icon_image);
  ewl_object_padding_set(EWL_OBJECT(editor->icon_image), 5, 5, 5, 5);
  ewl_widget_show(editor->icon_image);
  ewl_callback_append(editor->icon_image, EWL_CALLBACK_REALIZE,
                      _editor_realize, NULL);
  ewl_callback_append(editor->icon_image, EWL_CALLBACK_MOUSE_UP,
                      _editor_icon_image_cb, NULL);

  /* vbox for entry hboxes */
  editor->right_vbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->top_hbox), editor->right_vbox);
  ewl_widget_show(editor->right_vbox);


  /* name */
  editor->name.hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->right_vbox), editor->name.hbox);
  ewl_widget_show(editor->name.hbox);

  editor->name.label = ewl_text_new("Name: ");
  ewl_container_child_append(EWL_CONTAINER(editor->name.hbox), editor->name.label);
  ewl_widget_show(editor->name.label);

  editor->name.entry = ewl_entry_new("");
  ewl_container_child_append(EWL_CONTAINER(editor->name.hbox), editor->name.entry);
  ewl_widget_show(editor->name.entry);


  /* exec */
  editor->exec.hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->right_vbox), editor->exec.hbox);
  ewl_widget_show(editor->exec.hbox);

  editor->exec.label = ewl_text_new("Exec:");
  ewl_container_child_append(EWL_CONTAINER(editor->exec.hbox), editor->exec.label);
  ewl_widget_show(editor->exec.label);

  editor->exec.entry = ewl_entry_new("");
  ewl_container_child_append(EWL_CONTAINER(editor->exec.hbox), editor->exec.entry);
  ewl_widget_show(editor->exec.entry);


  /* cancel and save buttons */
  editor->cancel_but = ewl_button_new("Cancel");
  ewl_object_fill_policy_set(EWL_OBJECT(editor->cancel_but), EWL_FLAG_FILL_NONE);
  ewl_object_padding_set(EWL_OBJECT(editor->cancel_but), 5, 5, 5, 5);
  ewl_object_alignment_set(EWL_OBJECT(editor->cancel_but), EWL_FLAG_ALIGN_RIGHT);
  ewl_container_child_append(EWL_CONTAINER(editor->bot_hbox), editor->cancel_but);
  ewl_widget_show(editor->cancel_but);
  ewl_callback_append(editor->cancel_but, EWL_CALLBACK_CLICKED,
                      _editor_button_cb, NULL);

  editor->ok_but = ewl_button_new("Save and Close");
  ewl_object_fill_policy_set(EWL_OBJECT(editor->ok_but), EWL_FLAG_FILL_NONE);
  ewl_object_padding_set(EWL_OBJECT(editor->ok_but), 5, 5, 5, 5);
  ewl_object_alignment_set(EWL_OBJECT(editor->ok_but), EWL_FLAG_ALIGN_RIGHT);
  ewl_container_child_append(EWL_CONTAINER(editor->bot_hbox), editor->ok_but);
  ewl_widget_show(editor->ok_but);
  ewl_callback_append(editor->ok_but, EWL_CALLBACK_CLICKED,
                      _editor_button_cb, NULL);

  editor->filesel.win = ewl_window_new();

  editor->filesel.dialog = ewl_filedialog_new(EWL_FILEDIALOG_TYPE_OPEN);
  ewl_container_child_append(EWL_CONTAINER(editor->filesel.win), editor->filesel.dialog);
  ewl_widget_show(editor->filesel.dialog);
  ewl_callback_append(editor->filesel.dialog, EWL_CALLBACK_VALUE_CHANGED, _editor_filesel_cb, NULL);
}
コード例 #18
0
ファイル: gui_ewl.c プロジェクト: Limsik/e17
void
ecrin_ewl_window_create (void)
{
  Ewl_Widget *window;
  Ewl_Widget *hbox;
  Ewl_Widget *notebook;
  Ewl_Widget *tab;
  Ewl_Widget *vbox;
  Ewl_Widget *separator;

  /* We order the list */
  sorted_keys = _list_keys_order (ecrin_hash_keys_get ());

  window = ewl_window_new ();
  ewl_object_size_request (EWL_OBJECT (window), 400, 400);
  ewl_window_title_set (EWL_WINDOW (window),
                       "Ecrin");
  ewl_window_name_set (EWL_WINDOW (window), "Ecrin");
  ewl_window_class_set (EWL_WINDOW (window), "Ecrin");
  ewl_callback_append (window, EWL_CALLBACK_DELETE_WINDOW,
                      _main_window_close, NULL);

  hbox = ewl_hbox_new ();
  ewl_container_child_append (EWL_CONTAINER (window), hbox);
  ewl_widget_show (hbox);

  notebook = ewl_notebook_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), notebook);
  ewl_widget_show (notebook);

  tab = ewl_label_new ("EFL package");
  ewl_widget_show (tab);
  
  tree = ewl_tree_new (1);
  ewl_tree_headers_visible_set (EWL_TREE (tree), 0);
  ewl_notebook_page_append (EWL_NOTEBOOK (notebook), tab, tree);
  ewl_widget_show (tree);

  tab = ewl_label_new ("Search");
  ewl_widget_show (tab);

  vbox = ewl_vbox_new ();
  ewl_box_homogeneous_set (EWL_BOX (vbox), 0);
  ewl_notebook_page_append (EWL_NOTEBOOK (notebook), tab, vbox);
  ewl_widget_show (vbox);

  entry = ewl_entry_new ("");
  ewl_object_fill_policy_set(EWL_OBJECT(entry),
                             EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
  ewl_container_child_append (EWL_CONTAINER (vbox), entry);
  ewl_callback_append (entry, EWL_CALLBACK_VALUE_CHANGED, _list_display_cb, NULL);
  ewl_widget_show (entry);

  separator = ewl_hseparator_new ();
  ewl_container_child_append (EWL_CONTAINER (vbox), separator);
  ewl_widget_show (separator);

  list = ewl_tree_new (1);
  ewl_tree_headers_visible_set (EWL_TREE (list), 0);
  ewl_container_child_append (EWL_CONTAINER (vbox), list);
  ewl_widget_show (list);

  separator = ewl_vseparator_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), separator);
  ewl_widget_show (separator);

  text = ewl_text_new ("");
  ewl_container_child_append (EWL_CONTAINER (hbox), text);
  ewl_widget_show (text);

  ecrin_ewl_tree_fill_package ();
  ecrin_ewl_list_fill_package ("");

  ewl_widget_show (window);
}
コード例 #19
0
ファイル: madpdf.c プロジェクト: quickhand/madpdf
int main ( int argc, char ** argv )
{	

    
    Ewl_Widget *vbox=NULL;
    Ewl_Widget *statbar=NULL;
    char *homedir;
    char *configfile;
    if(argc<2)
        return 1;
    
    if ( !ewl_init ( &argc, argv ) )
    {
        return 1;
    }

    //setlocale(LC_ALL, "");
    //textdomain("elementpdf");
    ewl_theme_theme_set(get_theme_file());
    
    homedir=getenv("HOME");
    configfile=(char *)calloc(strlen(homedir)+21 + 1, sizeof(char));
    strcat(configfile,homedir);
    strcat(configfile,"/.madpdf");
    
    if(!file_exists(configfile))
    {
        mkdir (configfile,S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
        
    }
    
    strcat(configfile,"/settings.xml");
    
    
    
    load_settings(configfile);
    
    win = ewl_window_new();
    ewl_window_title_set ( EWL_WINDOW ( win ), "EWL_WINDOW" );
    ewl_window_name_set ( EWL_WINDOW ( win ), "EWL_WINDOW" );
    ewl_window_class_set ( EWL_WINDOW ( win ), "EWLWindow" );
    ewl_object_size_request ( EWL_OBJECT ( win ), 600, 800 );
    ewl_callback_append ( win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL );
    ewl_callback_append(win, EWL_CALLBACK_KEY_DOWN, cb_key_down, NULL);
    ewl_widget_name_set(win,"mainwindow");
    ewl_widget_show ( win );
 
    vbox=ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(win),vbox);
    ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_FILL);
    ewl_widget_show(vbox);
    
    scrollpane=ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(vbox),scrollpane);
    ewl_callback_append(scrollpane,EWL_CALLBACK_REVEAL,cb_scrollpane_revealed,NULL);
    ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(scrollpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(scrollpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    //ewl_object_fill_policy_set(EWL_OBJECT(scrollpane), EWL_FLAG_FILL_FILL);
    //ewl_theme_data_str_set(EWL_WIDGET(scrollpane),"/scrollpane/group","ewl/blank");
    ewl_widget_show(scrollpane);
    
    trimpane=ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(scrollpane),trimpane);
    ewl_object_alignment_set(EWL_OBJECT(trimpane),EWL_FLAG_ALIGN_LEFT|EWL_FLAG_ALIGN_TOP);
    ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(trimpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(trimpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    //ewl_theme_data_str_set(EWL_WIDGET(trimpane),"/scrollpane/group","ewl/blank");
    ewl_widget_show(trimpane);
    
    statbar=ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(vbox),statbar);
    ewl_theme_data_str_set(EWL_WIDGET(statbar),"/hbox/group","ewl/menu/oi_menu");
    ewl_object_fill_policy_set(EWL_OBJECT(statbar),EWL_FLAG_FILL_HFILL|EWL_FLAG_FILL_VSHRINKABLE);
    ewl_widget_show(statbar);
    
    statlabel1=ewl_label_new();   
    //ewl_statusbar_left_append(EWL_STATUSBAR(statbar),statlabel1);
    ewl_container_child_append(EWL_CONTAINER(statbar),statlabel1);
    ewl_theme_data_str_set(EWL_WIDGET(statlabel1),"/label/group","ewl/oi_statbar_label_left");
    ewl_theme_data_str_set(EWL_WIDGET(statlabel1),"/label/textpart","ewl/oi_statbar_label_left/text");
    ewl_object_fill_policy_set(EWL_OBJECT(statlabel1),EWL_FLAG_FILL_HSHRINKABLE);
    ewl_widget_show(statlabel1);
    
    statlabel2=ewl_label_new();   
    //ewl_statusbar_right_append(EWL_STATUSBAR(statbar),statlabel2);
    ewl_container_child_append(EWL_CONTAINER(statbar),statlabel2);
    ewl_theme_data_str_set(EWL_WIDGET(statlabel2),"/label/group","ewl/oi_statbar_label_right");
    ewl_theme_data_str_set(EWL_WIDGET(statlabel2),"/label/textpart","ewl/oi_statbar_label_right/text");
    ewl_object_fill_policy_set(EWL_OBJECT(statlabel2),EWL_FLAG_FILL_HFILL);
    ewl_widget_show(statlabel2);
    
    
    pdfwidget = ewl_pdf_new();
    ewl_pdf_file_set (EWL_PDF (pdfwidget), argv[1]);
    ewl_container_child_append(EWL_CONTAINER(trimpane),pdfwidget);
    ewl_object_alignment_set(EWL_OBJECT(pdfwidget),EWL_FLAG_ALIGN_LEFT|EWL_FLAG_ALIGN_TOP);
    ewl_widget_name_set(pdfwidget,"pdfwidget");
    ewl_callback_append (pdfwidget, EWL_CALLBACK_CONFIGURE, cb_pdfwidget_resized, NULL );
    ewl_widget_show (pdfwidget);
    
    //set up menu
    menu=ewl_context_menu_new();
    
    ewl_callback_append(menu, EWL_CALLBACK_KEY_DOWN, cb_menu_key_down, NULL);
    ewl_theme_data_str_set(EWL_WIDGET(menu),"/menu/group","ewl/menu/oi_menu");
    ewl_context_menu_attach(EWL_CONTEXT_MENU(menu), statbar);
    
    Ewl_Widget *temp=ewl_menu_new();
    ewl_container_child_append(EWL_CONTAINER(menu),temp);
    ewl_widget_name_set(temp,"menuitem1");
    ewl_button_label_set(EWL_BUTTON(temp),"1. Go to page...");
    ewl_widget_show(temp);

    goto_entry=ewl_entry_new();
    ewl_container_child_append(EWL_CONTAINER(temp),goto_entry);
    ewl_object_custom_w_set(EWL_OBJECT(goto_entry),50);
    ewl_callback_append(goto_entry, EWL_CALLBACK_KEY_DOWN, cb_goto_key_down, NULL);
    ewl_widget_show(goto_entry);
    
    
    temp=ewl_menu_item_new();
    ewl_widget_name_set(temp,"menuitem2");
    ewl_container_child_append(EWL_CONTAINER(menu),temp);
    ewl_button_label_set(EWL_BUTTON(temp),"2. Preferences...");
    ewl_widget_show(temp);

        
    
    
    ewl_main();
    save_settings(configfile);
    free(configfile);
    free_settings();
    return 0;
}