Dynamic framing spec

20 views
Skip to first unread message

Julian Ford

unread,
May 14, 2020, 4:28:32 PM5/14/20
to VA Smalltalk
Hey there.

I have a window on which I am hiding an entry field by default.
But when something happens, I want to show that entry field.
Not surprisingly, I am using #hide and #show, respectively.

BUT....there is another field below that one, that needs to move,
once this hidden field gets shown.

In that field, I have the top edge of the framing spec set to be attached to
the the field ABOVE the hidden one.  But when I show that hidden field,
I want to change the framing spec to be relative to the newly-visible field.

As an example, thing about the Attachments field in most EMail programs.
The top of the message area is close to the Subject field.
But when you add an attachment, the Attachments field appears below the
subject field, and the top of the message area moves to be just below
the attachments field.

I have tried just changing the #attachedTargetView of the edge constraint,
but I suspect I need some form of redraw call after that.

I am embarrassed to say, I can not find the solution to what I thought
would be a simple change.

Has anyone done something like this?

Regards,
Julian Ford


Wayne Johnston

unread,
May 14, 2020, 5:19:21 PM5/14/20
to VA Smalltalk
We have code that does something like this.  We adjust a part's framingSpec.  But then we seem to need to 'kick' a refresh via:
partBeingChanged framingSpec: partBeingChanged framingSpec

Julian Ford

unread,
May 14, 2020, 6:11:03 PM5/14/20
to VA Smalltalk
Wayne,

Thank you!!!
That worked perfectly.  I was staring to get a little addled by this...I thought it would be so simple.
Which of course was the very reason it was not.  LOL.

I appreciate you taking the time to give me the answer!

Best Regards,
Julian
Reply all
Reply to author
Forward
0 new messages