Thank you Alex for the answer to my previous question –
it was exactly what I was looking for!
Moving on, I have some bugs to report:
I’m using the Wx::Notebook class and it looks to me
like Wx::NB_LEFT, Wx::NB_RIGHT, and Wx::NB_BOTTOM are
defined incorrectly. To get my tabs to appear on the
bottom, for example, I find I have to use Wx::NB_LEFT.
Same symptom in samples/bigdemo/WxNotebook.rbw – the
constructor uses Wx::NB_BOTTOM but the tabs appear on
the right. Off by 1?
I’m also having trouble with images in tabs – they
seem to randomly disappear on resizing. Has anyone
else seen this? It’s not hard to repro, but it’s not
happening all the time, either.
And, now that I am educated about Windows XP style
controls and manifest files, I’m noticing that
Wx::Notebook tabs seem to ignore them if they’re
placed anywhere but at the top. In other words, I
get the version 6 style if the tabs are at the top,
and the version 5 style if they’re anywhere else.
I’m also having trouble with images in tabs – they
seem to randomly disappear on resizing. Has anyone
else seen this? It’s not hard to repro, but it’s not
happening all the time, either.
I haven’t seen this. Can you reproduce in one of the samples?
None of the samples use images in tabs, as far as I can see,
but I have a small test program that exhibits the problem.
I honestly can’t figure out what sequence of resize operations
triggers the bug, but all I have to do is resize the window
repeatedly, including maximizing and restoring it, and eventually
the tab images go away.
My environment, FWIW:
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
wxruby-1.9.0-i386-mswin32
Windows XP Professional 5.1.2600
I’m using the Wx::Notebook class and it looks to me
like Wx::NB_LEFT, Wx::NB_RIGHT, and Wx::NB_BOTTOM are
defined incorrectly. To get my tabs to appear on the
bottom, for example, I find I have to use Wx::NB_LEFT.
Same symptom in samples/bigdemo/WxNotebook.rbw – the
constructor uses Wx::NB_BOTTOM but the tabs appear on
the right. Off by 1?
Thanks very much for the report. It seems the values of the constants
changed in wxWidgets between version 2.6 and 2.8, so when we upgraded to
target 2.8 the wxRuby values went out by one. I’ll fix for the next
release, but for reference, the correct values are:
I’m also having trouble with images in tabs – they
seem to randomly disappear on resizing. Has anyone
else seen this? It’s not hard to repro, but it’s not
happening all the time, either.
I haven’t seen this. Can you reproduce in one of the samples?
Note that current Windows UI guidelines discourage the use of icons in
tabs:
And, now that I am educated about Windows XP style
controls and manifest files, I’m noticing that
Wx::Notebook tabs seem to ignore them if they’re
placed anywhere but at the top. In other words, I
get the version 6 style if the tabs are at the top,
and the version 5 style if they’re anywhere else.
I get the same result. I can’t think that I’ve ever seen the XP-style
“glow”/rounded tabs other than on the top in an application, and my
guess is that those tabs are only available on the top in the Windows XP
UI. Note that side/bottom tabs won’t work anyway on OS X.
You might have a look into Wx::AuiNotebook (see the aui.rb sample) as an
alternative. wxWidgets 2.8 added some other “book” controls (TreeBook,
ToolBook) but they aren’t yet available in wxRuby.
This UI guidelines page has been very interesting reading!
It recommends using “clearly recognizable icons [in tabs]
if there might be insufficient space to display meaningful
labels”, which is just the use I have in mind.
I can’t think that I’ve ever seen the XP-style
“glow”/rounded tabs other than on the top in an application…
On the above-mentioned page there is an example of “correct”
use of images in tabs, and the tabs are on the bottom.
You might have a look into Wx::AuiNotebook (see the aui.rb sample) as an
alternative. wxWidgets 2.8 added some other “book” controls (TreeBook,
ToolBook) but they aren’t yet available in wxRuby.
Thanks, I’ll take a look.
And Mario wrote:
If you go to Windows API, and look at the TabControl
If you get a chance, could you please provide a link to this?
I googled around but couldn’t find it. (I am admittedly
completely unfamiliar with Windows API documentation.
Not that I plan to do any Windows API coding, but it
might be educational reading.)
Here’s my test program
Thanks for the test case - that was very helpful. Having worked with it
I’m pretty sure this is down to Ruby’s garbage collection prematurely
destroying the ImageList (repeated resizing accumulates Event and Size
objects, which eventually triggers GC). wxRuby should protect an
assigned image list in this situation.
It should be a simple fix for the next wxRuby release with a DISOWN
typemap, but in the meantime holding a reference to the image list as an
instance variable of your Notebook should provide a workaround. Let me
know if this doesn’t seem to help.
And, now that I am educated about Windows XP style
controls and manifest files, I’m noticing that
Wx::Notebook tabs seem to ignore them if they’re
placed anywhere but at the top. In other words, I
get the version 6 style if the tabs are at the top,
and the version 5 style if they’re anywhere else.
Hello there Peralta,
The thing about the Notebook Tabs on Left, Right and bottom with the
version 6 style, Windows naturally does not have this functionality by
default. If you go to Windows API, and look at the TabControl, you will
find nothing on how to draw the Notebook Tabs on Left, Right or Bottom.
What wxWidgets does is draws the default Tab style, for when it’s done
on the left, right or bottom of the Notebook control. Other GUI
Toolkits do the same thing. So unfortunatly, there no way to get
natural Windows XP Styles, with the Tabs being in a different area.