[Tkinter-discuss] Define height in a row of a grid manager

Michael Lange klappnase at web.de
Fri Feb 3 19:36:22 EST 2017


Hi,

On Fri, 3 Feb 2017 16:35:53 +0000
Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:

> Dear all,
> 
> I am trying to optimize the screen space use in a small screen QVGA
> mounted on a RPi
> 
> On the first row (using the grid manager) I display the time with big
> fonts. The space allocated for the row includes, correctly includes the
> descent of the font however in the case of numbers its an empty space.
> So its loosing a lot of useful screen space there.
> 
> Is there a way to force the height of a single row in the grid manager
> to be equal to the font ascent only?

I am not entirely sure about this, but if I understand you correctly I
think that it might actually not be grid who consumes the "excess" space,
but the Label (or whichever) widget that you use to display the digits.
If this assumption is true, a workaround might be to use a Canvas of
pre-defined height instead and place the time-string with a pixel-sized
font into properly calculated coordinates.
I did not test this though, just a random thought :-)

Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

The more complex the mind, the greater the need for the simplicity of
play.
		-- Kirk, "Shore Leave", stardate 3025.8


More information about the Tkinter-discuss mailing list