From: Jens P. <pet...@re...> - 2003-01-21 05:17:48
|
Nick Name <nic...@in...> writes: > On Mon, 20 Jan 2003 09:44:03 +0000 > Axel Simon <A....@uk...> wrote: > > > I think we (the developers) are lucky here because Gdk/Gtk doesn't > > seem to > > have scaling functions!? Hm, seriously, I don't know. I can't seem to > > find anything about scaling in the GdkRGB or the different Pixbuf, > > Bitmaps and Image classes. Gtk has so called icon factories which > > contain one icon in different sizes, in case that's what you're > > looking for. > > http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/index.html Indeed, I was just about to post a pointer to gdk-pixbuf-scaling.html! > Where should I start to write bindings for this API? I've already done > stuff like this but in ocaml. I guess that I have to read the c2hs > manual, but after that, are there things that I still won't know about > the gtk2hs binding? Great, you want to add a binding to gdk-pixbuf! If you already have experience of doing this kind of thing in ocaml then i don't think it should be too hard for you. It's really quite simple, I would just start by comparing the .chs and .hs files with the corresponding .h file and pretty soon I think you'll have the hang of it... > Can you describe the process of adding bindings to gtk2hs in some howto > or tutorial, if this is not too expensive for your free time? I mean > regarding to "what makefile I should modify" or "what initialization > functions are to be modified to add the initialization function of my > new binding". I think you could just add the module(s) to be exported to "gtk/general/Gtk.hs" ("gtk/typehier/hierarchy.list" already lists GdkPixbuf). Though depending on the size of the binding it may eventually of course be better to separate it into a separate library, but currently libgtk2hs already a few bindings to gdk functions for example. Jens |