diff --git a/rhinopython/SampleEtoColorDropDown.py b/rhinopython/SampleEtoColorDropDown.py index b7c6f059..9793fe90 100644 --- a/rhinopython/SampleEtoColorDropDown.py +++ b/rhinopython/SampleEtoColorDropDown.py @@ -42,16 +42,22 @@ def __init__(self, colors): self.m_dropdown.SelectedIndex = 0 self.m_dropdown.SelectedIndexChanged += self.OnSelectedIndexChanged + self.m_label = forms.Label() + self.m_label.Text = self.m_dropdown.Items[0].Text + layout = forms.DynamicLayout() layout.Padding = drawing.Padding(10) layout.Spacing = drawing.Size(5, 5) + layout.AddRow("Name:", self.m_label, None) layout.AddRow("Color:", self.m_dropdown, None) layout.Add(None, None, True) self.Content = layout def OnSelectedIndexChanged(self, sender, e): - msg = "DropDown.SelectedIndexChanged, Value: {0}".format(self.m_dropdown.SelectedIndex) + idx = self.m_dropdown.SelectedIndex + self.m_label.Text = self.m_dropdown.Items[idx].Text + msg = "DropDown.SelectedIndexChanged, Value: {0}".format(idx) print(msg) ################################################################################