Re: GtkActionEntry doesn't allow closures?



On Sat, 2007-05-26 at 18:57 -0700, Jason Hickey wrote:
> I am developing a GTK+ binding for OMake (http://omake.metaprl.org).   
> OMake has a functional language, so it has closures, etc.
> 

> Am I missing something, or is it not possible to deal with closures  
> in GtkActionEntry?

GtkActionEntry is a convenience API for adding many actions to a
GtkActionGroup without manually creating each object yourself; there's
nothing that prevents you language bindings to reimplement this
functionality.

in this particular case, the data passed to the callback is the one you
pass to gtk_action_group_add_actions():

  void gtk_action_group_add_actions (GtkActionGroup       *action_group,
                                     const GtkActionEntry *entries,
                                     guint                 n_entries,
                                     gpointer              user_data);


you might want to replace GtkActionEntry with something that makes sense
in your language; in the Perl bindings, for instance, a GtkActionEntry
doesn't exist - it's either an hash reference or an array reference,
containing the same fields as the C structure.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,  E: ebassi gmail com
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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