This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is there a difference between applets and non-applets in terms of variable initialization?


I have some code which runs fine when compiled with --main, but has problems
with un-initialized variables when compiled with --applet.

I'm requiring a file which contains several variables. The variables are
module-exported. Each variable is initialized by calling a procedure,
something like this:

; style for links

(define style-link (make-attribute-set))

(set-style-attributes style-link 'bold)

When I try to use style-links in the requiring file, I get a null pointer
exception when running the code compiled as an applet. So it seems that the
initialization, ie. (make-attribute-set), isn't being called when the file
is required. This problem doesn't occur when compiled with --main.

Is there any way I can work around this, or something I'm missing? One
option would be to move all my variable initializations into an "init"
procedure, and call that in the applet's "start" proc, but I'd rather not
have to do this.

thanks,
Alex



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]