guile-gtk-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Roadmap to 2.8 platform bindings


From: Andreas Rottmann
Subject: Re: Roadmap to 2.8 platform bindings
Date: Mon, 17 May 2004 19:48:16 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

"Patrick Bernaud" <address@hidden> writes:

> Hi all,
>
> Andy Wingo writes:
>  > [...]
>  >      I. I'll say it at the top while lurkers are still reading: we could
>  >         really use some help, especially working up some test cases.
>  >         There's the beginnings of guile-gtk-demo in the source tree, but
>  >         it only has a couple examples. Translate from C, or easier from
>  >         python, and just chuck the new examples in the demos/ directory.
>  >         Fun, instructive, easy, and good for guile-gnome.
>  > 
>
> Now that I succesfully built guile-gnome I think I can contribute to
> this translation of the demo from C to guile in order to learn more of
> the project and be able to use it my own.
>
> As a first try, I worked on one of these demo, namely the
> sizegroup. However I had some problems with how things work with
> guile-gnome :
>
>   - how the top part (not the action_area) of a GtkDialog can be
>     accessed? one of this dialog is used in this demo. Widgets had to
>     be added to this part through the vbox member of the object;
>
We probably need custom wrappers for the two fields of GtkDialog;
i.e. gtk_dialog_vbox() and gtk_dialog_action_area().

>   - what is the guile-gnome syntax to 'OR' flags (if possible at all)?
>     For example, how does the following C code translates to guile:
>     "GTK_FILL | GTK_EXPAND" (this code is used in the attach options);
>
See glib/test-suite/gobject.test; it would be something like 

(make <gtk-attach-options> #:value '(fill expand)).

>   - gtk_dialog_add_button() takes a const pointer on a string as
>     parameter 2 and a response id as parameter 3. How does this piece
>     of C translate to guile :
>       widget = gtk_dialog_add_button(
>                       dialog,
>                       GTK_STOCK_CLOSE,
>                       GTK_RESPONSE_NONE);
>     This one works fine but does not use the macros and flags:
>       (gtk-dialog-add-button dialog "gtk-close" -1)
>
>
Another good point: how are we supposed to wrap the GTK_STOCK_*
macros? I could imagine a function used like this: 

(gtk-stock-id 'close)

It's simple to implement, even:

(define (gtk-stock-id nick)
  (string-append "gtk-" (symbol->string nick)))

Thoughts?

Also note that you should definitly use generics in your code, so 

(gtk-dialog-add-button dialog "gtk-close" -1)

will become

(add-button dialog "gtk-close" -1)

Andy
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]