diff --git a/rhinopython/SampleEtoColorDropDown.py b/rhinopython/SampleEtoColorDropDown.py index 678aa6eb..b7c6f059 100644 --- a/rhinopython/SampleEtoColorDropDown.py +++ b/rhinopython/SampleEtoColorDropDown.py @@ -1,6 +1,6 @@ ################################################################################ # SampleEtoColorDropDown.py -# Copyright (c) 2017 Robert McNeel & Associates. +# Copyright (c) 2020 Robert McNeel & Associates. # See License.md in the root of this repository for details. ################################################################################ import System @@ -40,6 +40,7 @@ def __init__(self, colors): self.m_dropdown = SampleEtoColorDropDown(colors) self.m_dropdown.SelectedIndex = 0 + self.m_dropdown.SelectedIndexChanged += self.OnSelectedIndexChanged layout = forms.DynamicLayout() layout.Padding = drawing.Padding(10) @@ -48,7 +49,11 @@ def __init__(self, colors): layout.Add(None, None, True) self.Content = layout - + + def OnSelectedIndexChanged(self, sender, e): + msg = "DropDown.SelectedIndexChanged, Value: {0}".format(self.m_dropdown.SelectedIndex) + print(msg) + ################################################################################ # Function to test the dialog ################################################################################ @@ -73,4 +78,4 @@ def TestSampleEtoColorDropDownDialog(): # This allows us to use the module which ever way we want. ################################################################################ if __name__ == "__main__": - TestSampleEtoColorDropDownDialog() + TestSampleEtoColorDropDownDialog() \ No newline at end of file