-
Notifications
You must be signed in to change notification settings - Fork 0
/
fst.c
31 lines (28 loc) · 983 Bytes
/
fst.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <clutter/clutter.h>
static void
on_press_key (ClutterActor * rect, gpointer data)
{
clutter_actor_hide (data);
}
int
main (int argc, char ** argv)
{
if (clutter_init (&argc, &argv) !=
CLUTTER_INIT_SUCCESS))
return 1;
ClutterActor * stage = clutter_actor_new ();
ClutterActor * rect = clutter_actor_new ();
clutter_actor_set_size (stage, 400, 400);
clutter_actor_set_size (rect, 100, 100);
clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black);
clutter_actor_set_background_color (rect, CLUTTER_COLOR_Blue);
clutter_actor_add_child (stage, rect);
g_signal_connect (stage, "destroy",
G_CALLBACK (clutter_main_quit), NULL);
g_signal_connect_swapped (rect, "button-press-event",
G_CALLBACK (on_press_key), (gpointer ) rect);
clutter_actor_set_reactive (rect, TRUE);
clutter_actor_show_all (stage);
clutter_main ();
return 0;
}