Hi,
On Mon, 10 Jul 2006 14:24:37 +0200
Laurent Julliard <laurent@...> wrote:
>
> I'm writting Ruby bindings for some GTK extensions where I need to use the GLib enum GDateWeekday declared in file glib-2.0/glib/gdate.h. What would be the proper way to
>
> a) Name the constants of the enum type: is it GLib::Weekday::Monday or is it GLib::Date::Weekday::Monday or something else
It should be GLib::DateWeekday::MONDAY.
> b) Although this is a GLIB enum can I still use the G_DEF_CONSTANTS macro to create the Ruby constants or is there a more appropriate approach?
In this case, you can't use G_DEF_CONSTANTS directly, because it is not
defined gtype, is it?
So you need to define gtype first, then use G_DEF_CONSTANTS.
Do grep _get_type *.c in glib/src. They help you.
BTW, if you just study how implement Ruby-GNOME2,
Ruby/GLib is not properly.
I recommand to implement GtkWidget and it's children because
they are easier to implement.
--
.:% Masao Mutoh<mutoh@...>
|