[gtk+] widget-factory: Add a pulsing progress bar
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget-factory: Add a pulsing progress bar
- Date: Mon, 4 Nov 2013 17:23:11 +0000 (UTC)
commit 3e9b58efe629dde63fefb0c3b1c7d328ea7ddde2
Author: William Jon McCann <william jon mccann gmail com>
Date: Sat Nov 2 16:13:33 2013 -0400
widget-factory: Add a pulsing progress bar
demos/widget-factory/widget-factory.c | 10 ++++++++++
demos/widget-factory/widget-factory.ui | 13 +++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index f04a2c3..1dd75a4 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -107,6 +107,13 @@ dismiss (GtkWidget *button)
gtk_revealer_set_reveal_child (GTK_REVEALER (w), FALSE);
}
+static gboolean
+pulse_it (GtkWidget *widget)
+{
+ gtk_progress_bar_pulse (GTK_PROGRESS_BAR (widget));
+ return TRUE;
+}
+
int
main (int argc, char *argv[])
{
@@ -128,6 +135,9 @@ main (int argc, char *argv[])
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL);
+ widget = (GtkWidget*) gtk_builder_get_object (builder, "progressbar3");
+ g_timeout_add (250, (GSourceFunc)pulse_it, widget);
+
widget = (GtkWidget*) gtk_builder_get_object (builder, "darkmenuitem");
g_signal_connect (widget, "toggled", G_CALLBACK (dark_toggled), NULL);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), dark);
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index b7a1e9a..3360b4f 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -1271,6 +1271,19 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkProgressBar" id="progressbar3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="fraction">0.5</property>
+ <property name="show_text">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]