tests: Add instructions to test-box-layout
This commit is contained in:
parent
568ad044eb
commit
b69ee0989b
@ -23,6 +23,12 @@
|
|||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
|
#define INSTRUCTIONS \
|
||||||
|
"Press v\t\342\236\236\tSwitch horizontal/vertical\n" \
|
||||||
|
"Press p\t\342\236\236\tSwitch pack start/end\n" \
|
||||||
|
"Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \
|
||||||
|
"Press q\t\342\236\236\tQuit"
|
||||||
|
|
||||||
static ClutterActor *hover_actor = NULL;
|
static ClutterActor *hover_actor = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -151,6 +157,10 @@ key_release_cb (ClutterActor *actor,
|
|||||||
add_actor (layout);
|
add_actor (layout);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CLUTTER_q:
|
||||||
|
clutter_main_quit ();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -173,7 +183,7 @@ stage_size_changed_cb (ClutterActor *stage,
|
|||||||
G_MODULE_EXPORT int
|
G_MODULE_EXPORT int
|
||||||
test_box_layout_main (int argc, char *argv[])
|
test_box_layout_main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
ClutterActor *stage, *box;
|
ClutterActor *stage, *box, *label;
|
||||||
ClutterLayoutManager *layout;
|
ClutterLayoutManager *layout;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
@ -199,6 +209,11 @@ test_box_layout_main (int argc, char *argv[])
|
|||||||
G_CALLBACK (stage_size_changed_cb),
|
G_CALLBACK (stage_size_changed_cb),
|
||||||
box);
|
box);
|
||||||
|
|
||||||
|
label = clutter_text_new_with_text ("Sans 12px", INSTRUCTIONS);
|
||||||
|
clutter_container_add_actor (CLUTTER_CONTAINER (stage), label);
|
||||||
|
clutter_actor_set_y (label,
|
||||||
|
480 - clutter_actor_get_height (label) - 8);
|
||||||
|
|
||||||
clutter_actor_show (stage);
|
clutter_actor_show (stage);
|
||||||
|
|
||||||
clutter_main ();
|
clutter_main ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user