[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] easyFFI and GTK
From: |
William Ramsay |
Subject: |
[Chicken-users] easyFFI and GTK |
Date: |
Sat, 07 Apr 2007 10:11:08 -0400 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070221) |
Hi,
I'm trying to create a menu with Gtk. Everything seems to be working
fine, but I can't seem to figure out how to use "menu-append".
My code looks like this:
(define create-menu-item
(lambda (menu text cmd image)
(let
((item #f))
(if image
(let
((source (sprintf "icons/~A.png" image)))
(set! item (gtk_image_menu_item_new_with_label
(sutils-get-text text)))
(gtk_image_menu_item_set_image item source))
(set! item (gtk_image_menu_item_new_with_label(sutils-get-text
text))))
(if (not (= cmd NO_ACTION))
(g_signal_connect window "button_press_event" #$cmd #f))
(foreign-code "gtk_menu_append(menu, item);")
#t)))
-- I'm fairly new to Scheme, so forgive my code if it doesn't meet
expectations --
Anyway, when I compile this it tells me "menu" and "item" are not
declared. What is the secret for getting this to work?
Thanks in advance. I think Chicken is the greatest and easyFFI is
beyond praise. You guys have done a fantastic job in creating
the perfect computing system!
Bill Ramsay
- [Chicken-users] easyFFI and GTK,
William Ramsay <=