2 ; module illustrating how to add your own menus to gwave
5 (define-module (app gwave extra-menus)
7 :use-module (gnome gtk)
8 :use-module (app gwave cmds)
9 :use-module (app gwave std-menus)
13 (read-enable 'positions)
15 (dbprint "extra-menus.scm running\n")
17 ; demonstrating how we can add our own menu to the end
18 ; of the menubar by using append-hook.
19 ; this adds some debugging options.
23 ; (display "in new-wavewin-hook") (newline)
24 (let* ((mbar (get-wavewin-menubar))
25 (menu (menu-create mbar "Debug")))
26 (add-menuitem menu "my menu" #f)
27 (add-menuitem menu "garbage collect" gc)
29 (add-menuitem menu "list panels"
31 (display "panel-list:") (newline)
32 (for-each (lambda (wp)
34 (if (wavepanel-selected? wp)
35 (display "[selected]"))
40 (add-menuitem menu "list visiblewaves"
42 (for-each (lambda (wp)
43 (display "wp:") (display wp) (newline)
44 (for-each (lambda (vw)
45 (display vw)(newline))
46 (wavepanel-visiblewaves wp)))
47 (wtable-wavepanels))))
49 (add-menuitem menu "list files"
51 (display "wavefile-list:") (newline)
52 (display (wavefile-list))
60 ; (display "in extra-menus new-wavelist-hook for") (display df) (newline)
61 (let* ((mbar (wavefile-listwin-menubar df))
62 (menu (menu-create mbar "Debug")))
63 (add-menuitem menu "List Variables"
65 (display (wavefile-all-variables df))
68 (add-menuitem menu "List Sweeps"
70 (format #t "~s sweeps:\n" (wavefile-nsweeps df))
71 (display (wavefile-sweeps df)) (newline)
73 (format #t " ~s = ~s\n" (car s) (cdr s)))
77 (add-menuitem menu #f #f)
80 (dbprint "extra-menus.scm done\n")