Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!canon!smith From: smith@canon.co.uk (Mark Smith) Newsgroups: comp.windows.news Subject: weird tNt behaviour? Message-ID: <1990Aug21.144958.6645@canon.co.uk> Date: 21 Aug 90 14:49:58 GMT Distribution: comp Organization: Canon Research Europe, Guildford, UK Lines: 78 Well, at the risk of looking like a complete and utter prat, I throw myself on the mercy of comp.windows.news in the hope of finding an explanation for some very bizarre behaviour in OW 2.0. Below is a simple window class definition, followed by 4 lines which create a window on the desktop: ------------------------------------------------------------------------ /TestFrame OpenLookBaseFrame dictbegin dictend classbegin /newinit { (newinit userdict:\n) printf userdict == (\n\n) printf /newinit super send } def /destroy { (destroy userdict:\n) printf userdict == (\n\n) printf /destroy super send } def /place { reshapefromuser } def classend def /win ClassCanvas [] framebuffer /new TestFrame send def /place win send /activate win send /map win send ------------------------------------------------------------------------ If you start up a psh and stuff this into it, you should see the current userdict shown in the psh when newinit is executed. Next, position and size the window on the desktop as usual. When you choose Quit from the window's frame menu, you'll see the current userdict in the psh again when destroy is executed. The window doesn't go away since /win in userdict has a reference to it. Now comes the weird part. If you remove the last reference by, for instance, typing "userdict /win undef" in the psh, the destroy method gets called *again*, this time in an apparently different context (userdict is empty). You won't see this in the psh; you'll need to have the server's stderr redirected to a file. I start up Open Windows with "openwin 2>/tmp/owlog" and run "tail -f /tmp/owlog &" in my console window. In my case, as soon as I remove that last reference in the psh, I see destroy userdict: dict[ ] in the console. So why does destroy get executed the second time? Am I nuts or what? Enquiring minds want to know. (I'm running OW2.0 on an SS1. I don't know if this happens under 1.0.) ========================================================================= Mark Smith smith@canon.co.uk Canon Research Centre Europe ..ukc!uos-ee!canon!smith ------------------------------------------------------------------------- soft driven slow and mad like some new language