Coding for user input to be easier

I’m not an elegant or experienced programmer, but I have been recently trying to get user input for the parameters of a ruby Tool.

The Ruby InputBox is just a bit too simple. And buggy on Mac - prompt strings are arbitrarily truncated.

And a WebDialog is far too hard to use, with only too-simple or much too-complex examples to get me started.

I just want something a bit more versatile than an InputBox and either a ‘pre-cooked’ but customizable WebDialog, or a simpler replacement, that deals in a black box with the complexities of Mac asynchronous messaging between Ruby and JavaScript.

ThomThom’s SKUI plugin goes part way there, and in principle his examples.rb provides a starting point. But it still isn’t simple to get the user’s webdialog input back into Ruby.

1 Like

I agree,
a dialog tool set similar to what can use in VBA, with inbuilt options, check boxes, that parks itself within the new system tray would suit me, then no need for web Dialog.

Agreed it would be nice.

It is also a bit heavy on the objectspace for simple inputboxes.

We can discuss how to do it easier currently with WebDialogs, specifically in the following thread:

… and keep this thread going on the subject of something easier.

Been thinking of this. Extract the bridge from SKUI into a generic JS you can simply add to your HTML. Then a Ruby subclass of UI::WebDialog to handle the communication on the other end.

That would take care of the communication and it’d be simple to add UI frameworks like Bootstrap etc, or whatever your preference is.

Thank you both, Dan and Thomas, for such encouraging replies.

Dan, I’m looking at your link, and think I understand well enough to try and use it. Will be busy for several days first drawing the designs for our Christmas show “Wind in the Willows”. We did it in 2003, but hired most of the scenery. This time we want to make it. A working river with water, two boats, a boat’s part-hull upturned, a gipsy caravan, Toad’s motor car, and a railway loco!

Plenty of drawing, and even more construction time, and only a couple of months to do the construction with a very part-time construction crew.

Thomas, I’m not at the moment thinking of anything more complex than HTML, JS, and maybe a little CSS. I hadn’t even heard of Bootstrap, let alone thought of using it!

Making use of frameworks really simplify a lot of the boilerplate work. Bootstrap is pretty minimal - giving you building blocks to add your UI component.

In terms of a tutorial an example of Bootstrap, or similar framework, would be separate.

Thanks. I’ll look it up and see how to use it, maybe give it a try.

Well my comment in that thread, assumes the person knows Javascript and how to collect values from their input elements into a CSV string.

I’ll see if I can find some time to add some “collector” JS function examples.

I think I know enough JS to do that, but I always find examples extremely helpful.

1 Like