2 * Copyright (C) 2007 Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
23 value_changed (GtkWidget
*button
,
27 g_message ("volume changed to %f", volume
);
31 response_cb (GtkDialog
*dialog
,
35 gtk_widget_destroy (GTK_WIDGET (dialog
));
39 show_error (gpointer data
)
41 GtkWindow
*window
= (GtkWindow
*) data
;
44 g_message ("showing error");
46 dialog
= gtk_message_dialog_new (window
,
50 "This should have unbroken the grab");
51 g_signal_connect (G_OBJECT (dialog
),
53 G_CALLBACK (response_cb
), NULL
);
54 gtk_widget_show (dialog
);
59 int main (int argc
, char **argv
)
66 gtk_init (&argc
, &argv
);
68 window
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
69 button
= gtk_volume_button_new ();
70 button2
= gtk_volume_button_new ();
71 box
= gtk_hbox_new (FALSE
, 0);
73 g_signal_connect (G_OBJECT (button
),
75 G_CALLBACK (value_changed
), NULL
);
76 gtk_container_add (GTK_CONTAINER (window
), box
);
77 gtk_container_add (GTK_CONTAINER (box
), button
);
78 gtk_container_add (GTK_CONTAINER (box
), button2
);
80 gtk_widget_show_all (window
);
81 gtk_button_clicked (GTK_BUTTON (button
));
82 g_timeout_add (4000, (GSourceFunc
) show_error
, window
);