summaryrefslogtreecommitdiff
path: root/browser-plugin/test-glow-button.c
blob: d97dda868bcb6deb564265204deba6f716166335 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

#include <gtk/gtk.h>
#include "totem-glow-button.h"

#if 1
static gboolean
idle_cb (gpointer data)
{
	TotemGlowButton *button = data;

	g_message ("launching the glow");
	totem_glow_button_set_glow (button, TRUE);

	return FALSE;
}
#endif
#if 1
static gboolean
idle_un_cb (gpointer data)
{
	TotemGlowButton *button = data;

	g_message ("stopping the glow");
	totem_glow_button_set_glow (button, FALSE);

	return FALSE;
}
#endif
int main (int argc, char **argv)
{
	GtkWidget *window, *button, *image;

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	button = totem_glow_button_new ();
	image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU);
	gtk_button_set_image (GTK_BUTTON (button), image);
#if 0
	gtk_button_set_label (GTK_BUTTON (button), GTK_STOCK_MEDIA_PLAY);
	gtk_button_set_use_stock (GTK_BUTTON (button), TRUE);
#endif
	gtk_container_add (GTK_CONTAINER(window), button);

	totem_glow_button_set_glow (TOTEM_GLOW_BUTTON (button), TRUE);

	g_timeout_add_seconds (3, idle_cb, button);
	g_timeout_add_seconds (5, idle_un_cb, button);

	gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);

	gtk_widget_show_all (window);

	gtk_main ();

	return 0;
}