J7 gtk using cairo. Expect much slower than j602.
require 'gui/gtk'
coinsert 'jgtk'
L0=: 50 NB. initial length
A0=: 1r8p1 NB. initial angle: pi divided by 8
dL=: 0.9 NB. shrink factor for length
dA=: 0.75 NB. shrink factor for angle
N=: 14 NB. number of branches
L=: L0*dL^1+i.N NB. lengths of line segments
NB. relative angles of successive line segments
A=: A0*(dA^i.N) +/\@:*("1) _1 ^ #:i.2 ^ N
NB. end points for each line segment
P=: 0 0+/\@,"2 +.*.inv (L0,0),"2 L,"0"1 A
gtk_show=: 3 : 0
pdcmdprint=: 0
gtkinit ''
newwindow 'graph'
locGB=: 540 400 conew 'jgtkcanvas'
coinsert__locGB coname''
gtk_container_add window,gtkbox__locGB
windowfinish''
if. -.IFGTK do. gtk_main '' end.
)
paint=: 3 : 0
gllines (10 + ,/"2 P-"1<./,/P)
0
)
window_delete=: 0:
gtk_show ''
Втр, 29 Июн 2010, Raul Miller писал(а):
> On Tue, Jun 29, 2010 at 3:07 PM, Eric Iverson <[email protected]>
> wrote:
> > The abc form requires a wd'reset' and that isn't very nice. Change the pc
> > line to be:
> > pc abc closeok;
> > to allow the close.
>
> I did this, and am using gllines, for now:
>
> http://rosettacode.org/wiki/Fractal_tree#J
>
> Thank you,
--
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