sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    [Web dialog] switch snippet for pc / mac

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 299 Views 3 Watching
    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.
    • chrisglasierC Offline
      chrisglasier
      last edited by

      I understand from driven that macs use show_modal rather than show. Assuming everything else is OK can anyone give me a snippet to detect the OS or whatever and direct to the correct command.

      Thanks

      Chris

      With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Yes - webdialogs on OSX isn't parent to the SU window unless you use .show_modal - and .show_modal isn't modal on OSX. 😞

        
        def self.is_mac?
          return (Object;;RUBY_PLATFORM =~ /darwin/i) ? true ; false
        end
        
        

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

        1 Reply Last reply Reply Quote 0
        • chrisglasierC Offline
          chrisglasier
          last edited by

          @thomthom said:

          Yes - webdialogs on OSX isn't parent to the SU window unless you use .show_modal - and .show_modal isn't modal on OSX. 😞

          
          > def self.is_mac?
          >   return (Object;;RUBY_PLATFORM =~ /darwin/i) ? true ; false
          > end
          > 
          

          and then how to do the if bit?

          Sorry to be a pain.

          Thanks

          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            
            if is_mac?
              webdialog.show_modal
            else
              webdialog.show
            end
            
            

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

            1 Reply Last reply Reply Quote 0
            • chrisglasierC Offline
              chrisglasier
              last edited by

              Thanks. I'm a bit weary of Ruby + Mac when I cannot test it!

              With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jim
                last edited by

                Did you mean weary of Ruby + wary of Macs? πŸ˜„

                Hi

                1 Reply Last reply Reply Quote 0
                • chrisglasierC Offline
                  chrisglasier
                  last edited by

                  To make or to become weary; A feeling of being mentally fatigued; Expressive of fatigue

                  Wary: marked by keen caution and watchful prudence;

                  Either I think is appropriate.

                  But more important cgScenes might well become compatible - some kind of milestone in PC/Mac WD compatibility perhaps.

                  With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                  1 Reply Last reply 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