sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    FxRuby and GUI's

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 4 Posters 886 Views 4 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.
    • T Offline
      tomot
      last edited by

      Is is possible to mix or incorporate FxRuby with SU Ruby
      in order to produce better GUI's?

      http://www.fxruby.org/doc/examples.html

      [my plugins](http://thingsvirtual.blogspot.ca/)
      tomot

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

        I'm sure this has been tried before, not specifically using the Fox kit, but with GTK, or WxWindows... I've still never seen a working example. I think it is possible to do, but it must be harder than it first appears. There needs to be some type of software "connector" in between SU and the UI. Perhaps TBD will add his expertise.

        WebDialogs are way better than the inputbox dialog interface, but require that you know HTML and a little Javascript. They are your best option for GUI's, although it would be nicer if there were some Widgets we could use out-of-the-box.

        Hi

        1 Reply Last reply Reply Quote 0
        • T Offline
          todd burch
          last edited by

          @jim said:

          ...although it would be nicer if there were some Widgets we could use out-of-the-box.

          Jim, can you give me an example of what you mean?

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

            Checkboxes, dropdowns, text inputs. I'm thinking of the dialog being created on the fly from prompt strings and variables.

            
            webdialog.add_widget(CHECKBOX, "Label", ruby_variable_binding)
            webdialog.add_widget(DROPDOWN, %w( opt1 opt2 opt3 ), default_opt, ruby_variable_binding)
            webdialog.add_widget(SLIDER, min, max, width, "label", ruby_variable_binding)
            values = webdialog.display
            
            

            and that would be the complete dialog code in a plugin.

            Hi

            1 Reply Last reply Reply Quote 0
            • W Offline
              wikii
              last edited by

              FxRuby is really cool to extend SU_Ruby!


              Run a fxRuby program in SU

              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                @jim said:

                Checkboxes, dropdowns, text inputs. I'm thinking of the dialog being created on the fly from prompt strings and variables.

                
                > webdialog.add_widget(CHECKBOX, "Label", ruby_variable_binding)
                > webdialog.add_widget(DROPDOWN, %w( opt1 opt2 opt3 ), default_opt, ruby_variable_binding)
                > webdialog.add_widget(SLIDER, min, max, width, "label", ruby_variable_binding)
                > values = webdialog.display
                > 
                

                and that would be the complete dialog code in a plugin.

                That could be done. If I get it started and working, would you take it over?

                (Oh, and nice job wikii!)

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

                  @unknownuser said:

                  That could be done. If I get it started and working, would you take it over?

                  Thanks but no. I'm not ready to think about it right now; and the example I gave was just off the top of my head. It's not a 5 minute script, but more like a 5 month project to do it right. I need to actually understand Javascript first; instead of copying examples I find online. 😳

                  I want to work on creating a consistent and simple interface for all observers. I think I have a good pattern now for them. I'll start a new thread for it, although I gave an example here.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • W Offline
                    wikii
                    last edited by

                    Run following code in Sketchup , when I click the button "Quit", The promopte "Quit has been clicked!" can be printed,but dialog does't disappear . It sames that method "exit" for application can't finish the program in Sketchup! But in Ruby 1.8 , it works well. Why? ❓

                    require 'fox16'
                    include Fox
                    application = FXApp.new("Hello", "FoxTest")
                    main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
                    a_button=FXButton.new(main, "&Quit!", nil, application, FXApp;;ID_QUIT)
                    a_button.connect(SEL_COMMAND){
                    p "Quit has been clicked!"
                    application.exit
                    }
                    application.create()
                    main.show(PLACEMENT_SCREEN)
                    application.run()
                    
                    

                    hello.jpg

                    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