ETO "ShowModal" fail after SR 13 canidate update

Hey,

After updating to the Rhino 6 SR 13 canidate release, my eto form component is throwing an error “1. Solution exception:Multiple targets could match: ShowModal(Control), ShowModal(Control)”

I’m still trying to get the hang of using these forms but I’m just following the template code for making forms using eto.

I have tested on a computer running SR12 and it still works fine.

Is anyone else encountering this issue?

Same thing happens when i create a fresh python component in grasshopper and paste in the code from this ETO template https://developer.rhino3d.com/guides/rhinopython/eto-forms-python/

I see there is a simlar issue not solely ETO related
Latest update broke rs.BrowseForFolder

1 Like

Hi @nbarnes,

This sample command still seems to work.

https://github.com/mcneel/rhino-developer-samples/blob/6/rhinocommon/cs/SampleCsEto/Commands/SampleCsEtoModalDialogCommand.cs

What am I missing?

– Dale

Hi Dale,

Perhaps it is an issue only on the python side? Or it could be my machine.

Can you try this sample code in a python component in grasshopper? Sorry, I’m not very familer with how to paste code into the correct formating on the page. this is from The Eto framework

import scriptcontext
import System
import Rhino.UI
import Eto.Drawing as drawing
import Eto.Forms as forms

class SampleEtoRoomNumberDialog(forms.Dialog[bool]):

    
    def __init__(self):
        # Initialize dialog box
        self.Title = 'Sample Eto: Room Number'
        self.Padding = drawing.Padding(10)
        self.Resizable = False

        # Create controls for the dialog
        self.m_label = forms.Label(Text = 'Enter the Room Number:')
        self.m_textbox = forms.TextBox(Text = None)

        # Create the default button
        self.DefaultButton = forms.Button(Text = 'OK')
        self.DefaultButton.Click += self.OnOKButtonClick

        # Create the abort button
        self.AbortButton = forms.Button(Text = 'Cancel')
        self.AbortButton.Click += self.OnCloseButtonClick

        # Create a table layout and add all the controls
        layout = forms.DynamicLayout()
        layout.Spacing = drawing.Size(5, 5)
        layout.AddRow(self.m_label, self.m_textbox)
        layout.AddRow(None) # spacer
        layout.AddRow(self.DefaultButton, self.AbortButton)

        # Set the dialog content
        self.Content = layout

    # Start of the class functions

    # Get the value of the textbox
    def GetText(self):
        return self.m_textbox.Text

    # Close button click handler
    def OnCloseButtonClick(self, sender, e):
        self.m_textbox.Text = ""
        self.Close(False)

    # OK button click handler
    def OnOKButtonClick(self, sender, e):
        if self.m_textbox.Text == "":
            self.Close(False)
        else:
            self.Close(True)

    ## End of Dialog Class ##
def RequestRoomNumber():
    dialog = SampleEtoRoomNumberDialog();
    rc = dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
    if (rc):
        print dialog.GetText() #Print the Room Number from the dialog control
RequestRoomNumber()

Thanks - I’ve logged the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-50633

– Dale

1 Like

RH-50633 is fixed in the latest Service Release Candidate

1 Like

Enclose code in triple-backticks. I edited your post as example.

1 Like