mirror of
https://github.com/brl/mutter.git
synced 2024-12-31 23:12:14 +00:00
bin-layout: Add a text to the test
We have a rectangle, a cairo texture and a texture. Let's go add a text actor as well.
This commit is contained in:
parent
315965290b
commit
e7381c47fd
@ -218,7 +218,6 @@ test_bin_layout_main (int argc, char *argv[])
|
|||||||
action = clutter_click_action_new ();
|
action = clutter_click_action_new ();
|
||||||
clutter_actor_add_action (rect, action);
|
clutter_actor_add_action (rect, action);
|
||||||
g_signal_connect (action, "clicked", G_CALLBACK (on_rect_clicked), box);
|
g_signal_connect (action, "clicked", G_CALLBACK (on_rect_clicked), box);
|
||||||
|
|
||||||
g_signal_connect (box,
|
g_signal_connect (box,
|
||||||
"enter-event", G_CALLBACK (on_box_enter),
|
"enter-event", G_CALLBACK (on_box_enter),
|
||||||
rect);
|
rect);
|
||||||
@ -226,6 +225,15 @@ test_bin_layout_main (int argc, char *argv[])
|
|||||||
"leave-event", G_CALLBACK (on_box_leave),
|
"leave-event", G_CALLBACK (on_box_leave),
|
||||||
rect);
|
rect);
|
||||||
|
|
||||||
|
rect = clutter_text_new ();
|
||||||
|
clutter_text_set_text (CLUTTER_TEXT (rect), "A simple test");
|
||||||
|
clutter_container_add_actor (CLUTTER_CONTAINER (box), rect);
|
||||||
|
clutter_bin_layout_set_alignment (CLUTTER_BIN_LAYOUT (layout), rect,
|
||||||
|
CLUTTER_BIN_ALIGNMENT_CENTER,
|
||||||
|
CLUTTER_BIN_ALIGNMENT_START);
|
||||||
|
clutter_actor_raise_top (rect);
|
||||||
|
clutter_actor_set_name (rect, "text");
|
||||||
|
|
||||||
clutter_actor_show_all (stage);
|
clutter_actor_show_all (stage);
|
||||||
|
|
||||||
clutter_main ();
|
clutter_main ();
|
||||||
|
Loading…
Reference in New Issue
Block a user