Gtkmm: gratitude and suggestions
- From: Maxim Udushlivy <maxim udushlivy gmail com>
- To: gtkmm-list gnome org
- Subject: Gtkmm: gratitude and suggestions
- Date: Sat, 22 Oct 2005 16:23:04 +0400
Hello, everybody!
I use gtkmm for almost one year in my project and I want to thank people
behind this library. Despite being a community effort it easily plays on
a par with commercial toolkits. Gtkmm programming is fun (!): it has
true C++ api, good documentation, builds on strong Gtk architecture
while hiding its complexities and exposing strengths (well, that sounds
like a promotion :)
And a bunch of small suggestions...
Why do you pass variables by non-const references instead of pointers?
Stroustrup recommends against doing this way, because it makes code more
difficult to read. And you can pass 'NULL' reference anyway:
"container.add(*(Gtk::Widget *)0)". Using pointers may reduce a number
of functions: take a look at "bool
TextBuffer::get_selection_bounds(iterator & start, iterator & end)". I
need to pass iterators even if I want just a return value. Currently you
can solve this by introducing a new function without parameters, but if
there were pointers - set default values to 0 in a header and it's done!
(As I understand, this requires support from gtkmm generator, though)
About const functions: widgets are non-constant objects by their nature.
They can change by outside events, like DND. Aren't these const
functions "misconcept" api and bloat documentation?
The solution to above that shouldn't break api: deprecate const
functions and those taking non-const references and introduce new that
take pointers. How difficult to implement this?
Maxim Udushlivy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]