Define the width of a inputbox

hello,

is there any way to define the width of the standard inputbox via ruby?

i have some longer expressions and they are not shown in whole length in the input fields.

thanx
stan

The .UI.inputbox(*args) ⇒ Array, false
aim is to create a simple dialog box for inputting user information, but unfortunately you do not have so much influence how it will look like. It have its own limitation and - as you discovered some small bugs…

You have to use the HtmlDialog class that allows you to create “much better” dialog boxes…

2 Likes

One of the bugs is that the width of the inputs are set to the widest of the prompts.

hi dan,
thanx for that info . problem easily solved :slight_smile:

extra array of prompts for the menue with a longer empty string added :slight_smile:
and voila :slight_smile:
regards
stan

Yeah, it’ not ideal, but it is a workaround.

We have a boiler plate example for an inputbox replacement that’s a good start: GitHub - SketchUp/htmldialog-inputbox: UI::HtmlDialog example recreating UI.inputbox functionality in the SketchUp Ruby API

hello, after a longer period i am back in the ruby project. thanx a lot, i saw the github example, but i must confess…i am confused, how to use it. i understand, that i need a rb, js and html files .

is there somewhere an example to download, which generates an inputbox with some lines for numerical or string input, i could download, study and modify? (just to understand , how ruby calls the js, which shows in html and how it sends the data back).

i only need a simple pendant to the old inputbox, only for the scrolling option (when too many parameters have to be desplayed.

thanx a lot

stan

For example, you can check “Examples and Tutorials” section in:

The are simple examples in the GitHub repository’s README doc:
htmldialog-inputbox/README.md at main · SketchUp/htmldialog-inputbox · GitHub

The whole point of that HtmlUI library is that you do not need to understand how the Ruby ↔ JS communication works.

You just use it as described.

hi dan,
a big mountain, i start…

thanx fpr the links :slight_smile:
stan