Mantis - tweak
Viewing Issue Advanced Details
1562 Any minor always 07-27-05 01:46 07-27-05 01:46
elenzil  
 
normal  
new  
open  
none    
none  
0001562: default size of a null CLabel is large.
if you pass an empty string ('') to a CLabel>>label:,
the resulting CPlayer has a size substantially larger than if you pass a non-empty string such as 'hi' or ' '.

if you specify the label's resizing to be #shrinkWrap, the results for empty and non-empty strings are consistent.
which is an argument for making #shrinkWrap the defaulkt resizing mode!
(http://bugs.impara.de/view.php?id=1561) [^]

attached screenshot is generated by the following code:
-----------------------------------------------------------------------------
    w1 _ CWindow new.
    w1 layout: CTableLayout new.
    w1 layout listDirection: #topToBottom.

    row _ CPlayer new.
    row layout: CTableLayout new.
    row layout listDirection: #leftToRight.
    row hResizing: #spaceFill.
    row vResizing: #shrinkWrap.

    l _ CLabel new.
    l label: 'hi'.
    l borderStyle: #simple.
    l borderWidth: 1.
    l borderColor: Color green.

    row add: l.
    w1 add: row.

    row _ CPlayer new.
    row layout: CTableLayout new.
    row layout listDirection: #leftToRight.
    row hResizing: #spaceFill.
    row vResizing: #shrinkWrap.

    l _ CLabel new.
    l label: ''.
    l borderStyle: #simple.
    l borderWidth: 1.
    l borderColor: Color blue.

    row add: l.
    w1 add: row.


    l _ CLabel new.
    l label: 'The above is a label "hi" and
a label "".
Note that the defult height
of "" is quite large.'.

    w1 add: l.

    w1 open.
-----------------------------------------------------------------------------
 nulllabelsize.png [^] (3,286 bytes) 07-27-05 01:46

There are no notes attached to this issue.