public inbox for
 help / color / mirror / Atom feed
From: Stephen Tell <>
To: Marius Vollmer <>
Cc: Guile-Gtk List <>
Subject: Re: Converting GdkEvent from C to Guile
Date: Thu, 18 Nov 1999 15:50:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 18 Nov 1999, Marius Vollmer wrote:

>     GdkEvent *ev;
>     SCM val;
>     extern sgtk_boxed_info sgtk_gdk_event_info;
>     val = sgtk_boxed2scm (ev, &sgtk_gdk_event_info, copyp);

Thanks, this works.
> COPYP determines whether sgtk_boxed2scm will amke a copy of EV or not.
> If you want guile-gtk to become owner of the GdkEvent structure
> pointed to by EV (i.e guile-gtk can free it whenever it likes, using
> gdk_event_free) you would use FALSE for COPYP.  When you want to stay
> the owner of EV, say TRUE.  You should only say FALSE when EV is the
> result of gdk_event_copy, as a rule.
Just to make sure I understand Gdk's (undocumented) rules: when I get the
GdkEvent as an argument to a handler set with gtk_signal_connect(),
Gdk/Gtk is going to free the event when the handler returns.  So if I let
it escape to the guile-gtk world, I set COPYP to TRUE, so guile frees its
copy when it is done with it.

(Actually, I'd rather not pass the event up at all, but if the guile side
wants to pop up a menu on the event, gtk-menu-popup needs the event's time
for some reason.)


Steve Tell | | | KF4ZPF
Research Associate, Microelectronic Systems Laboratory
Computer Science Department, UNC@Chapel Hill.   W:919-962-1845

  reply	other threads:[~1999-11-18 15:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-07 15:47 guile-gtk without dlopen (HP-UX) Stephen Tell
1999-11-08 13:27 ` Marius Vollmer
1999-11-08 19:08   ` Stephen Tell
1999-11-18 13:05 ` Converting GdkEvent from C to Guile Stephen Tell
1999-11-18 15:14   ` Marius Vollmer
1999-11-18 15:50     ` Stephen Tell [this message]
1999-11-19 13:51       ` Marius Vollmer

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* 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).