aboutsummaryrefslogtreecommitdiff
path: root/src/play-button.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-07-08 16:12:59 +0100
committerConor Curran <conor.curran@canonical.com>2010-07-08 16:12:59 +0100
commite4f900efd1e48814a70e4351cc3d878312daef37 (patch)
treecbedf03dba7641079e1f7aa68b4c325a6d5044b3 /src/play-button.c
parent41747b032d2032c97fd7f1766157e2d846626880 (diff)
downloadayatana-indicator-sound-e4f900efd1e48814a70e4351cc3d878312daef37.tar.gz
ayatana-indicator-sound-e4f900efd1e48814a70e4351cc3d878312daef37.tar.bz2
ayatana-indicator-sound-e4f900efd1e48814a70e4351cc3d878312daef37.zip
event handling now plugged in crudely
Diffstat (limited to 'src/play-button.c')
-rw-r--r--src/play-button.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/play-button.c b/src/play-button.c
index 136f25d..afb46d8 100644
--- a/src/play-button.c
+++ b/src/play-button.c
@@ -349,6 +349,29 @@ play_button_expose (GtkWidget *button, GdkEventExpose *event)
}
+gint
+determine_button_event(GtkWidget* button, GdkEventButton* event)
+{
+ g_debug("event x coordinate = %f", event->x);
+ g_debug("event y coordinate = %f", event->y);
+ gint result = 0;
+ // For now very simple rectangular collision detection
+ if(event->x > 40 && event->x < 80
+ && event->y > 22 && event->y < 46){
+ result = 1;
+ }
+ else if(event->x > 86 && event->x < 118
+ && event->y > 20 && event->y < 47){
+ result = 2;
+ }
+ else if(event->x > 122 && event->x < 164
+ && event->y > 22 && event->y < 46){
+ result = 3;
+ }
+
+ return result;
+}
+
void
play_button_set_style(GtkWidget* button, GtkStyle* style)
{