sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Hide components panel on close

    scheduled pinned locked moved Developers' Forum
    6 Posts 3 Posters 279 Views 3 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • S Offline
      simonstaton
      last edited by

      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?

      one-reply-to-this-post last-reply-time reply quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        Yup, look at the AppObserver.

        http://code.google.com/apis/sketchup/docs/ourdoc/appobserver.html

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        one-reply-to-this-post last-reply-time reply quote 0
        • S Offline
          simonstaton
          last edited by

          @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

          one-reply-to-this-post last-reply-time reply quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            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

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            one-reply-to-this-post last-reply-time reply quote 0
            • S Offline
              simonstaton
              last edited by

              @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

              one-reply-to-this-post last-reply-time reply quote 0
              • AdamBA Offline
                AdamB
                last edited by

                @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

                Developer of LightUp Click for website

                one-reply-to-this-post last-reply-time reply quote 0
                • 1 / 1
                • first-post
                  last-post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement