@Chris -- that sounds just fine!

I had missed the significance of your proposed wd'pmoves'. With winpos in
my thoughts, I'd pictured an explicit call at init and quit, not a part of
the form definition.

I suppose it could also be done as a styles option, as per
http://code.jsoftware.com/wiki/Guides/Window_Driver/Parent

On Sun, May 13, 2018 at 8:26 PM, chris burke <[email protected]> wrote:

> The facility doesn't exist in the current API, but could be added.
>
> I had suggested adding it like Jqt windows, in that saving and restoring
> the position would be done automatically once the form definition included
> 'wd pmoves'. This has worked fine for the IDE.
>
> Your exhibit requires that you call winpos explicitly to save and restore
> the position. With the automatic method, to save the position you would
> first position the form then close it. Would this work for you?
>
> On Sun, May 13, 2018 at 11:14 AM, Ian Clark <[email protected]> wrote:
>
> > The easiest way to respond is to exhibit the verb I'm currently using:
> >
> > winpos=: 3 : 0"0
> >   NB. remember/restore window position
> > posfile=: jpath'~config/nuterm.dat'
> > select. y
> > case. _ do. NB. init caches
> >   XYWH=: XYWH0=: 2 650 793 480
> > case. 0 do. NB. restore pos from XYWH0
> >   XYWH=: XYWH0
> >   wd sw'psel nuterm; pmove (XYWH_nut_)'
> > case. 1  do. NB. restore pos from posfile
> >   XYWH=: XYWH0
> >   (0!:0) :: 0: <posfile
> >   wd sw'psel nuterm; pmove (XYWH_nut_)'
> > case.   do. NB. remember pos
> >   z=. 'XYWH_nut_=: ',wd 'psel nuterm; qform;'
> >   z fwrite posfile
> > end.
> > XYWH0 ; XYWH
> > )
> >
> > This works fine for me, though I only really have a need for
> >    winpos ''   NB. remember pos
> >    winpos 1   NB. restore pos from posfile
> >
> > The only reason I raised the matter in the first place is that I hate
> > reinventing the wheel – it has long-term disadvantages when designing new
> > addons. I simply wondered if the facility existed already in the user API
> > and I didn't know about it.
> >
> > Ian Clark
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to