why is the frame invisible?

Posted by ecsousa on 28-Jan-2015 10:05

Hi,


Why a update command (or enable, display, etc) turn the frame fTest1 invisible when it is a repeat block?


Look this code, please: 

DEF BUTTON bTest Label "Test".

DEF BUTTON bend Label "end".

DEF FRAME fTest bTest bEnd
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY CENTERED
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 10 ROW 1
SIZE 80 BY 3.

DEF VAR lTest AS LOG VIEW-AS TOGGLE-BOX.

DEF FRAME fTest1 lTest
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY CENTERED
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 10 ROW 10
SIZE 80 BY 3.

Def Var lend As Log No-undo.
REPEAT:

ON 'choose':U OF bTest
DO:
lend = No.
END.

ON 'choose':U OF bEnd
DO:
lend = Yes.
END.

MESSAGE "Before update is visible: " Frame fTest1:Visible
VIEW-AS ALERT-BOX INFO BUTTONS OK.
UPDATE bTest bEnd go-on("mouse-select-click") with frame fTest.

MESSAGE "After update is visible: " Frame fTest1:Visible
VIEW-AS ALERT-BOX INFO BUTTONS OK.


IF lend Then
LEAVE.
ELSE
DO:

ENABLE lTest WITH FRAME fTest1.
WAIT-FOR RETURN OF lTest IN FRAME fTest1.

MESSAGE "After wait-for is visible: " Frame fTest1:Visible
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

END.





All Replies

Posted by Matt Gilarde on 28-Jan-2015 10:16

The code is showing the visibility of frame fTest1 but the UPDATE statement displays frame fTest. Frame fTest1 is not visible at this point because it hasn't been made visible yet. Maybe I'm misunderstanding the question.

MESSAGE "Before update is visible: " Frame fTest1:Visible

VIEW-AS ALERT-BOX INFO BUTTONS OK.

UPDATE bTest bEnd go-on("mouse-select-click") with frame fTest.

MESSAGE "After update is visible: " Frame fTest1:Visible

VIEW-AS ALERT-BOX INFO BUTTONS OK.

Posted by ecsousa on 28-Jan-2015 10:26

Sorry about my terrible english...... I did not explain in details....

first click on the button Test ...after press ENTER .... the execution returned to the begin of the repeat block......and my frame test1 keep visible until the exact moment of the update command..... why test1 disappear in this moment?

Posted by Matt Gilarde on 28-Jan-2015 11:58

Frame Test1 is hidden when Frame Test is displayed because that is the default behavior when a REPEAT loop iterates. All frames that are scoped to the loop's block are marked "pending hide" when the loop iterates. The frames are hidden the next time a frame is displayed. You can add the NO-HIDE option to the frame definitions to override the default behavior.

Posted by ecsousa on 28-Jan-2015 12:15

Thank you =)

This thread is closed