Toolbar is not a regular control. Though it is a subclass of RectControl, and therefore shows all kind of properties which RectControl implements (Height, Handle, etc.), most of these properties don’t do anything or return nonsense values at least on OS X. The docs are really insufficient in this case.
[quote=178403:@Markus Winter]Thanks for checking, Michel.
Does the latest Xojo also still say 32?[/quote]
Yes indeed, up to the last beta. But since the toolbar size is variable according to what it contains, 41 when empty and 77 when it has icons and text, whatever the size at design is irrelevant.
The same goes for Timer which is not a rectcontrol, but yet has left and top. I don’t know why these properties are exposed…
The Toolbar height property in the IDE and at runtime remains 32, while in fact it is 41 without icons and 77 with icons, as seen on screen and reported by the difference between self.bounds.height and self.height.
Now that some times ellapsed, this 78 (yes, 78 pixels) pixels value recalls me something.
Oh, yes, last year or so, I got this trouble and I do not recall how I squash it. It was a quest to understand why this happened, and then I was able to tell it was because of the ToolBar.
A Conversation, one year ago, ended with:
Xojo 2013r4.1
OS X 10.8.5
Windows XP SP III
another one dates from Nov 10, 2014.
Nota: a search in this forum is not easy (in term of report): I think the report is done for all asked words, not for the addition of all search words: if I put Emile in the search string, I will get all entries with Emile, then with the first other word, the next other word, etc.
(bad english here, sorry: I hope you will understand what I meant).
This is the correct answer. Is there any reason you can’t use the window’s Bounds property? or if you’re already using the bounds property, why do you care about the toolbar’s height?
my trouble was because I loaded a lot of images whose height (and width) were unknow.
The number of images is also unknow.
I wanted to set the window at the topmost and leftmost position in the screen.
And, at last, I started to use Bounds.
As far as I can tell, I do not have the problem anymore, and the solution I found in my code was:
a. get the image width and height and store them in a couple of local variables
b. before leaving the method, and after applying Bounds, set Window1.Width and Window1.Height sizes using the image size stored in the variables (see a).
The trouble I found was that each time I display an image, the window height was resized down by 78 pixels, and after some displayed images, my window height was negative.
Very bad for a multimedia software.
In reality, I do not care about the ToolBar Height, but in my testings, I discovered that my code (my window) without a ToolBar worked fine.
BTW: I think my application works fine under both OS X and Windows
I am moving some controls (think like a drawer, but inside the window).
To know the required top I need to add the toolbar height to the Window.top. So it is quite annoying that ToolBar has a height property but it always contains the wrong value.