Callbacks problem

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2009
Callbacks problem

Hi.

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?

Thanks.

Josť
 
  01 January 2009
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\\test.ms"
format "print \"TESTING, 1 2 3\"" to: f
close f

-- set up callback in listener
callbacks.addscript #filePostOpen fileName:("$temp\\test.ms") id:#new persistent: true
-- save the max file
saveMaxFile "t.max"
-- load the max file
loadMaxFile "t.max"
"TESTING, 1 2 3"
true
-- hey presto
 
-- remove the callbacks
callbacks.removescripts()
saveMaxFile "t.max"
-- make sure it's gone
loadMaxFile "t.max"
true
-- 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\\test.ms") 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"
true
-- hooray!
 
  01 January 2009
The script is saved to a network address

"//server10//dfs//temp//mvg//test01_mvg.ms"


Using "doesFileExists" results in true however setting a callback with that path using a script gives me callback filein exceptions.
 
  01 January 2009
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.
 
  01 January 2009
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 10:31 PM.


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