Created
January 30, 2012 01:39
-
-
Save sycobuny/1701849 to your computer and use it in GitHub Desktop.
Get the selection of a wx.ComboBox in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# line 37 in llm/view/dialog/library/abstract.py | |
self.type = wx.ComboBox(panel, | |
-1, | |
choices=["CD/DVD/Blu-Ray", "Book/Magazine"], | |
style=wx.CB_READONLY) | |
sbs.Add(self.build_line(wx.StaticText(panel, -1, "Type:"), self.type)) | |
# new line 51 in llm/view/dialog/library/abstract.py | |
choices_d = ['None'] | |
choices_i = [None] | |
for data in patron_data: | |
dd = "%s %s (%d)" % (data["first_name"], | |
data["last_name"], | |
data["id"]) | |
choices_d.append(dd) | |
choices_i.append(data["id"]) | |
self.id_map = choices_i | |
# somewhere else in that file | |
def get_selected_cob_id(self): | |
sel = self.checked_out_by.GetCurrentSelection() | |
return self.id_map[sel] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# at line 113 in llm/controller.py | |
item_data = {"name" : self.add_lib_item_dlg.name.GetValue(), | |
"author_first" : self.add_lib_item_dlg.author_first_name.GetValue(), | |
"author_last" : self.add_lib_item_dlg.author_last_name.GetValue(), | |
"desc" : self.add_lib_item_dlg.desc.GetValue(), | |
"type" : self.add_lib_item_dlg.type.GetValue(), | |
"cob" : self.add_lib_item_dlg.get_selected_cob_id(), | |
"id" : 0} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment