dyad conew will automatically call create. You saw locale switched
probably it crash inside that locale and did not return to the caller
locale. I cannot comment further why your app crashed without seeing
a more complete source code. You will have a better chance to have
the problem solved if you can provide a minimum demo to reproduce the
error. Anyway, below is a minimum example to put TWO grids inside the
same form
require 'jzgrid'
cocurrent 'base'
FORM=: 0 : 0
pc form closeok;
xywh 0 0 200 240;cc g0 isigraph ws_border;
xywh 210 0 200 240;cc g1 isigraph ws_border;
pas 1 1;pcenter;
rem form end;
)
run=: 3 : 0
wd FORM
data0=: i. 3 4
data1=: i. 2 3
g0=: '' conew 'jzgrid'
show__g0 ('CELLDATA' ; 'GRIDID') ,. data0 ; 'g0'
g1=: '' conew 'jzgrid'
show__g1 ('CELLDATA' ; 'GRIDID') ,. data1 ; 'g1'
wd 'pshow'
)
run '' NB. testing
mer, 17 Mar 2010, Donald Pittenger skribis:
> I wrote about trying to get grids working a week or so ago. Since
> then, I was able to reverse-engineer a Jwiki example to work in a pop-
> up form.
>
> But that was a toy application and I need to have grids in forms that
> are called by other forms as part of a more serious application.
>
> Due to limited ability and imagination, I'd prefer to keep most of
> the app in the base locale and manage all events under program control.
>
> Another matter: The samples in the wiki have bits of code floating in
> the scripts (for example, CELLDATA, HDRROW and HDRCOL assignments)
> and I'm not sure how these would work where several forms and grids
> (perhaps two per form in some cases) need to exist and strong program
> control is necessary.
>
> Anyhow, for now assume the following:
>
> Data are selected, read into the system and formatted into a matrix
> called DATAMAT (global variable), all in the "base" locale.
>
> A button on a form is clicked, evoking a handler that might be called
> MainForm_continue_button. That handler ideally should contain code
> that calls , say, NewForm=: 0 : 0 that creates a form with all the
> gadgets including TWO isigraphs that I'll call grid0 and grid1.
> Let's stipulate that the data in DATAMAT are to appear in grid0.
>
> The following code fragment crashes on the "show" statement.
>
> NB. - - - - - - - -
>
> wd NewForm
>
> grid0=: '' conew 'jzgrid'
> CELLDATA=: DATAMAT_base_
> show__grid0 'celldata'
>
> wd 'pshow'
>
> NB. - - - - - - - -
>
> After the crash, a << coname '' >> query returns a boxed sequence
> number. Is this okay, or is an explicit << cocurrent 'whatever'
> >> assignment required and, if so, what might it look like and
> where should it be placed in the controlling program?
>
> Also missing is anything to do with the "create" command. Is some
> sort of "create" statement required? Assuming "create" is essential,
> where should it be placed and what might the command look like in the
> context shown above?
>
> And, in the context of the code above, can I assume a << cocurrent
> 'base' >> command is required following the "pshow", or should that
> switch be made before the << wd 'pshow' >> statement?
>
> Or is it essential that the pop-up form itself be in its own locale
> and that floating-in-the-script commands are the only way to go as in
> the wiki examples?
>
> Bjorn Helgason says he has code examples in a Google user chat
> group. If one of those examples covers the general situation
> sketched above, I'll sign on to the group and take a look; otherwise,
> I don't like to sign into much on the Web unless the need is vital.
>
> Actual code I've developed is now too extensive to include in an
> email, so I'm hoping the description above will be good enough as a
> basis for any help.
>
> Thanks,
>
> Donald Pittenger
--
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