Hide components panel on close
-
I am making a few posts atm but thats because im hurrying to meet a deadline
this problem is that I want my components panel to close when sketchup closes. is there an on event close function that I could use?
-
Yup, look at the AppObserver.
http://code.google.com/apis/sketchup/docs/ourdoc/appobserver.html
Chris
-
@chris fullmer said:
Yup, look at the AppObserver.
http://code.google.com/apis/sketchup/docs/ourdoc/appobserver.html
Chris
I just had a look at that and it seems to be what I am looking for but when I put
def onQuit() UI.messagebox("onQuit; ") end
into my .rb file nothing seems to happen no messagebox appears
-
It has to be put into a class and you have to instantiate the class as a tool. And you also have to attach an observer to the Sketchup object.
Check out the full example in the introduction paragraph on that page. It shows better how to use it in context.
Chris
-
@chris fullmer said:
you have to instantiate the class as a tool.
well I need it to hide when sketchup closes not on a tool press. you got any ideas on how I cans et this up to close on sketcup close. I have managed to get it to apepar on sketchup open. but its just closeing it
-
@chris fullmer said:
It has to be put into a class and you have to instantiate the class as a tool. And you also have to attach an observer to the Sketchup object.
Check out the full example in the introduction paragraph on that page. It shows better how to use it in context.
Chris
Apart from onQuit is broken on Mac OSX which is annoying.
Also be aware that these "stuff has finished / been deleted" generally get invoked after the fact so don't expect to get useful info from the objects in question.
Adam
Advertisement