[CM] Re: Re: Play Head (SND-8.3)

Bill Schottstaedt bil@ccrma.Stanford.EDU
Sun, 13 Aug 2006 04:28:27 -0700


> Anyone knows how to do this with gtk, if possible? 

;; report on mouse scroll wheel changes when in the channel graph
(g_signal_connect 
 (car (channel-widgets)) "scroll_event" 
 (lambda (w e i)
   (snd-print (format #f "~%state: ~A, x: ~A, y: ~A, direction: ~A" 
                      (.state (GDK_EVENT_SCROLL e))
                      (.x (GDK_EVENT_SCROLL e))
                      (.y (GDK_EVENT_SCROLL e))
                      (.direction (GDK_EVENT_SCROLL e))))
   #f))

;; report which kind of click was received in the channel graph
(g_signal_connect 
 (car (channel-widgets)) "button_press_event"
 (lambda (w e i)
   (snd-print (format #f "~%button: ~A, ~A click" 
                      (.type (GDK_EVENT_BUTTON e))
                      (if (= (.type (GDK_EVENT_BUTTON e)) GDK_BUTTON_PRESS)
                          "single"
                          (if (= (.type (GDK_EVENT_BUTTON e)) GDK_2BUTTON_PRESS)
                              "double"
                              (if (= (.type (GDK_EVENT_BUTTON e)) GDK_3BUTTON_PRESS)
                                  "triple"
                                  "unknown")))))
   #f))

;; a double click is reported as single/single/double

;; double-click time in milliseconds(?)
(define (double-click-time)
  (g_object_get (GPOINTER (gtk_settings_get_for_screen 
                                            (gdk_display_get_default_screen 
                                              (gdk_display_get_default))))
                        "gtk-double-click-time" #f))