Re: Cooperating on .defs API specifications



On Tue, 2004-03-30 at 23:09, Xavier Ordoquy wrote:
> On Tue, 2004-03-30 at 22:27, Murray Cumming wrote:
> > 
> > The defs format does not split up the function name, I think. It just
> > says what the name is and what object it belongs to. So, I think there's
> > no problem there.
> 
> Here's an example of the use in pygtk:
> 
> (define-function accel_map_get
>   (c-name "gtk_accel_map_get")
>   (return-type "GtkAccelMap*")
> )

Strange, in our gtk_methods.defs, which I generated with your h2defs.py
yesterday, I have

(define-function gtk_accel_map_get
  (c-name "gtk_accel_map_get")
  (return-type "GtkAccelMap*")
)

By the way, that's a fairly unusual function:
GtkAccelMap *gtk_accel_map_get      (void);
Most others take a object instance as the first parameter.
 
> accel_map_get gets in the gtk module. Note that the function is called
> in Python with
>  gtk.accel_map_get
> instead of
>  gtk.gtk_accel_map_get

Strange. We would wrap that as 
Gtk::AccelGroup::get(), where get is a static method that can be called
like so:
  Gtk::AccelGroup::get();
instead of
  the_acccelgroup.get();

Maybe python has no equivalent of static (no instance required) class
methods.

-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com




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