Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12748

Re: Tkinter label height to fit content

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail
From Bart Kastermans <bkasterm@gmail.com>
Newsgroups comp.lang.python
Subject Re: Tkinter label height to fit content
Date Sun, 04 Sep 2011 13:39:49 -0600
Organization MB-NET.NET for Open-News-Network e.V.
Lines 24
Message-ID <87obz0w0ze.fsf@gmail.com> (permalink)
References <87mxelgtmx.fsf@gmail.com> <69ce4e11-5ef4-4b81-b66b-87d1017b1ec3@s7g2000yqk.googlegroups.com>
NNTP-Posting-Host kasterma.colorado.edu
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Trace gwaiyur.mb-net.net 1315165193 28863 128.138.150.65 (4 Sep 2011 19:39:53 GMT)
X-Complaints-To abuse@open-news-network.org
NNTP-Posting-Date Sun, 4 Sep 2011 19:39:53 +0000 (UTC)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
X-User-ID U2FsdGVkX19OPvTLb7OkYnPDasRHjbyNHGZ4KFoV/Uqgbf3YOspExhSUPXT0AFoy
Cancel-Lock sha1:ZzpI9rZROn1vsMWsziZZYgQbDgQ= sha1:JwtOXYLs5CD5awTOPV81NKQPJvo=
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12748

Show key headers only | View raw


rantingrick <rantingrick@gmail.com> writes:

> On Sep 3, 5:15 pm, Bart Kastermans <bkast...@gmail.com> wrote:
>
>> Any suggestions?
>
> Yeah, have you considered using the "linespace()" method of tk.Font
> objects to calculate the height? Although i must say it "feels" as if
> your doing something you should not need to do, however i cannot be
> sure without knowing more about this GUI. Sounds a lot like trying to
> put socks on a rooster.
>
> http://infohost.nmt.edu/tcc/help/pubs/tkinter/std-attrs.html#fonts

Thx.  That function should allow for a bit of robustness.

I get bits of information over RSS, these are of varying length.  I
want to show 10 at a time, and scroll through them.  Now when I
scroll the window grows and shrinks depending on their size, I want
to right from the start make it high enough to contain even the
biggest that will have to be shown.  So the question is determining
the height parameter for the labels ahead of time.  My strategy has
been to put all in labels and then try to get the information from
the label of how high it needs to be made at a certain width.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Tkinter label height to fit content Bart Kastermans <bkasterm@gmail.com> - 2011-09-03 16:15 -0600
  Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-03 18:15 -0700
    Re: Tkinter label height to fit content Bart Kastermans <bkasterm@gmail.com> - 2011-09-04 13:39 -0600
      Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-04 14:10 -0700
        Re: Tkinter label height to fit content Bart Kastermans <bkasterm@gmail.com> - 2011-09-06 14:15 -0600
          Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-06 14:23 -0700
            Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-06 14:37 -0700
            Re: Tkinter label height to fit content Bart Kastermans <bkasterm@gmail.com> - 2011-09-06 16:00 -0600
              Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-06 15:40 -0700
                Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-06 15:43 -0700
                Re: Tkinter label height to fit content Bart Kastermans <bkasterm@gmail.com> - 2011-09-06 18:33 -0600
      Re: Tkinter label height to fit content rantingrick <rantingrick@gmail.com> - 2011-09-04 14:15 -0700

csiph-web