From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8149 invoked by alias); 3 Nov 2002 15:03:59 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 8111 invoked from network); 3 Nov 2002 15:03:58 -0000 Received: from unknown (HELO mail.dokom.net) (195.253.8.218) by sources.redhat.com with SMTP; 3 Nov 2002 15:03:58 -0000 Received: from dialin.speedway42.dip72.dokom.de ([195.138.42.72] helo=zagadka.ping.de ident=qmailr) by mail.dokom.net with smtp (Exim 3.32 #2) id 188MIv-0001Tn-00 for guile-gtk@sources.redhat.com; Sun, 03 Nov 2002 16:04:45 +0100 Received: (qmail 1686 invoked by uid 1000); 3 Nov 2002 15:04:04 -0000 To: Stanislas Pinte Cc: guile-gtk , David Pirotte Subject: Re: implementing guile-gtk drag & drop... References: <3DC279A4.1010000@wanadoo.be> From: Marius Vollmer Date: Sun, 03 Nov 2002 07:03:00 -0000 In-Reply-To: <3DC279A4.1010000@wanadoo.be> Message-ID: <87d6pmd7a3.fsf@zagadka.ping.de> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-q4/txt/msg00002.txt.bz2 Stanislas Pinte writes: > -I need to define new strucs, used by GTK: GtkTargetEntry; for example. > > How do I define a new struct? define-struct is not that > documented, and I suppose I will have to play with C (I looked at the > GTimer struct, define in gdk-1.2-defs), to define creator and > destructor functions, Hmm, that's a difficult thing, in general. I'd say that you should probably first decide how you would like the function to appear in Scheme. I.e., what would be convenient to use, in contrast to what is currently easily done with guile-gtk. Then, try to write a wrapper function by hand (based on examples from gtk-glue.c, for example), and then we can discuss whether it is useful to extend build-guile-gtk to make writing your wrapper function easier. For example, since GtkTargetEntry seems only to be used as a read-only struct when passing parameters to gtk_drag_source_set, it might be best to use a list in Scheme: (gtk-drag-source-set widget '(button1-mask) '((foo (same-app))) '(default)) We could then write a function to fill a GtkTargetEntry struct from '(foo (same-app)) and tell build-guile-gtk to use it. (I don't know the details right now.) The .defs file entry might then look like (define-func gtk_drag_source_set none ((GtkWidget widget) (GdkModifierType start_button_mask) ((cvecr GtkTargetEntry) targets) (GdkDragAction actions))) -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405