From: Marius Vollmer <mvo@zagadka.ping.de>
To: Brett Viren <bviren@superk.physics.sunysb.edu>
Cc: guile-gtk@sourceware.cygnus.com
Subject: Re: Access a GtkWidget in C from guile?
Date: Sat, 24 Jun 2000 15:44:00 -0000 [thread overview]
Message-ID: <87n1ka1yzh.fsf@zagadka.ping.de> (raw)
In-Reply-To: <14649.32585.297873.456090@bamboo.physics.sunysb.edu>
Brett Viren <bviren@superk.physics.sunysb.edu> writes:
> - Now comes the problem: In scheme I need to do something like:
>
> (use-modules (my app)
> (gnome gnome)
> (gtk gtk)
> (gtk gdk))
> ;; ...
>
> (let ((window (gtk-window-new 'toplevel))
> (mad (init-my-app-data some args)))
> (gtk-container-add window (give-me-a-canvas mad))
> ...)
>
> Where `(give-me-a-canvas mad)' needs to return a guile-ified version
> of my C-land GnomeCanvas.
The easiest would be to write a C function
#include <guile-gtk.h>
SCM
give_me_a_canvas (SCM scm_mad)
{
my_app_data *mad = GET_STRUCT_FROM_SMOB (scm_mad);
return sgtk_wrap_gtkobj (mad->canvas);
}
and export it to Scheme. Note `sgtk_wrap_gtkobj' which is probably
the interesting thing here.
prev parent reply other threads:[~2000-06-24 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-03 15:27 Brett Viren
2000-06-24 15:44 ` Marius Vollmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87n1ka1yzh.fsf@zagadka.ping.de \
--to=mvo@zagadka.ping.de \
--cc=bviren@superk.physics.sunysb.edu \
--cc=guile-gtk@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).