Whops, I didn’t see this discussion for some time. Better late than
never, eh?
- write code from scratch. It´s the better solution but it´s a slowly
process
It is rather slow, true. Maybe we could manage to build customized
objects,
which we could maintain as some kind of “community” bindings (if there
is a consensus). So that we can reuse existing components more easily
and
readily (and with nice docu as well. The current docu of ruby-gtk is
great, this is a huge advantage IMHO compared to the other ruby-GUI
bindings)
- The YAML files are very easy to understand and write the source code
by hand or from ruby serialization it´s perfect.
This sounds crazy???
I dont think this sounds crazy at all.
The glade people abuse XML to layout and describe the GUI so I believe
it is of EQUAL right to say that instead of XML we could use YAML.
However, this sounds like a great idea, that requires a lot of work
I am not discouraging anyone, but in my experience what starts with
great ideas, really often means that the work load will make it slow
down, and some slowed down projects will never happen.
The YAML files will be very complex. Just have a glance at the glade
file, if you want more control on the widget, you have to do the similar
thing as the glade file.
I think this argument does not hold because XML is hardly human
readable. So if one uses YAML, it cant really become that less human
readable.
XML tends to become crowded with close-tags and overlong lines. I think
the better way to layout a GUI is to describe it as pure as possible,
and as straight as possible. GTK even has its own way with rc_files and
then we also have web .css which I believe is the best model (because
many people will know it, and its easier to learn one thing, and apply
that on everything else)
Maintaining the source code and the user interface definition in
separate files makes things much easier to maintain. This is the
classic separation of business logic from presentation.
I actually challenge this notion. Yes, decoupling it is better than pure
html with fixed tags and so on, but an even better way is to
remain flexible AND generate html and css via ruby
I even use replacement hooks, ie RANDOM_BORDER_8PX translates to
“border: 8px groove darkblue” (as example, on every reload/reserving,
the
result would be different). The thing is that such a system leads to
more and
more complex applications while still being super easy to maintain, and
as flexible as needed to. If I want to use a pure template i can
use rbtenjin. Or i let ruby generate everything. Or I load some external
css files, use that, and hook up my own autogenerated css files as well.
But just so I am not misunderstood here:
I love the CSS model. I think it is very close to how the human brain
thinks. It could be better, yes, but I think it is very solid.
Example what i like:
.x {border:1px solid black; font-weight:500}
test
But I dont like XML that much, it gets too crowded IMHO.
Perhaps if we knew the details of your problem we could suggest
a simpler solution.
I think the simplest solution is to not use Glade.
But this is just my opinion of course, use what makes you happy and
your life easier.
I see GTK as the skeleton to build interfaces. If your work in C you
need GObject to create new widgets, but if we work in ruby, c++ or c#
we can create new widgets with classes. In large projects is important.
Well, do you have an example? Because to me it seems that we have some
smart people on the list, but everyone cooks widgets on his own.
I am not sure that your approach would make them use YAML a lot just
now.
YAML is very nice but it also has a few annoyances.
- Whitespace errors can be a problem (yes yes, editors can help, but I
as a human dont really love to hunt down errors anyway)
- The nesting could become a problem if the widgets are intertwined a
lot.
Ah well, I better stop here, I think this is quite interesting.
But I remain sceptical
PS: Why would it be called gtkonrails? Does one need to use rails for
this then?
I am not using rails and dont plan to, but i am using ruby-gtk still a
lot