-
- ;;FIXME
- (let ((location (hashq-ref (item-locations global-go) item #f)))
-
- (if location
- (location-callback location)
- (stderr "no location\n"))))
- ((2button-press) (gobject-set-property item 'fill-color "red")))
+ (let ((button (gdk-event-button:button event)))
+ (cond
+ ((= button 1)
+ (and-let* ((grob (hashq-ref (item-grobs go) item #f))
+ (location (get-location grob)))
+ (location-callback location)))
+ ((= button 2)
+
+ (and-let*
+ ((grob (hashq-ref (item-grobs go) item #f)))
+
+ (let ((properties (ly:grob-properties grob))
+ (basic-properties (ly:grob-basic-properties grob))
+ (x (inexact->exact (gdk-event-button:x-root event)))
+ (y (inexact->exact (gdk-event-button:y-root event))))
+
+ (debugf "GROB: ~S\n" grob)
+ (debugf "PROPERTIES: ~S\n" properties)
+ (debugf "BASIC PROPERTIES: ~S\n" basic-properties)
+
+ (let ((window (make <gtk-window>))
+ (vbox (make <gtk-vbox>))
+ (button (make <gtk-button> #:label "Ok")))
+
+ (add window vbox)
+ (connect button 'clicked (lambda (b) (destroy window)))
+
+ (for-each
+ (lambda (x)
+ (let ((button (make <gtk-button>
+ #:xalign 0.0
+ #:label
+ (string-append
+ (symbol->string (car x))
+ ": "
+ (format #f "~S" (cdr x))))))
+ (set-size-request button 150 BUTTON-HEIGHT)
+ (add vbox button)))
+ properties)
+ (add vbox button)
+
+ ;; FIXME: how to do window placement?
+ ;; - no effect:
+ (move window x y)
+ (show-all window)
+ ;; - shows actual movement:
+ (move window x y)
+ )))))))
+
+ ((2button-press) (gobject-set-property item 'fill-color "green")))