Simplification for ruby-gnome2 in general: the use of symbols rather than Gtk:: Enum Structures?


#1

Hi,

I was looking at old ruby-gnome code that I have here
and see stuff like this:

notebook = Gtk::Notebook.new
notebook.set_tab_pos(Gtk::POS_LEFT)

However, it occurred to me that knowing Gtk::POS_LEFT
seems superfluous.

We are using Ruby, not a lower level language here, so
I was thinking, this could be this:

notebook.set_tab_pos(:left)

And internally get mapped to Gtk::POS_LEFT right?

Now I don’t know if this would be good or bad, so I
am just making it as a suggestion - perhaps noone
was thinking about it so far.

I understand that the C API is the main target,
but I wonder if we could use additional constructs
to make the code more ruby-like (just as we
have methods such as set_foo() and also foo= )