Skip to content

Commit

Permalink
Minor addition to SampleEtoColorDropDown.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dalefugier committed Apr 8, 2020
1 parent 34344d0 commit 4185737
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rhinopython/SampleEtoColorDropDown.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
################################################################################
Expand All @@ -73,4 +78,4 @@ def TestSampleEtoColorDropDownDialog():
# This allows us to use the module which ever way we want.
################################################################################
if __name__ == "__main__":
TestSampleEtoColorDropDownDialog()
TestSampleEtoColorDropDownDialog()

0 comments on commit 4185737

Please sign in to comment.