Simple menu example - append throws error

Patricio Paez <[email protected]> Sat, 20 Aug 2016 14:39:14 -0500
Newsgroups gmane.lisp.guile.gtk
Message-ID <[email protected]>
Hello,

I am learning how to create a menu in Scheme with guile-gnome,
from this example, which throws an error as is:

https://github.com/yang-qu/gtk-tutorial-using-guile-gnome/blob/master/menus_toolbars/simple_menu.scm

---- simple_menu.scm ----
(use-modules (gnome-2)
	     (oop goops)
	     (gnome gobject)
	     (gnome gtk))

(define (simple-menu)
  (let ((window (make <gtk-window> #:type 'toplevel))
	(vbox (make <gtk-vbox> #:homogeneous #f #:spacing 0))
	(menubar (make <gtk-menu-bar>))
	(filemenu (make <gtk-menu>))
	(file (make <gtk-menu-item> #:label "File"))
	(quit (make <gtk-menu-item> #:label "Quit")))

    (set-title window "menu")
    (set-default-size window 240 200)
    (set-position window 'center)

    (add window vbox)

    (set-submenu file filemenu)
    (append filemenu quit)
    (append menubar file)
    (pack-start vbox menubar #f #f 3)

    (connect window 'destroy (lambda (w) (gtk-main-quit)))
    (connect quit 'activate (lambda (w) (gtk-main-quit)))

    (show-all window)))

(simple-menu)
(gtk-main)
---- simple_menu.scm ----

This is the command line, and the error is listed below:

LD_LIBRARY_PATH=/usr/lib/guile-gnome-2 guile -L /usr/share/guile-gnome-2 simple_menu.scm

Backtrace:
In ice-9/boot-9.scm:
157: 9 [catch #t #<catch-closure 8c5af60> ...]
In unknown file:
?: 8 [apply-smob/1 #<catch-closure 8c5af60>]
In ice-9/boot-9.scm:
63: 7 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
432: 6 [eval # #]
In ice-9/boot-9.scm:
2401: 5 [save-module-excursion #<procedure 8c68c60 at ice-9/boot-9.scm:4045:3 ()>]
4052: 4 [#<procedure 8c68c60 at ice-9/boot-9.scm:4045:3 ()>]
In unknown file:
?: 3 [load-compiled/vm "/home/pp/.cache/guile/ccache/2.0-LE-4-2.0/home/pp/learn-guile-gnome/simple_menu.scm.go"]
In /home/pp/learn-guile-gnome/simple_menu.scm:
32: 2 [#<procedure 8c73c70 ()>]
22: 1 [simple-menu]
In unknown file:
?: 0 [append #<<gtk-menu> 9049940> #<<gtk-menu-item> 90700b0>]

ERROR: In procedure append:
ERROR: In procedure append: Wrong type argument in position 1 (expecting empty list): #<<gtk-menu> 9049940>

The second append line fails with the same error above.  Replacing
both lines with gtk-menu-shell-append solves the issue and the demo runs fine:

    (gtk-menu-shell-append filemenu quit)
    ;(append filemenu quit)
    (gtk-menu-shell-append menubar file)
    ;(append menubar file)

I searched for the error but could not find information.  The tests
were done using Debian testing, these are the versions of Guile and
GTk:

pp@mc:~/learn-guile-gnome$ dpkg -l '*guile*' | grep ii
ii  guile-2.0           2.0.11+1-12  i386         GNU extension language and Scheme interpreter
ii  guile-2.0-dev       2.0.11+1-12  i386         Development files for Guile 2.0
ii  guile-2.0-doc       2.0.11+1-12  all          Documentation for Guile 2.0
ii  guile-2.0-libs:i386 2.0.11+1-12  i386         Core Guile libraries
ii  guile-cairo         1.4.0-3.1    i386         Guile bindings for Cairo
ii  guile-cairo-dev     1.4.0-3.1    i386         Guile bindings for Cairo, development files
ii  guile-g-wrap        1.9.15-0.1   i386         scripting interface generator for C - Guile runtime
ii  guile-gnome2-dev    2.16.2-2     i386         Guile GObject binding support library, development files
ii  guile-gnome2-glib   2.16.2-2     i386         Guile bindings for GLib
ii  guile-gnome2-gtk    2.16.2-2     i386         Guile bindings for GTK+, libglade, Pango and ATK
ii  guile-library       0.2.2-0.2    all          Library of useful Guile modules

pp@mc:~/learn-guile-gnome$ dpkg -l '*gtk2*' | grep ii
ii  libgtk2.0-0:i386               2.24.30-4    i386         GTK+ graphical user interface library
ii  libgtk2.0-bin                  2.24.30-4    i386         programs for the GTK+ graphical user interface library
ii  libgtk2.0-common               2.24.30-4    all          common files for the GTK+ graphical user interface library
ii  libgtk2.0-dev                  2.24.30-4    i386         development files for the GTK+ library

Do you have any idea of why the append commands fail?  I could do more
tests if you give me the instructions.  The example is dated 2011, maybe
append is not supported anymore?
 
Regards,
Patricio