just find the new gui/gtk addon in JAL,a great job!
it works fine on linux,however i want to use it on a win64(x86) box.
the first step is change the dll binding(after install the gtk windows runtime):
=========================================================
[OLD]
gtkinitapi=: 3 : 0
libgtkid=. ({.~ i.&'-')@({.~ i.&'.') L:0 Gtklinuxso
(libgtkid)=: find_dll@(3&}.) each Gtklinuxso
0!:100 GtkAPI
)

Gtklinuxso=: <;._2 (0 : 0)
libgdk-x11-2.0
libglib-2.0
libgobject-2.0
libgtk-x11-2.0
)
 =========================================================
[NEW]
gtkinitapi=: 3 : 0
if. IFUNIX do.
  libgtkid=. ({.~ i.&'-')@({.~ i.&'.') L:0 Gtklinuxso
  (libgtkid)=: find_dll@(3&}.) each Gtklinuxso
else.
  libgtkid=. ({.~ i.&'-')@({.~ i.&'.') L:0 Gtkwinso
  (libgtkid)=: (,&'.dll')  each Gtkwinso
end.
0!:100 GtkAPI
)

Gtkwinso=: <;._2 (0 : 0)
libgdk-win32-2.0-0
libglib-2.0-0
libgobject-2.0-0
libgtk-win32-2.0-0
)

Gtklinuxso=: <;._2 (0 : 0)
libgdk-x11-2.0
libglib-2.0
libgobject-2.0
libgtk-x11-2.0
)
=========================================================
the tut1.ijs demo script works(but when close the window jconsole also hangs).
the other scripts fails for callback register:

gtkinitcallback=: 3 : 0
if. 0 ~: 4!:0 <'id_jcallbacknoun_' do.
  id_jcallbacknoun_=: mema IF64{4 8
  addrVerb_jcallbacknoun_=: 0 2$''
end.
if. IFUNIX do.
  cdcbc=: cdcb
  caddcallback=: addcallback
end.
gtkCallbacks=: ''
EMPTY
)

addcallback=: 3 : 0
'narg cb'=. y
if. hascallback cb do. 0 return. end.  NB. callback name collision
addr=. mema 32
addrVerb_jcallbacknoun_=: addrVerb_jcallbacknoun_, addr ; (1&u: ::]) cb
if. IF64 do.
  (addr,0 32 2) memw~ 32{.(!.(16b90{a.)) (16b48 16bb8{a.),(3&ic
addr),(16b48 16ba3{a.),(3&ic id_jcallbacknoun_),(16b48 16bb8{a.),(3&ic
cdcb narg),(16bff 16be0{a.)
else.
  (addr,0 32 2) memw~ 32{.(!.(16b90{a.)) (16bb8{a.),(2&ic
addr),(16ba3{a.),(2&ic id_jcallbacknoun_),(16bb8{a.),(2&ic cdcb
narg),(16bff 16be0{a.)
end.
addr
)

if just remove the IFUNIX condition,the process will crash.
is there a simple way to modify the addcallback verb to support windows?
Thanks.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to