流星悟语 发表于 2015-8-30 12:39:07

Tizen系统基本inwin小部件

此示例代码显示了如何创建和使用inwin基本小部件。
static void hide_inwin_cb(void *data, Evas_Object *obj, void *event) {
      Evas_Object *inwin = (Evas_Object *) data;
      if (inwin) {
                evas_object_hide(inwin);
      }
}

static void show_inwin_cb(void *data, Evas_Object *obj, void *event) {
      Evas_Object *inwin = (Evas_Object *) data;
      if (inwin) {
                elm_win_inwin_activate(inwin);
      }
}

static void inwin_test(appdata_s *ad) {
      
      //"Show inwin" button
      Evas_Object *show_button = elm_button_add(ad->win);
      elm_object_text_set(show_button, "Show inwin");
      evas_object_resize(show_button, 200, 50);
      evas_object_move(show_button, 125, 300);
      evas_object_show(show_button);

      //create the inwin
      Evas_Object* inwin = elm_win_inwin_add(ad->win);
      
      //set style of the inwin ("default", "minimal" or "minimal_vertical")
      elm_object_style_set(inwin, "minimal_vertical");

      //callback for showing the inwin
      evas_object_smart_callback_add(show_button, "clicked", show_inwin_cb, inwin);

      //create the contents of the inwin
      Evas_Object *box = elm_box_add(ad->win);
      evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
      evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
      elm_win_inwin_content_set(inwin, box);
      evas_object_show(box);

      Evas_Object *hide_button = elm_button_add(ad->win);
      elm_object_text_set(hide_button, "Hide inwin");
      evas_object_show(hide_button);
      evas_object_smart_callback_add(hide_button, "clicked", hide_inwin_cb, inwin);
      elm_box_pack_end(box, hide_button);
}
页: [1]
查看完整版本: Tizen系统基本inwin小部件