After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 302736 - A member function equivalent of static Gdk::Pixbuf::create_subpixbuf() would be more convenient
A member function equivalent of static Gdk::Pixbuf::create_subpixbuf() would ...
Status: RESOLVED NOTABUG
Product: gtkmm
Classification: Bindings
Component: general
2.5.x
Other All
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2005-05-02 16:30 UTC by Michael J M Thomson
Modified: 2006-08-11 12:46 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
(proposed patch) (1.84 KB, patch)
2005-05-02 17:04 UTC, Michael J M Thomson
none Details | Review

Description Michael J M Thomson 2005-05-02 16:30:13 UTC
n/a
Comment 1 Michael J M Thomson 2005-05-02 16:36:26 UTC
(making patch)
Comment 2 Michael J M Thomson 2005-05-02 17:04:29 UTC
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.)
Comment 3 Murray Cumming 2005-06-17 14:54:20 UTC
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.
Comment 4 Michael J M Thomson 2005-06-21 06:48:59 UTC
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.
Comment 5 Michael J M Thomson 2005-06-21 07:00:55 UTC
*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)
Comment 6 Murray Cumming 2005-12-01 15:15:34 UTC
Well, it can't be called create_*(). Do you have another suggestion?
Comment 7 Murray Cumming 2006-08-11 12:46:25 UTC
Please reopen if you can think of anything appropriate. If not, it doesn't seem essential.