• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

[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.
  • C Offline
    chrisglasier
    last edited by 14 Mar 2010, 09:05

    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
    • T Offline
      thomthom
      last edited by 14 Mar 2010, 10:59

      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
      • C Offline
        chrisglasier
        last edited by 14 Mar 2010, 11:05

        @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
        • T Offline
          thomthom
          last edited by 14 Mar 2010, 11:07

          
          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
          • C Offline
            chrisglasier
            last edited by 14 Mar 2010, 11:11

            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 14 Mar 2010, 14:20

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

              Hi

              1 Reply Last reply Reply Quote 0
              • C Offline
                chrisglasier
                last edited by 14 Mar 2010, 15:55

                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
                1 / 1
                • First post
                  1/7
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement