I believe platimg is using GTK+. Please see if
it crashes too. If not than you may have problems
with the signatures or parameters. I don't see any
error checks, they can make a difference between
a crash and assertion where you can check the parameters.
I also strongly recommend using the ">" qualifier for
cd signature.
In fact I would even suggest that it is
made the default behavior if not the only one.
Using "symdat" from general/pcall make the pattern
of calling by reference into calling "by name"
just as in C--just my nickel's worth.
--- bill lam <[EMAIL PROTECTED]> wrote:
> I tried to call gtk+ 2.0 using cd. It can display a window in winxp. However
> it
> causes segmentation fault on the "gtk_init" under j601c ubuntu both jconsole
> and
> jw. I cannot isolate the cause (eg. gtk ubuntu j601 or my code). Can anyone
> help to debug or confirm that it also crashes?
>
> NB. gdemo.ijs
> NB. =========================================================
> require 'dll libpath'
>
> cocurrent 'z'
>
> symdat=: 3 : 0 NB. symdat symget <'name'
> had=. {.memr y,(IF64{4 8),1,JPTR
> had+{.memr had,0,1,JPTR
> )
>
> iad=: [EMAIL PROTECTED]@boxopen
> vad=: <@:iad
>
> cocurrent 'base'
>
> NB. choose window or linux
> 3 : 0''
> if. IFUNIX do.
> libgtk=: find_dll 'gtk-x11-2.0'
> else.
> libgtk=: 'libgtk-win32-2.0-0.dll'
> end.
> i.0 0
> )
>
> gtk_init=: (libgtk, ' gtk_init + n *x x')&cd
> gtk_window_new=: (libgtk, ' gtk_window_new + x x')&cd
> gtk_widget_show=: (libgtk, ' gtk_widget_show + n x')&cd
> gtk_main=: (libgtk, ' gtk_main + n')&cd
> GTK_WINDOW_TOPLEVEL=: 0
>
> jgtk_init=: 3 : 0
> argv=. 0,~ (iad 'argv0') + 0, }:I. ({.a.) = argv0=. ;ARGV ,&.> {.a.
> narg=. {. 1{:: gtk_init (,#ARGV) (;<) iad 'argv'
> arg=. ''
> for_p. narg{.argv do.
> arg=. arg, <memr p, 0 _1 2
> end.
> ARGV_z_=: arg
> )
>
> main=: 3 : 0
> window=: 0
> jgtk_init ''
> window=: 0{:: gtk_window_new <GTK_WINDOW_TOPLEVEL
> gtk_widget_show <window
> gtk_main ''
> 0
> )
>
> NB. =========================================================
> NB. main ''
>
> --
> regards,
> bill
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm