Callbacks problem

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 01 January 2009   #1
Callbacks problem


For some reason callbacks behave differently when excuted from a script then when executed from the listener window. The problem i am having is when assigning a fileIn #filePostOpen callback. The callback refuses to load the script when i ser the callback from script, but it works fine when i do the same thing in the listener window.

callbacks.addscript #filePostOpen fileName:("path...") id:#new persistent: true

I get a callback fileIn exception when i set the callback from script.

Anyone know why this happens or a good workaround?


Old 01 January 2009   #2
think we might need more information than that.. what's the script you're trying to set it in?

the below worked fine, at least...

-- just a file to work with
f = createFile "$temp\\"
format "print \"TESTING, 1 2 3\"" to: f
close f

-- set up callback in listener
callbacks.addscript #filePostOpen fileName:("$temp\\") id:#new persistent: true
-- save the max file
saveMaxFile "t.max"
-- load the max file
loadMaxFile "t.max"
"TESTING, 1 2 3"
-- hey presto
-- remove the callbacks
saveMaxFile "t.max"
-- make sure it's gone
loadMaxFile "t.max"
-- good, good

-- now for a non-listener test... a button!
rollout roll_test "test" (
	button btn_test "test"
	on btn_test pressed do (
		callbacks.addscript #filePostOpen fileName:("$temp\\") id:#new persistent: true
createDialog roll_test
-- press button here
-- ...
-- no errors, let's continue
saveMaxFile "t.max"
loadMaxFile "t.max"
"TESTING, 1 2 3"
-- hooray!
Old 01 January 2009   #3
The script is saved to a network address


Using "doesFileExists" results in true however setting a callback with that path using a script gives me callback filein exceptions.
Old 01 January 2009   #4
In the end i decided to not use an external script but instead build the script into the callback. I never found out why i couldn't get the ms file to load properly.
Old 01 January 2009   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:45 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.