aboutsummaryrefslogtreecommitdiff
path: root/src/transport-bar.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-09 12:13:59 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-09 12:13:59 +0100
commit664a45a398020f82f1e8f8e22f1627392a06a0c2 (patch)
tree43bd6bcccc4f5b63937ffcaa96c38b04bbd07623 /src/transport-bar.c
parent744083d4483291a87f4f348d6937257d8887cfb1 (diff)
downloadayatana-indicator-sound-664a45a398020f82f1e8f8e22f1627392a06a0c2.tar.gz
ayatana-indicator-sound-664a45a398020f82f1e8f8e22f1627392a06a0c2.tar.bz2
ayatana-indicator-sound-664a45a398020f82f1e8f8e22f1627392a06a0c2.zip
buttons added - events being received
Diffstat (limited to 'src/transport-bar.c')
-rw-r--r--src/transport-bar.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/transport-bar.c b/src/transport-bar.c
index 8573cae..34f590e 100644
--- a/src/transport-bar.c
+++ b/src/transport-bar.c
@@ -30,7 +30,7 @@ typedef struct _TransportBarPrivate TransportBarPrivate;
struct _TransportBarPrivate
{
- GtkWidget* hBox;
+ GtkWidget* hbox;
GtkWidget* previous_button;
GtkWidget* play_button;
GtkWidget* next_button;
@@ -43,7 +43,8 @@ static void transport_bar_class_init (TransportBarClass *klass);
static void transport_bar_init (TransportBar *self);
static void transport_bar_dispose (GObject *object);
static void transport_bar_finalize (GObject *object);
-G_DEFINE_TYPE (TransportBar, transport_bar, DBUSMENU_TYPE_MENUITEM);
+
+G_DEFINE_TYPE (TransportBar, transport_bar, GTK_TYPE_MENU_ITEM);
static void
transport_bar_class_init (TransportBarClass *klass)
@@ -54,29 +55,35 @@ transport_bar_class_init (TransportBarClass *klass)
object_class->dispose = transport_bar_dispose;
object_class->finalize = transport_bar_finalize;
-
- return;
}
static void
transport_bar_init (TransportBar *self)
{
- g_debug("Building new Transport Item");
- hBox = gtk_hbox_new(TRUE, 2));
- previous_button = gtk_button_new_with_label("Previous"));
- next_button = gtk_button_new_with_label("Next"));
- play_button = gtk_button_new_with_label("Play"));
- gtk_container_add((GtkContainer*) hBox, previous_button);
- gtk_container_add((GtkContainer*) hBox, next_button);
- gtk_container_add((GtkContainer*) hBox, play_button);
- return;
+ g_debug("TransportBar::transport_bar_init");
+
+ TransportBarPrivate * priv = TRANSPORT_BAR_GET_PRIVATE(self);
+ GtkWidget *hbox;
+
+ hbox = gtk_hbox_new(TRUE, 2);
+ priv->previous_button = gtk_button_new_with_label("Previous");
+ priv->next_button = gtk_button_new_with_label("Next");
+ priv->play_button = gtk_button_new_with_label("Play");
+
+ gtk_box_pack_start (GTK_BOX (hbox), priv->previous_button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), priv->play_button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), priv->next_button, FALSE, FALSE, 0);
+
+ priv->hbox = hbox;
+
+ gtk_widget_show_all (priv->hbox);
+ gtk_container_add (GTK_CONTAINER (self), hbox);
}
static void
transport_bar_dispose (GObject *object)
{
G_OBJECT_CLASS (transport_bar_parent_class)->dispose (object);
- return;
}
static void
@@ -85,9 +92,13 @@ transport_bar_finalize (GObject *object)
G_OBJECT_CLASS (transport_bar_parent_class)->finalize (object);
}
-TransportBar*
+/**
+ * transport_new:
+ * @returns: a new #TransportBar.
+ **/
+GtkWidget*
transport_bar_new()
{
- TransportBar *self = g_object_new(TRANSPORT_BAR_TYPE, NULL);
- return self;
+ return g_object_new(TRANSPORT_BAR_TYPE, NULL);
}
+