aboutsummaryrefslogtreecommitdiff
path: root/src/play-button.c
diff options
context:
space:
mode:
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)
{