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 317309 - ScrolledWindow::get_hscrollbar_visible() and get_vscrollbar_visible() return wrong state
ScrolledWindow::get_hscrollbar_visible() and get_vscrollbar_visible() return ...
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
: 318332 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-09-27 06:59 UTC by Bartek Kostrzewa
Modified: 2005-10-10 06:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bartek Kostrzewa 2005-09-27 06:59:20 UTC
Distribution/Version: Gentoo ~x86 on a 2005.1 base

I think in the implementation of ScrolledWindow get_hscrollbar_visible()
and get_vscrollbar_visible() the methods return the wrong value (ie:
they return eachother's value rather than their own...) see the attached
screenshot for output:

std::cout << "HScrollbar: " << ImageScroller.get_hscrollbar_visible() <<
std::endl;

std::cout << "VScrollbar: " << ImageScroller.get_vscrollbar_visible() <<
std::endl;

In the screenshot it is clearly the HScrollbar visible but the output is
in reverse, or am I missing something?

http://www.tschew.e7even.com/scrollbar.jpg

-Bartek
Comment 1 Bartek Kostrzewa 2005-09-27 12:05:42 UTC
I've checked scrolledwindow.ccg and scrolledwindow.hg in the source distribution
but I don't understand the _MEMBER_GET bit:

  _MEMBER_GET(vscrollbar_visible,hscrollbar_visible,bool,guint)
  _MEMBER_GET(hscrollbar_visible,vscrollbar_visible,bool,guint)

Is my assumption correct that this works as follows:

arg1 = get_* method name
arg2 = get_* object property
arg3 = return type
arg4 = implementation of return type (e.g. bool = guint)

if so then I think I've found the problem.. I'm going to try to reverse the
second arguments, recompile and see what happens.
Comment 2 Bartek Kostrzewa 2005-09-27 12:39:29 UTC
Ok, I now modified the correct files or maybe I don't understand the build
system or whatever... anyway, I went into the source distribution
gtk/gtkmm/scrolledwindow.cc ... I know it says do not modify but since the other
tweak didn't do it...

and here indeed, get_hscrollbar_visible() returns gobj->vscrollbar_visible()
which seems fishy... and changing it made it behave as it should

Maybe there was some error in gtk and this was implemented like this as a hotfix
and then forgotten?

http://www.tschew.e7even.com/scrollbar2.jpg
Comment 3 Bartek Kostrzewa 2005-09-28 07:26:28 UTC
Hehe, after lookng through this, mozilla firefox now has rather strange
scrollbar behaviour, so firefox uses gtkmm for widgets. But what I don't
understand is whether this behaviour was intentional (e.g. reporting eachother's
visibility) or whether so many projects used it without bothering to file a bug
and just implemented it the other way around...  please someone enlighten me...
Comment 4 Bartek Kostrzewa 2005-09-28 07:33:14 UTC
oops, nope, just the qt engine acting up
Comment 5 Murray Cumming 2005-09-28 17:01:38 UTC
> _MEMBER_GET(vscrollbar_visible,hscrollbar_visible,bool,guint)
>  _MEMBER_GET(hscrollbar_visible,vscrollbar_visible,bool,guint)

That does look very wrong. Well done. Fixed.

> so firefox uses gtkmm for widgets.

firefox uses GTK+, not gtkmm.
Comment 6 Murray Cumming 2005-10-10 06:46:06 UTC
*** Bug 318332 has been marked as a duplicate of this bug. ***