XmLabel no longer changes its size when shown. - Motif
This is a discussion on XmLabel no longer changes its size when shown. - Motif ; Hi,
I've code that used to work fine with Motif 1.2 on IRIX.
I've XmLabels that are childs of XmForm. The labels must resize
dynamically when their contents are changed, but the XmForm must
__not__ resize.
Because of this, the ...
-
XmLabel no longer changes its size when shown.
Hi,
I've code that used to work fine with Motif 1.2 on IRIX.
I've XmLabels that are childs of XmForm. The labels must resize
dynamically when their contents are changed, but the XmForm must
__not__ resize.
Because of this, the XmNrecomputeSize of the labels is set to True, but
the XmNResizePolicy of the form is set to XmRESIZE_NONE (the form must
not resize itself, but it must allow its children to resize
themselves).
This used to work fine, but in OpenMotif-2.2.3, I'm getting this
strange behaviour: Labels change their size if the form isn't shown in
the screen (ie: when it hasn't been managed yet). However, once labels
are displayed, their size remains fixed, they no longer resize when
their contents change.
I'll greatly appreciate suggestions to fix this problem.
Thank you
nopa
-
Re: XmLabel no longer changes its size when shown.
"nopa" wrote in message
news:1162455455.262287.163980@b28g2000cwb.googlegr oups.com...
> Hi,
>
> I've code that used to work fine with Motif 1.2 on IRIX.
>
> I've XmLabels that are childs of XmForm. The labels must resize
> dynamically when their contents are changed, but the XmForm must
> __not__ resize.
>
> Because of this, the XmNrecomputeSize of the labels is set to True, but
> the XmNResizePolicy of the form is set to XmRESIZE_NONE (the form must
> not resize itself, but it must allow its children to resize
> themselves).
>
> This used to work fine, but in OpenMotif-2.2.3, I'm getting this
> strange behaviour: Labels change their size if the form isn't shown in
> the screen (ie: when it hasn't been managed yet). However, once labels
> are displayed, their size remains fixed, they no longer resize when
> their contents change.
>
> I'll greatly appreciate suggestions to fix this problem.
>
> Thank you
>
> nopa
>
It is not clear how you really want it to behave.
You say you want the children to be able to resize themselves,
but the form cannot resize. This is a conflicting requirement:
Label: leftAttachment=ATTACH_FORM
Text: leftAttachment: ATTACH_WIDGET
Text: RightAttachment: ATTACH_FORM
|<--Label<--text-->|
If Label above gets twice as long, either the form MUST resize,
or the label stays the same size and gets clipped. You can't
have it both ways, unless there is no attachment on the right,
in which case the label resizes and the text wiget runs off
the edge and is clipped.
So one presumes you do not have edge-to-edge attachments.
Have you specified a fixed width for the form (XmNwidth)?
If not, then the form will determine its preferred size when it
is first realized.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
-
Re: XmLabel no longer changes its size when shown.
Hi Fred,
First of all, thanks a lot for your kind reply. It's getting very
difficult to find people who speak Motif nowadays :-(
Fred Kleinschmidt wrote:
>
> It is not clear how you really want it to behave.
> You say you want the children to be able to resize themselves,
> but the form cannot resize. This is a conflicting requirement:
[...example snipped...]
Are you suggesting that it's not possible to have a non-resizable form
that accepts resizing of its children? That could be a somewhat serious
problem for me.
>
> So one presumes you do not have edge-to-edge attachments.
Yes, my XmLabels only have left and bottom attachments. They don't have
an specified size, nor the other two attachments. They automatically
get their size from their content when they're first managed. However,
their content will change dynamically, so they've to be able to resize
at runtime.
>
> Have you specified a fixed width for the form (XmNwidth)?
> If not, then the form will determine its preferred size when it
> is first realized.
The form has no fixed size, but it has attachments on its four edges.
I tend to believe that having resizable labels in a fixed form is quite
a common scenario, so I hope it's possible to get it working (as I said
it worked for me on Motif 1.2 on IRIX, although maybe it was because of
non-compliant behaviour on that implementation, I don't know).
If I allow my forms to resize, then the labels work fine (they resize
when expected), but however, the GUI in my app gets wrong size changes
in some panels while the user is working. These annoying size
modifications didn't happen on IRIX, so that's the reason why I'm
disabling XmForm resizing on OpenMotif.
Thanks a lot!
nopa
-
Re: XmLabel no longer changes its size when shown.
"nopa" wrote in message
news:1162491421.112056.236970@k70g2000cwa.googlegr oups.com...
> Hi Fred,
>
> First of all, thanks a lot for your kind reply. It's getting very
> difficult to find people who speak Motif nowadays :-(
>
> Fred Kleinschmidt wrote:
>>
>> It is not clear how you really want it to behave.
>> You say you want the children to be able to resize themselves,
>> but the form cannot resize. This is a conflicting requirement:
> [...example snipped...]
>
> Are you suggesting that it's not possible to have a non-resizable form
> that accepts resizing of its children? That could be a somewhat serious
> problem for me.
>
>>
>> So one presumes you do not have edge-to-edge attachments.
>
> Yes, my XmLabels only have left and bottom attachments. They don't have
> an specified size, nor the other two attachments. They automatically
> get their size from their content when they're first managed. However,
> their content will change dynamically, so they've to be able to resize
> at runtime.
>
>>
>> Have you specified a fixed width for the form (XmNwidth)?
>> If not, then the form will determine its preferred size when it
>> is first realized.
>
> The form has no fixed size, but it has attachments on its four edges.
>
> I tend to believe that having resizable labels in a fixed form is quite
> a common scenario, so I hope it's possible to get it working (as I said
> it worked for me on Motif 1.2 on IRIX, although maybe it was because of
> non-compliant behaviour on that implementation, I don't know).
>
> If I allow my forms to resize, then the labels work fine (they resize
> when expected), but however, the GUI in my app gets wrong size changes
> in some panels while the user is working. These annoying size
> modifications didn't happen on IRIX, so that's the reason why I'm
> disabling XmForm resizing on OpenMotif.
>
> Thanks a lot!
>
> nopa
>
I cannot reproduce the problem (I tried Motif1.2, Motif2.0, Motif2.1, and
Motif2.2)Are you sure you are not setting XmNresizable=false on children of
the form?
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
-
Re: XmLabel no longer changes its size when shown.
Fred Kleinschmidt wrote:
> I cannot reproduce the problem (I tried Motif1.2, Motif2.0, Motif2.1, and
> Motif2.2)Are you sure you are not setting XmNresizable=false on children of
> the form?
I'm not setting XmNresizable=false on the children.
However, I found this: If I unmanage each label before modifying its
text, and then manage it again (just an XtUnmanage before the
XtSetValues and an XtManage before it), then all labels resize OK, as I
wish.
Does this behaviour give any hints on what's happenning?
For the moment this works as a workaround, although I don't know if
there's something going wrong inside the code.
Thanks,
nopa