Bill,

There are definite changes and improvements with this new opengl_close. But ...

When I just click on the close button on the graphics window, the
smoutput' opengl_close' never shows.

When I press the Esc key, the smoutput' opengl_close'  shows. If I
then cycle through the windows, a "dead"  graphics window reappears as
a I described in my last post. And clicking on it close button shuts
down J.

Typing `tgsj_run 3` without first closing the window produces the
following result (without producing the smoutput' opengl_close').

   tgsj_run 3
|assertion failure: tgsj_run
|   0=#ogl

Pressing the Esc key on the graphics window and then immediately
typing something in the .ijx window or doing a Cmd+R in the .ijs
window (before changing windows) seems to work fine. But if I change
windows before doing something in the currently focused window by
cycling through windows with Cmd+` , the graphic old graphic window
shows. If instead of cycling with the key stroke chord, I use the
mouse to click on another window in J, all is well, also.



On Sat, Nov 10, 2012 at 10:59 AM, bill lam <[email protected]> wrote:
> Brian,
>
> if closeok flag is absent then the close event should call the verb
> opengl_close, you may add smoutput to trace, eg
>
> opengl_close=: 3 : 0
> smoutput 'opengl_close'
> target__ogl''
> gluDeleteQuadric QUADS
> destroy__ogl''
> ogl=: ''
> wd 'pclose'
> )
>
> I am not sure if the target__ogl is needed here, but should be
> harmless.
>
> wd 'pclose' should be ok, the adverse (::) is not needed here
> becuase wd 'pclose' should succeed in this case.
>
> if opengl_close had been called, ogl should be empty afterwards.
> otherwise you need to find out why opengl_close had not?
>
> Сбт, 10 Ноя 2012, Brian Schott писал(а):
>> Bill,
>>
>> Thanks very much for your test code.
>> I ran it with the suggestions you made.
>> After canceling the graphic window, another graphic window appears
>> with the image unchanged, or maybe the original graphic window just
>> goes to the back of the windows.
>>
>> I have experimented some more with that graphic window "appearing". It
>> seems as if it only appears if, before I click on its close button, I
>> click on other windows first and then click on its close button. If I
>> do that then it reappears as sort of dead window. It is dead in the
>> sense that when I click Cmd+` to cycle between windows, no cycling
>> occurs. However, a second click on its close button does close it.
>>
>> In any case, when I execute the following command, I get the indicated
>> alert message and cannot proceed.
>>
>>    tgsj_run 3
>> |assertion failure: tgsj_run
>> |   0=#ogl
>>
>>
>> Would you please look again at your suggested definition of
>> opengl_close? I think you left out `3 :` on the first line and I don't
>> understand your wd line after `::`. FYI my original definition is as
>> follows.
>>
>> opengl_close=: 3 : 0
>> gluDeleteQuadric QUADS
>> destroy__ogl''
>> ogl=: ''
>> wd 'pclose'
>> )
>>
>>
>> On Fri, Nov 9, 2012 at 6:42 PM, bill lam <[email protected]> wrote:
>> > I guess you may try
>> >
>> > ogl =: ''
>> >
>> > tgsj_run=: 3 : 0
>> > if. #ogl do.
>> >   free__ogl''      NB. force new rc
>> >   wdpclose 'opengl'
>> > end.
>> > assert. 0=#ogl
>> > wd OPENGL
>> > wdmove _1 0
>> > ogl=: ''conew'jzopengl'
>> > wd'setfocus g'
>> > wd'pcenter;pshow;'
>> > yw 0  NB. this is a startup command for my app
>> > )
>> >
>> > opengl_close=: 0
>> > free__ogl''      NB. force new rc
>> > wd ::0:'pclose'
>> > )
>> >
>> > OPENGL=: 0 : 0
>> > pc opengl;pn tgsj;
>> > xywh 0 0 200 150;cc g isigraph opengl rightmove bottommove;
>> > pas 0 0;
>> > rem form end;
>> > )
>> >
>> > (untested)
>> >
>> > Птн, 09 Ноя 2012, Brian Schott писал(а):
>> >>
>> >> I have the following J602 code which initializes a window for opengl
>> >> just fine, but only the first time in a J session. After the first
>> >> time if I execute `tgsj_run ''` with the original graphics window
>> >> still open (it is closed before the first execution of `tgsj_run ''`)
>> >> I get a new grpahics window. Also upon the second execution of
>> >> `tgsj_run ''` the .ijs window disappears.
>> >>
>> >> On the other hand if I close the graphics window with escape before
>> >> re-executing `tgsj_run ''`, I get varied results. Sometimes it works
>> >> fine, but most often I either get a system crash or the old window
>> >> reopens along with the new window when I re-execute `tgsj_run ''`.
>> >>
>> >> Any ideas?
>> >>
>> >>    9!:12''
>> >> 5
>> >>    9!:14''
>> >> j602/2008-03-03/16:45
>> >>
>> >>
>> >>
>> >> ogl =: ''
>> >>
>> >> tgsj_run=: 3 : 0
>> >> try.
>> >>   opengl_close ''
>> >>   free__ogl''      NB. force new rc
>> >> catch.
>> >> end.
>> >> wd OPENGL
>> >> wdmove _1 0
>> >> if. 0=#ogl do.
>> >>   ogl=: ''conew'jzopengl'
>> >>   wd'setfocus g'
>> >> end.
>> >> wd'pcenter;pshow;'
>> >> yw 0  NB. this is a startup command for my app
>> >> )
>> >>
>> >> OPENGL=: 0 : 0
>> >> pc opengl closeok;pn tgsj;
>> >> xywh 0 0 200 150;cc g isigraph opengl rightmove bottommove;
>> >> pas 0 0;
>> >> rem form end;
>> >> )
>> >>
>> >>
>> >> (B=)
>> >> ----------------------------------------------------------------------
>> >> For information about J forums see http://www.jsoftware.com/forums.htm
>> >
>> > --
>> > regards,
>> > ====================================================
>> > GPG key 1024D/4434BAB3 2008-08-24
>> > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>>
>>
>>
>> --
>> (B=) <-----my sig
>> Brian Schott
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



-- 
(B=) <-----my sig
Brian Schott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to