I'm porting an application from Windows to Mac OS X. Since I used wxWidgets this has been a reasonably painless experience (apart from some cosmetic problems and occasional breakage due to use of undefined behaviour).
There is however one problem that doesn't seem to want to go away. For some reason I can't get my wxScrolledWindow to have any scrollbars, at all. I've double-checked the window styles, tried several ways of setting up scrolling and still haven't seen a single scrollbar. I do have scrollbars on a wxHtmlControl and a wxListView window.
I'm using wxMac 2.6.1 on Mac OS X 10.3.9, built using the xcode project file (as far as I can remember I just used the default settings).
I'm interested in any suggestions to help solve this problem or further pin it down.
Can't get wxScrolledWindow to show scrollbars on Mac OS X. Topic is solved
That's what I'm doing, and I've also tried SetScrollBars, both don't work for me (and it does work on Win32 btw). I'm currently calling the following:Are there any relevant defines?
Code: Select all
SetVirtualSize(width_p, height_p);
SetScrollRate(5,5);
-
- Filthy Rich wx Solver
- Posts: 236
- Joined: Sat Sep 04, 2004 1:49 pm
- Location: Ohio, USA
- Contact:
Just for kicks, have you tried forcing the window to redrawn after calling SetVirtualSize? Also, if you resize it do the scrollbars appear?
I guess I'm a bit baffled since it's always worked so easily for me, and all I do is use SetVirtualSize, just like you show. BTW, I assume your virtual size is larger than your window size, right?
I guess I'm a bit baffled since it's always worked so easily for me, and all I do is use SetVirtualSize, just like you show. BTW, I assume your virtual size is larger than your window size, right?
Refreshing and/or resizing didn't help (and the virtual size was bigger than the window size), but I think I may have figured out what triggers the problem. The scrolled window(s) are children of a wxNotebook (I also tried wxListbook btw, with the same result), but when I create a scrolled window using the exact same class directly on the main window (a wxPanel inside a wxFrame), then it works perfectly. Any ideas on how to solve this?
-
- Filthy Rich wx Solver
- Posts: 236
- Joined: Sat Sep 04, 2004 1:49 pm
- Location: Ohio, USA
- Contact:
I have two theories:
1) The notebook is expanding to the virtual size (which seems unlikely)
or
2) the scrollbars are being drawn past the edge of the notebook?
Or, maybe it's possible on Mac OS X that you can't have a scrolled window inside a notebook? That would be unfortunate and I don't know the answer to that one...
1) The notebook is expanding to the virtual size (which seems unlikely)
or
2) the scrollbars are being drawn past the edge of the notebook?
Or, maybe it's possible on Mac OS X that you can't have a scrolled window inside a notebook? That would be unfortunate and I don't know the answer to that one...
I just found that it doesn't work on Win32 too in fact, sorry for the confusion. I didn't notice this earlier because until very recently I still used wxWidgets 2.4.2 on Win32, while I used wxWidgets 2.6.1 on the Mac.
This also led me to the solution, I was still using some code that used sizers in a 2.4 fashion, which didn't work too well with 2.6 in this case. In any case, thanks for all the suggestions.
This also led me to the solution, I was still using some code that used sizers in a 2.4 fashion, which didn't work too well with 2.6 in this case. In any case, thanks for all the suggestions.