I didn't know that I could set it as empty string the image.
I will try it.

Thanks
Vasilis

________________________________________
From: Tkinter-discuss 
[tkinter-discuss-bounces+vasilis.vlachoudis=cern...@python.org] on behalf of 
Michael Lange [klappn...@web.de]
Sent: Tuesday, February 07, 2017 11:19
To: tkinter-discuss@python.org
Subject: Re: [Tkinter-discuss] Define height in a row of a grid manager

Hi,

On Sat, 4 Feb 2017 10:16:01 +0000
Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote:

> Hi Michael,
>
> I was just trying to reply to my self with the solution I've found,
> while I received your email :) I was using the Canvas in the begging,
> but it was complicating quite my code, so I tried to avoid it. However
> I found a solution maybe not the most elegant, but it works. According
> to the documentation of tk label the "height" option is in text units
> unless if an image is associated with the label, then it is in screen
> units. So I've created a dummy image of 1x1 pixels as transparent gif
> and added it as image/text compound in the label see the code below.
(...)

Actually I think this is pretty elegant, much better than bothering with
Canvas text items :-)
If every pixel counts, you could btw save two more vertically if you set
pady=0 in the Label constructor (at least here on X the default appears
to be pady=1). If horizontal pixels count also you could of course use
padx=0, too and replace the ONEPIXEL image data with an empty string to
save three more horizontal pixels.

Best regards

Michael


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

Too much of anything, even love, isn't necessarily a good thing.
                -- Kirk, "The Trouble with Tribbles", stardate 4525.6
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to