• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Yet another SavePanel question

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 243 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    talig
    last edited by 4 Jun 2009, 22:52

    Hi everyone,
    I have a savepanel question for you guys.
    Is there any way to tell from the code if a savepanel was closed using "Cancel" or using "Ok"? Tried the documentation, didn't find any access to that particular thing.
    Maybe you know if this sets some bit or something like that?

    Thanks a bundle,

    • TaliG

    Avatar: all rights reserved to Bryan Eppihimer

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 5 Jun 2009, 06:19

      The manual says it returns nil if the user cancels. Is that not so?

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 5 Jun 2009, 14:47

        I think savepanel returns the selected path and filename as a String, or either false or nil when the Cancel button is used.

        
        
        file = UI.savepanel
        
        if file
          # maybe check for other possible bad input,
          # do something useful with file.
        else
          # use hit cancel
        end
        
        
        

        Hi

        1 Reply Last reply Reply Quote 0
        • T Offline
          talig
          last edited by 9 Jun 2009, 09:56

          I'm pretty sure I've tried these. I'll try it again...

          Avatar: all rights reserved to Bryan Eppihimer

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 9 Jun 2009, 10:05

            Test the return value. The manual has been wrong before. It might be false or en empty string.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              4/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement