Get the size of a font used in a specific gadget

BlitzMax Forums/MaxGUI Module/Get the size of a font used in a specific gadget

Queller(Posted 2008) [#1]
Like the title says.. is it possible? I have made a custom combobox which allows the drop-box to appear above, below, left or right depending on how you want it to go. The issue is how do I limit the size of the box by the number of lines I want it to show at a given time? I thought the way to do it is this: take a text field, attach a button to it for making the drop-box bit appear. the drop-box is actually a listbox which needs a height parameter, in pixels. Because font size may vary, I thought using a number of visible line approach would be better, so of course this means i need to know what the font height from the parent gadget (textfield) is being used so i can calculate how tall in pixels the listbox needs to be (taking borders etc into account too). I dont see any functions to allow one to nominate a gadget and query it for the height of the font it uses. Any ideas? Here's what it looks like so far...