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


Groups > comp.lang.python > #12748

Re: Tkinter label height to fit content

From Bart Kastermans <bkasterm@gmail.com>
Newsgroups comp.lang.python
Subject Re: Tkinter label height to fit content
Date 2011-09-04 13:39 -0600
Organization MB-NET.NET for Open-News-Network e.V.
Message-ID <87obz0w0ze.fsf@gmail.com> (permalink)
References <87mxelgtmx.fsf@gmail.com> <69ce4e11-5ef4-4b81-b66b-87d1017b1ec3@s7g2000yqk.googlegroups.com>

Show all headers | 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