<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">I recommend to read and study this description:<div><a href="https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.System.pdf">https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.System.pdf</a></div><div>Especially chapter 3 and 4<br><div><br><div dir="ltr">Br</div><div dir="ltr">Jörg</div><div dir="ltr"><br>Am 15.12.2018 um 11:31 schrieb Tomas Kral <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>>:<br><br></div><blockquote type="cite"><div dir="ltr"><span>On Thu, 13 Dec 2018 22:13:43 +0100</span><br><span>Tomas Kral <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>> wrote:</span><br><span></span><br><blockquote type="cite"><span>Fun when I try to add some message loop (handler), as I do not</span><br></blockquote><blockquote type="cite"><span>understand this part much.</span><br></blockquote><span></span><br><span>I have copied over `Handler' code from `GraphicFrames.Mod', and skinned it to a bare skeleton. It seems</span><br><span>that to tap into Oberon event loop, one needs to extend `DisplayFrame' and install own `Handle'.</span><br><span></span><br><span>It seems to avoid circular references, there is a need of three modules, Main, Control, and Frame.</span><br><span>Possibly the concept of MVC, as noted in OOP by H.P.Mossenbock.</span><br><span></span><br><span>I am now able to clear frame, on opening and resizing, plus calling Update to draw DLog elements.</span><br><span>How do I clear frame only on initial opening not closing or resizing?</span><br><span>Note actual M.Y, M.H, has to be picked from the frame message! I do not get(*understand*) all the</span><br><span>other events, except `Oberon.InputMsg'. What if, I needed to add a new</span><br><span>handler for each `DLog' element at runtime, how do I chain all handlers then?</span><br><span></span><br><span> Frame* = POINTER TO FrameDesc;</span><br><span> FrameDesc* = RECORD (Display.FrameDesc)</span><br><span> END ;</span><br><span></span><br><span> UpdateMsg = RECORD (Display.FrameMsg)</span><br><span> id: INTEGER;</span><br><span> END ;</span><br><span></span><br><span> PROCEDURE Handle*(F: Display.Frame; VAR M: Display.FrameMsg);</span><br><span> VAR x, y, h: INTEGER;</span><br><span> BEGIN</span><br><span> CASE F OF Frame:</span><br><span> CASE M OF</span><br><span> Oberon.InputMsg:</span><br><span> IF <a href="http://M.id">M.id</a> = Oberon.track THEN</span><br><span> x := M.X; y := M.Y;</span><br><span> IF M.keys # {} THEN ELSE Oberon.DrawMouse(MyMouse, x, y) END</span><br><span> ELSIF <a href="http://M.id">M.id</a> = Oberon.consume THEN</span><br><span> END</span><br><span> | UpdateMsg: (*my update, not sure what to do here*)</span><br><span> | Oberon.ControlMsg:</span><br><span> IF <a href="http://M.id">M.id</a> = Oberon.neutralize THEN Oberon.RemoveMarks(F.X, F.Y, F.W, F.H);</span><br><span> Out.String("neutralize msg"); Out.Ln</span><br><span> ELSIF <a href="http://M.id">M.id</a> = Oberon.defocus THEN END</span><br><span> | Oberon.SelectionMsg: Out.String("select msg"); Out.Ln</span><br><span> | Oberon.CopyMsg: Oberon.RemoveMarks(F.X, F.Y, F.W, F.H);</span><br><span> | MenuViewers.ModifyMsg:</span><br><span> Out.String("modify msg"); Out.Ln; </span><br><span> Display.ReplConst(Display.black, F.X, M.Y, F.W, M.H, Display.replace); (*clear frame*)</span><br><span> DLogs.Update (*redrawing dialog screen*)</span><br><span> END</span><br><span> END</span><br><span> END Handle;</span><br><span></span><br><span>-- </span><br><span>Tomas Kral <<a href="mailto:thomas.kral@email.cz">thomas.kral@email.cz</a>></span><br><span>--</span><br><span><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems</span><br><span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a></span><br></div></blockquote></div></div></body></html>