I played with controls on a window (no dialog). For example an edit control
with CreateEdit() and everything works fine.

I'd like to use a combobox control. Getting it with dialog is no problem.

But I could not create a combobox on a window.

With the following code I got an error by CreateWindowEx. When it worked
(for example
with wclass="PyCListCtrl") I get an error with GetDlgItem():
win32ui: Internal error - existing object has type 'PyCWnd', but
'PyCListCtrl' was requested.

class MyCtrl(window.Wnd):
    def __init__(self):
        window.Wnd.__init__(self, win32ui.CreateWnd())

    def CreateWindowEx(self, ex_style, wnclass, text, style, rect, parent,
id):
        self._obj_.CreateWindow(wnclass, text, style, rect, parent, id,
None)


def DivCtrl(parent, wclass="COMBOBOX", text=None,
rect=(10,200,120,250),id=1021):
    d = MyCtrl()
    cs = (win32con.WS_CHILD | win32con.WS_VISIBLE)
    ccs = cs | win32con.CBS_DISABLENOSCROLL | win32con.CBS_DROPDOWN

    d.CreateWindowEx(win32con.WS_EX_CLIENTEDGE, wclass, text, ccs,  rect,
parent, id)

    return d


Is there any chance to get a combobox?
Could a CreateCombobox() - or other controls - be created by python?
Or is the only solution to make one with an ocx control?

I'm grateful for any suggestion.

Manfred
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to