summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2011-10-29 07:27:00 +0000
committerBruno Dilly <bdilly@profusion.mobi>2011-10-29 07:27:00 +0000
commitc05fb46d2daff962ddcc28a72656e4ba8bb0d3a8 (patch)
tree168bbf502500bd63a6ea7a27dbff444be658e623
parent7047bc4b80be3ad98f9b18bbde3c06f5f49ed3d9 (diff)
Econcentration: Use elm_object_text_set function
Instead of deprecated elm_X_label_set(). SVN revision: 64507
-rw-r--r--src/bin/main.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 9a0c750..439eca8 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -43,7 +43,7 @@ _play_timer_cb(void *data)
43 char buf[16]; 43 char buf[16];
44 game->play_time++; 44 game->play_time++;
45 snprintf(buf, sizeof(buf), "%i s", game->play_time); 45 snprintf(buf, sizeof(buf), "%i s", game->play_time);
46 elm_label_label_set(game->time_lb, buf); 46 elm_object_text_set(game->time_lb, buf);
47 return ECORE_CALLBACK_RENEW; 47 return ECORE_CALLBACK_RENEW;
48} 48}
49 49
@@ -82,7 +82,7 @@ _player_win(Game *game)
82 "You spent %i seconds and<br>" 82 "You spent %i seconds and<br>"
83 "made %i attempts.", 83 "made %i attempts.",
84 game->play_time, game->attempts); 84 game->play_time, game->attempts);
85 elm_label_label_set(game->won_lb, buf); 85 elm_object_text_set(game->won_lb, buf);
86} 86}
87 87
88static void 88static void
@@ -108,7 +108,7 @@ _fl_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__)
108 { 108 {
109 game->attempts++; 109 game->attempts++;
110 snprintf(buf, sizeof(buf), "%i", game->attempts); 110 snprintf(buf, sizeof(buf), "%i", game->attempts);
111 elm_label_label_set(game->attempts_lb, buf); 111 elm_object_text_set(game->attempts_lb, buf);
112 game->second_card = card; 112 game->second_card = card;
113 game->show_timer = ecore_timer_add(FLIP_HIDE, _hide_cards, game); 113 game->show_timer = ecore_timer_add(FLIP_HIDE, _hide_cards, game);
114 return; 114 return;
@@ -117,7 +117,7 @@ _fl_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__)
117 /* first and second cards match */ 117 /* first and second cards match */
118 game->found++; 118 game->found++;
119 snprintf(buf, sizeof(buf), "%i", game->found); 119 snprintf(buf, sizeof(buf), "%i", game->found);
120 elm_label_label_set(game->found_lb, buf); 120 elm_object_text_set(game->found_lb, buf);
121 if (game->found == (game->total_size / 2)) 121 if (game->found == (game->total_size / 2))
122 _player_win(game); 122 _player_win(game);
123 game->first_card = NULL; 123 game->first_card = NULL;
@@ -247,9 +247,9 @@ _start_game_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSE
247 game->first_card = NULL; 247 game->first_card = NULL;
248 game->second_card = NULL; 248 game->second_card = NULL;
249 249
250 elm_label_label_set(game->time_lb, "0 s"); 250 elm_object_text_set(game->time_lb, "0 s");
251 elm_label_label_set(game->attempts_lb, "0"); 251 elm_object_text_set(game->attempts_lb, "0");
252 elm_label_label_set(game->found_lb, "0"); 252 elm_object_text_set(game->found_lb, "0");
253 253
254 if (game->play_timer) 254 if (game->play_timer)
255 ecore_timer_del(game->play_timer); 255 ecore_timer_del(game->play_timer);
@@ -317,14 +317,14 @@ _win_new(Game *game)
317 elm_box_pack_end(bx, bxctl); 317 elm_box_pack_end(bx, bxctl);
318 318
319 bt = elm_button_add(win); 319 bt = elm_button_add(win);
320 elm_button_label_set(bt, "New game"); 320 elm_object_text_set(bt, "New game");
321 evas_object_smart_callback_add(bt, "clicked", _start_game_cb, game); 321 evas_object_smart_callback_add(bt, "clicked", _start_game_cb, game);
322 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); 322 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
323 evas_object_show(bt); 323 evas_object_show(bt);
324 elm_box_pack_end(bxctl, bt); 324 elm_box_pack_end(bxctl, bt);
325 325
326 bt = elm_button_add(win); 326 bt = elm_button_add(win);
327 elm_button_label_set(bt, "Quit"); 327 elm_object_text_set(bt, "Quit");
328 evas_object_smart_callback_add(bt, "clicked", _win_delete_request, game); 328 evas_object_smart_callback_add(bt, "clicked", _win_delete_request, game);
329 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0); 329 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
330 evas_object_show(bt); 330 evas_object_show(bt);
@@ -333,7 +333,7 @@ _win_new(Game *game)
333 fr = elm_frame_add(win); 333 fr = elm_frame_add(win);
334 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 334 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
335 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 335 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
336 elm_frame_label_set(fr, "Board size:"); 336 elm_object_text_set(fr, "Board size:");
337 elm_box_pack_end(bxctl, fr); 337 elm_box_pack_end(bxctl, fr);
338 evas_object_show(fr); 338 evas_object_show(fr);
339 339
@@ -353,12 +353,12 @@ _win_new(Game *game)
353 fr = elm_frame_add(win); 353 fr = elm_frame_add(win);
354 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 354 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
355 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 355 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
356 elm_frame_label_set(fr, "Time:"); 356 elm_object_text_set(fr, "Time:");
357 elm_box_pack_end(bxctl, fr); 357 elm_box_pack_end(bxctl, fr);
358 evas_object_show(fr); 358 evas_object_show(fr);
359 359
360 game->time_lb = lb = elm_label_add(win); 360 game->time_lb = lb = elm_label_add(win);
361 elm_label_label_set(lb, "0 s"); 361 elm_object_text_set(lb, "0 s");
362 evas_object_size_hint_weight_set(lb, 0.0, 0.0); 362 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
363 evas_object_size_hint_align_set(lb, 1, 0.5); 363 evas_object_size_hint_align_set(lb, 1, 0.5);
364 elm_frame_content_set(fr, lb); 364 elm_frame_content_set(fr, lb);
@@ -367,12 +367,12 @@ _win_new(Game *game)
367 fr = elm_frame_add(win); 367 fr = elm_frame_add(win);
368 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 368 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
369 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 369 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
370 elm_frame_label_set(fr, "Attempts:"); 370 elm_object_text_set(fr, "Attempts:");
371 elm_box_pack_end(bxctl, fr); 371 elm_box_pack_end(bxctl, fr);
372 evas_object_show(fr); 372 evas_object_show(fr);
373 373
374 game->attempts_lb = lb = elm_label_add(win); 374 game->attempts_lb = lb = elm_label_add(win);
375 elm_label_label_set(lb, "0"); 375 elm_object_text_set(lb, "0");
376 evas_object_size_hint_weight_set(lb, 0.0, 0.0); 376 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
377 evas_object_size_hint_align_set(lb, 1, 0.5); 377 evas_object_size_hint_align_set(lb, 1, 0.5);
378 elm_frame_content_set(fr, lb); 378 elm_frame_content_set(fr, lb);
@@ -381,12 +381,12 @@ _win_new(Game *game)
381 fr = elm_frame_add(win); 381 fr = elm_frame_add(win);
382 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 382 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
383 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 383 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
384 elm_frame_label_set(fr, "Found:"); 384 elm_object_text_set(fr, "Found:");
385 elm_box_pack_end(bxctl, fr); 385 elm_box_pack_end(bxctl, fr);
386 evas_object_show(fr); 386 evas_object_show(fr);
387 387
388 game->found_lb = lb = elm_label_add(win); 388 game->found_lb = lb = elm_label_add(win);
389 elm_label_label_set(lb, "0"); 389 elm_object_text_set(lb, "0");
390 evas_object_size_hint_weight_set(lb, 0.0, 0.0); 390 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
391 evas_object_size_hint_align_set(lb, 1, 0.5); 391 evas_object_size_hint_align_set(lb, 1, 0.5);
392 elm_frame_content_set(fr, lb); 392 elm_frame_content_set(fr, lb);
@@ -406,7 +406,7 @@ _win_new(Game *game)
406 elm_box_pack_end(bx, lb); 406 elm_box_pack_end(bx, lb);
407 407
408 bt = elm_button_add(win); 408 bt = elm_button_add(win);
409 elm_button_label_set(bt, "Yay!"); 409 elm_object_text_set(bt, "Yay!");
410 evas_object_smart_callback_add(bt, "clicked", _won_ok, game); 410 evas_object_smart_callback_add(bt, "clicked", _won_ok, game);
411 evas_object_size_hint_align_set(bt, 0.5, 0.5); 411 evas_object_size_hint_align_set(bt, 0.5, 0.5);
412 evas_object_show(bt); 412 evas_object_show(bt);