AnyScreen Frame Test: Pre-Release v13744

Running the attached program under AnyScreen crashes or hangs for me. I am hoping anyone (but especially Graham) might be willing to compile with shipping templates and give it a try?

AnyScreenFrame.zip (9.2 KB)

Hi Douglas,
Yes it hangs for me, but I’m not sure what you’re trying to do exactly.
The two embeds seem to be clashing, but then I don’t use ABC so can’t really say if this is correct or not…

Embeds

In ABC, it is common to hide the window while control properties are set.

The method with parameters is first called by WindowManager.Init to open the window. The window will NOT yet be displayed. Code can next set control properties (ie hide toolbars based on permissions, set relative position of controls, set button icons etc). The open method without parameters is finally called upon EVENT:OpenWindow and the window is finally displayed.

If the problem occurs on other windows using this code, the time requirements of a work around by enclosing PROP:Hide with checks for AnyScreen will depend upon the use of templates or handcode.

A PTSS has been submitted.

I tried to reproduce this as I would using the Clarion template chain, and there it all seems OK

                PROGRAM
                MAP
                END
include('AnyScreen.inc'),ONCE

AppFrame APPLICATION(‘Application’),AT(,505,318),CENTER,MASK,SYSTEM,MAX, |
ICON(‘WAFRAME.ICO’),STATUS(-1,80,120,45),FONT(‘Segoe UI’,9),RESIZE
MENUBAR,USE(?Menubar)
MENU(’&File’),USE(?FileMenu)
ITEM(‘E&xit’),USE(?Exit),MSG(‘Exit this application’),STD(STD:Close)
END
MENU(’&Help’),USE(?HelpMenu)
ITEM(’&How to Use Help’),USE(?HelpOnHelp),MSG(‘How to use Window’ & |
‘s Help’),STD(STD:HelpOnHelp)
END
MENU(’&TEST’),USE(?TestMenu)
END
END
END
CODE
AnyScreen:Init()
open(AppFrame)
do SetupWindow
accept
end
close(AppFrame)
AnyScreen:Kill()

SetupWindow ROUTINE

disable(?HelpMenu)
disable(?FileMenu)

No hanging and the correct menus are hidden.
What I did notice is that empty menus don’t display in AnyScreen mode whereas they do display in non-AnyScreen mode - see the Test menu.

I imagine the problem could be related to AnyScreen handling (or not handling) of EVENT:OpenWindow.
This is critical to the ABC example I created.

Possibly, but EVENT:OpenWindow is only posted within the ACCEPT loop.

In the example I posted I’m doing the window setup AFTER the OPEN(AppFrame) but BEFORE the ACCEPT loop.

Is there an equivalent of that in ABC?

Need to include PROP:Hide in your code such as:

CODE
AnyScreen:Init()
OPEN(AppFrame)
AppFrame{PROP:Hide}=True
DO SetupWindow
ACCEPT
IF EVENT() = EVENT:OpenWindow
AppFrame{PROP:Hide}=False
END
END
CLOSE(AppFrame)
AnyScreen:Kill()

Shouldn’t it be “IF EVENT() = EVENT:OpenWindow”?

Yes, of EVENT:Course.

Hi Douglas,

Need to include prop:hide in your code such as…

No you don’t that’s the whole point the window is hidden anyway until the ACCEPT loop starts, so an AppFrame{prop:hide} = True and the AppFrame{prop:hide} = False in the SetupWindow routine are both unnecessary.

Again not an ABC expert by any means but checking out the instances of ACCEPT in the WindowManager code is seems to me that if you want to do window setup stuff without having to hide/unhide the window itself then you need to put such code in the
ThisWindow.Ask procedure before the PARENT.Ask eg

ThisWindow.Ask PROCEDURE

CODE
!*** setup window here? ***
?Exit{PROP:Disable} = TRUE

PARENT.Ask

If I do that then I can do window setup stuff, disabling menus etc etc without any prop:hides and it all gets done before the ACCEPT loop begins.

I as an ABC expert can suggest to put setup code into WindowManager.Init in any appropriate embed point after OPEN window.

Yes, but is not the intent to duplicate the ABC problem in legacy?

Correct for the init of control properties.

… of control or window properties. If I want to make the window hidden, I write 0{prop:hide}=true there.

OK, but can I turn the question around - why are you hiding the window?
If the intent is to say avoid screen flicker then why not do the stuff before the window displays.

The stuff (ie MyWinMgr.InitControlProperties) IS done before the window displays. The use of PROP:Hide in both places insures a sharp display.

While I have probably not fully revisited this class code since at least the late 90’s, the real issue here is that it runs perfectly fine as a desktop app but crashes AnyScreen. If SV wants to investigate a bug, I will put my nickel on the problem being in AnyScreen as opposed to ABC or the ACCEPT managing to hide a problem for nearly 25 years.

You can’t always count on outside classes not to do a DISPLAY

Your PTSS 43187 is missing the Zip file.

Interesting. I will upload again. I do remember browsing to select it.