While trying to create a gl2 version of the GUI for the Set Game
<http://www.jsoftware.com/jwiki/Scripts/Set_Game>, I found that to get
the multiple isigraph controls to smoothly respond to resizing the form,
I had to create a separate paint handler verb for each isigraph control.
I understand that this works because resizing the form will
automatically trigger the verb <formid>_<controlid>_paint for each
control affected if it exists.

I thought I could get around this by using:
setgl2_p0_paint=: 3 : 0
  (i.#H) setpaint"0 1 H
)

setpaint=: 4 : 0
  glsel 'p'&,@": x
  SYMBSZ=: getSymbSz glqwh''
  glclear ''
  drawsymb y
  glpaint ''
)

Where H is and 12 row boxed matrix:
+-----+-----+-------+--------+
|three|blue |shaded |diamond |
+-----+-----+-------+--------+
|three|green|outline|diamond |
+-----+-----+-------+--------+
...
+-----+-----+-------+--------+
|two  |green|solid  |diamond |
+-----+-----+-------+--------+

That is, anytime the setgl2_p0_paint verb was called to update the p0
isigraph control, it would also update all the other isigraph controls
(p1-p11). That doesn't work though and I ended up having to define all
of:
setgl2_p1_paint=:  3 :  '1 setpaint  1{H'
setgl2_p2_paint=:  3 :  '2 setpaint  2{H'
...
setgl2_p11_paint=: 3 : '11 setpaint 11{H'


Is there anyway to simplify this?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to