GNOME Bugzilla – Bug 302736
A member function equivalent of static Gdk::Pixbuf::create_subpixbuf() would be more convenient
Last modified: 2006-08-11 12:46:25 UTC
n/a
(making patch)
Created attachment 45945 [details] [review] (proposed patch) (Ok this time I actually patched the relevant .hg and .ccg files rather than the gmmproc output, sorry for my ignorance of the build process.)
This is confusing because create*() methods are usually static, instead of using an instance. Thinking about it, it also does not seem much more convenient anyway. I'm tempted to reject this.
You're right, a non-static function shouldn't be called create*, would including it as e.g. subpixbuf(...) be a better option though? Because if you think nabout it, everywhere else in gtkmm C functions that operate on an instance are generally wrapped as member functions, with constructors and create methods wrapping C functions that construct something -- this much is obvious and makes sense -- but gdk_pixbuf_new_subpixbuf seems to fit both categories, it accepts an instance as its first argument /and/ constructs another. To be honest I found it odd that the feature is a static create method at all, which imho feels unnatural to use. It doesn't feel like constructing, and if gtkmm didn't have need of create methods, I doubt it would've been implemented as a constructor. Also, saying that pixbuf->subpixbuf(...) (object->method(args)) isn't much more convenient than Gdk::Pixbuf::create_subpixbuf(pixbuf, ...) (objecttype_method(object, args)) seems like saying that e.g. button->set_relief(Gtk::RELIEF_NONE) isn't much more convenient than gtk_button_set_relief(button, GTK_RELIEF_NONE) Anyway, thanks for your time. Sorry to be bothering you with such trivial things.
*It doesn't feel like constructing any more than scale_simple() does (sorry, I switched windows to check scale_simple wasn't also a static function, then forgot to type it here)
Well, it can't be called create_*(). Do you have another suggestion?
Please reopen if you can think of anything appropriate. If not, it doesn't seem essential.