找回密码
 立即注册
查看: 2233|回复: 0

Tizen系统基本inwin小部件

[复制链接]
发表于 2015-8-30 12:39:07 | 显示全部楼层 |阅读模式
此示例代码显示了如何创建和使用inwin基本小部件。
  1. static void hide_inwin_cb(void *data, Evas_Object *obj, void *event) {
  2.         Evas_Object *inwin = (Evas_Object *) data;
  3.         if (inwin) {
  4.                 evas_object_hide(inwin);
  5.         }
  6. }

  7. static void show_inwin_cb(void *data, Evas_Object *obj, void *event) {
  8.         Evas_Object *inwin = (Evas_Object *) data;
  9.         if (inwin) {
  10.                 elm_win_inwin_activate(inwin);
  11.         }
  12. }

  13. static void inwin_test(appdata_s *ad) {
  14.         
  15.         //"Show inwin" button
  16.         Evas_Object *show_button = elm_button_add(ad->win);
  17.         elm_object_text_set(show_button, "Show inwin");
  18.         evas_object_resize(show_button, 200, 50);
  19.         evas_object_move(show_button, 125, 300);
  20.         evas_object_show(show_button);

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

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

  28.         //create the contents of the inwin
  29.         Evas_Object *box = elm_box_add(ad->win);
  30.         evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
  31.         evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
  32.         elm_win_inwin_content_set(inwin, box);
  33.         evas_object_show(box);

  34.         Evas_Object *hide_button = elm_button_add(ad->win);
  35.         elm_object_text_set(hide_button, "Hide inwin");
  36.         evas_object_show(hide_button);
  37.         evas_object_smart_callback_add(hide_button, "clicked", hide_inwin_cb, inwin);
  38.         elm_box_pack_end(box, hide_button);
  39. }
复制代码
欢迎来到泰泽网:http://www.tizennet.com/ 泰泽论坛:http://bbs.tizennet.com/ 好没有内涵哦,快到设置中更改这个无聊的签名吧!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|泰泽应用|泰泽论坛|泰泽网|小黑屋|Archiver|手机版|泰泽邮箱|泰泽网 ( 蜀ICP备13024062号-1 )

GMT+8, 2024-11-1 07:37 , Processed in 0.082054 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表