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 442284 - non-const Gtk::Notebook methods: get_n_pages() page_num()
non-const Gtk::Notebook methods: get_n_pages() page_num()
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.10.x
Other All
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2007-05-30 09:47 UTC by Tomasz Ostrowski
Modified: 2007-06-10 09:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tomasz Ostrowski 2007-05-30 09:47:55 UTC
Methods
 int Gtk::Notebook::get_n_pages()
 int Gtk::Notebook::page_num(const Widget& child)
should be declared "const", as they do not change object state.

Other information:
This causes the following compilation error when this methods are used on a
const declared notebook:
    error: passing ‘const Gtk::Notebook’ as ‘this’ argument of
    ‘int Gtk::Notebook::get_n_pages()’ discards qualifiers
Comment 1 Murray Cumming 2007-06-02 21:31:07 UTC
OK. We should add const versions of these functions and deprecate the non-const ones. A patch would be welcome.

As a workaround for now, a const_cast<> can be used.
Comment 2 Murray Cumming 2007-06-10 09:09:17 UTC
Done in svn trunk for gtkmm 2.11/12