Inputbox and SU2023

I thought everything was fine with my plugins and SU 2023, however I still use the UI.inputbox method in a number of my tools (probably should have switched everything to HTML menus a while ago).

For some reason the input array (@Inputs1) is coming up as “false”.

Nothing in my code has changed and it worked fine before SU 2023, what has changed?

My tool calls the following code:

prompts1 = ["Truss Type: ", "Out-to-out Span (ft.): ", "Top chord Pitch (x/12): ", "Overhang Left (in.): ", "Overhang Right (in.): ", "TC Size (in.): ", "BC Size (in.): ", "Web Size (in.): ", "Ply Thickness (in.): ", "Raised Heel: ", "Heel Height (in.): "]
defaults1 = ["#{@Trusstype}", "#{@TrussSpan_ft.round(5)}", "#{@Pitch}", "#{@Overhangl}", "#{@Overhangr}", "#{@Tcd}", "#{@Bcd}", "#{@Webd}", "#{@Ply}", "#{@Raisedheel}", "#{@Usrhh}"]
list1 = ["King Post|Queen Post|Fink|Howe|Fan|Mod Queen|Double Fink|Double Howe|Mod Fan|Triple Fink|Triple Howe|Quad Fink", "", "2.5|3.0|3.5|4.0|4.5|5.0|5.5|6.0|6.5|7.0|7.5|8.0|8.5|9.0|9.5|10.0|10.5|11.0|11.5|12.0|12.5|13.0|13.5|14.0|14.5|15.0|15.5|16.0", "", "", "3.5|5.5|7.25|9.25|9.5|11.25|11.875|14.0|16.0", "3.5|5.5|7.25|9.25|9.5|11.25|11.875|14.0|16.0", "3.5|5.5|7.25|9.25|11.25", "", "NO|YES", ""]
 		
@Inputs1 = UI.inputbox(prompts1, defaults1, list1, "#{MDK_TRUSS} - Geometry")

Wondering if this might have something to do with the new overlay feature?

1 Like

This is quite catastrophic for me, since a lot of my menus still use the older inputbox, so that means all of them are not working in SU 2023. I need to figure this out and figure it out quick, so I can take corrective action.

I’m also wondering if it has something to do with me calling the input box outside of the tool (???):

when STATE_PICK_LAST
	Sketchup.active_model.select_tool(nil)
        self.calculate_obj

	self.reset

        # Sketchup.active_model.select_tool(nil)
	
    end

Its really quite bizarre, the input menu is completely frozen, it displays like it normally does but you can’t move it or change any of the parameters:

I just ran my exact same version of the code in SU 2022 and there are no problems so it would seem something has changed or is different in SU 2023.

When I use HTML menus there does not seem to be any issue however when I use the more traditional UI.inputbox, and it is called from any of my tools then it shows the input but it is completely frozen.

At the moment I am at a complete loss, have no idea what the issue is, there really are no deprecation errors or anything else showing up in the Ruby console.

Does the menu work again if you alt-tab out of SketchUp and back again? If so - I ran into the same (sort of) problem. Have to wait for the SketchUp team to fix it.
See here SketchUp 2023 - changes to UI.inputbox focus? - #2 by DanRathbun

I’ve never tried this before but I will try and report back. Just read the other thread you provided and I am glad Dan is already on top of it, and has provided some clarity. Just hoping that a resolution is forthcoming in the very near future since this significantly impacts the Truss and Foundation plugins. My newer plugins (Wall, Electrical, Project) have all switched to HTML menus so they are not impacted.

Hoping along with you that a quick fix will come soon.

Well the good news is that pressing alt-tab seems to work. The bad new is that this is a bit of clunky work around but at least I can provide something to my user base so that they can keep using the Truss and Foundation plugin within SU 2023 until a fix is released.

As soon as the inputbox appears, press alt-tab and then refocus back on the menu, it works!

FOCUS

Clicking on the inputbox window should give it focus.
(But note that there was long-standing bug with regard to the tab order of inputbox controls.)

Here is a little test for inputbox focus.

def input_test
  Sketchup.focus
  test_1()
  test_2()
end

def test_1
  sleep 1.0
  UI.inputbox(["First Name"],[],[],"Test 1")
end

def test_2
  sleep 1.0
  UI.inputbox(["Last Name"],[],[],"Test 2")
end

BTW, ALT+TAB followed by ALT+TAB does not work for me on Win10. I still must click the inputbox window. (I am of the habit of clicking on dialog caption bars when I want to focus them)

1 Like

MODALITY

Using the above test, you can also manually grab and move the inputbox to another place, then without closing it, switch back to the console and rerun the test.

You’ll see additional inputboxes.

This should not happen as inputboxes are (normally) application modal.

2 Likes

As per our discussion at the developers meeting:

@ChrisFullmer

@thomthom

This fixed inpubox ?

What about messageboxes ? or modal HTML dialogs ?

The inputbox works again.Thanks for the fix SU-team.