[Tutor] WG:

Werkstudent 010 010.Werkstudent@MCHF.SIEMENS.DE
Tue, 1 Jun 1999 16:01:30 +0200


> Hi, this  is an appeal to Pythonwin experts!
> 
> I> īm having no luck creating a COMBOBOX  within a PythonWin Dialog. What are the basic steps? I donīt understand the only example I found in framework/editor/edit.py. There seem to be essential pieces of info missing. Through use of the win32con.CBS_* constants, Iīve finally managed to get a visible combobox, but it seems to ignore my adding entries or wanting to see/select them.
> 
> def MakeThreadGeneratorDlg(title):
> 	style = win32con.DS_MODALFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT
> 	cs = win32con.WS_CHILD | win32con.WS_VISIBLE
> 
> 	# Window frame and title
> 	dlg = [ [title, (0, 0, 200, 45), style, None, (8, "MS Sans Serif")], ]
>  s])
> 
> 	# select thread from list to delete
> 	dlg.append([130, "delete thread:", -1, (7, 22, 69, 9), cs | win32con.SS_LEFT])
> 	s = cs | win32con.WS_TABSTOP  | win32con.WS_VSCROLL | win32con.CBS_DROPDOWN | win32con.CBS_HASSTRINGS
> 	dlg.append(['COMBOBOX', None, win32ui.IDC_COMBO1, (65, 20, 60, 12), s ])
> 
> 	# ...
> 
> 
> class ThreadGeneratorDlg(dialog.Dialog):
> 	Cancel = 0
> 	def __init__(self, title):
> 		dialog.Dialog.__init__(self, MakeThreadGeneratorDlg(title) )
> 		self.AddDDX(win32ui.IDC_COMBO1,'expiringThread')
> 
> 	# ...
> 
> 	def OnInitDialog(self):
> 		self.edit1NewThread = self.GetDlgItem(win32ui.IDC_EDIT1)
> 		self.deleteOldThread = self.GetDlgItem(win32ui.IDC_COMBO1)
> 		
> 		# following just a test!!!!!!!!
> 		self.deleteOldThread.AddString("aasdf")
> 		self.deleteOldThread.AddString("basdf")
> 		self.deleteOldThread.AddString("casdf")
> 		self.deleteOldThread.AddString("dasdf")
> 
> eturbulently yours,
> 
> 
> David Ungemach
> (Munich, Germ-money)
>