#1563 error in label sizing...

obsolete: 8.4.4
closed-invalid
Jeffrey Hobbs
5
2003-09-15
2003-09-14
Joe Mistachkin
No

The following script does not work as expected:

canvas .canvas -background "red" -borderwidth "0" -
highlightthickness "0" -width "800" -height "600"
label .canvas.thisLabel -background "blue" -
borderwidth "0" -highlightthickness "0" -width "200" -
height "95"
place .canvas -in . -x 0 -y 0
place .canvas.thisLabel -in .canvas -x 0 -y 0

Unless I am reading the Tk docs wrong (it's 5:30am),
this script should produce a canvas that is 800 by 600
pixels in size inside the toplevel window with a red
background. It should also produce a label of 200 by 95
pixels in size inside the canvas. Upon running this script
using Tcl/Tk 8.4.4 (ActiveState build), the label appears
to take up the entire width and height of the parent.

I believe this is a bug.

Discussion

1 2 > >> (Page 1 of 2)
    • labels: 104341 --> 51. [place]
    • milestone: --> obsolete: 8.4.4
     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2003-09-14

    Logged In: YES
    user_id=72656

    pilot error. reread docs.

     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2003-09-14

    • priority: 9 --> 5
    • status: open --> closed-invalid
     
  • Logged In: YES
    user_id=79902

    Joe: try a frame instead of a label... ;)

     
  • Joe Mistachkin
    Joe Mistachkin
    2003-09-15

    • status: closed-invalid --> pending-invalid
     
  • Joe Mistachkin
    Joe Mistachkin
    2003-09-15

    Logged In: YES
    user_id=113501

    Not pilot error, Jeff. This is a bug.

    Consider the following:

    #1. The docs mention Tk_GetPixels, the default unit for
    Tk_GetPixels is pixels (strangely consistent).
    #2. There is currently NO WAY to specify the exact width and
    height for a label.
    #3. Calculating anything in "characters" using a proportinally
    spaced font is both meaningless and wrong.
    #4. You can't use "read the docs" as any part of an argument
    against this issue. It does not matter what the docs say. You
    cannot document invalid, incorrect, and incomplete behaviour
    and then say everything is okay because we've documented
    the fact there is no way to perform a specified task.
    #5. I believe that every other widget correctly uses pixels as
    the default unit of measurement for width, height, and
    positioning. While the label does not even provide a means of
    selecting pixels as the measurement unit. This is completely
    broken as the underlying window managers all support pixels
    as the default unit of measure, so not providing this
    functionality actually requires more code to go out of your
    way with this invalid behaviour.
    #6. Using "characters" as a unit of measure might be an
    interesting idea to entertain if the widget in question could
    never support any data that might possibly need to be
    dimensioned using pixels, such as images. However, since the
    label does support image data, then this entire discussion is
    irrelevant. The label widget must support pixel dimensions.
    #7.This is using the "place" manager which
    implies ... "placement", which implies "pixel position". To say
    otherwise means a complete disconnection from the concepts
    of GUI that are standardized across all platforms and
    languages. Meaning, pixels are a standard unit of
    measurement for GUI placement. Get over it. You can support
    additional units such as EM, Points, Inches, Centimeters,
    Milimeters, Twips, etc. However, even with Twips, they have
    a direct correlation mathematically to a pixel measurement.
    #8.This is a GUI devkit. What part of GUI do you not
    understand? (additional comments appended by UI Engineer)

    If everyone else believes this is not a bug, then a TIP fixing
    this issue will be forthcoming. Comments about exactly how
    this TIP can fix the problem are welcome. Perhaps, an
    EXPLICIT unit of measurement for pixels ("x" or "px"?).

     
  • Joe Mistachkin
    Joe Mistachkin
    2003-09-15

    • priority: 5 --> 9
    • status: pending-invalid --> open-invalid
     
  • Joe Mistachkin
    Joe Mistachkin
    2003-09-15

    Logged In: YES
    user_id=113501

    re-opened, docs are misleading (Tk_GetPixels, mentioned on
    label page, defaults to pixels) and frames do not support
    images.

     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2003-09-15

    • status: open-invalid --> closed-invalid
     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2003-09-15

    Logged In: YES
    user_id=72656

    Reclosing - it specifically says that is only used when
    image or bitmap is specified (same as for buttons).

     
1 2 > >> (Page 1 of 2)