[python-win32] pythonwin32 UI

Mark Hammond mhammond at skippinet.com.au
Wed Apr 28 08:28:30 EDT 2004


> I have embedded & extended python in to my application. Now i want to
> take advantage of
> win32ui layer for my rapid application development environment.

Note that due to histe^Horical reasons, win32ui is a wrapper around MFC (a
more object-oriented framework), whereas win32gui is a very raw wrapper
around the GUI related API functions.

> I understood that I can create dialog boxes through vc++ [ .rc files]
> and load those dialog boxes from python.
> And I can have some thing similar to message map to have call backs.
>
> I create new dialog boxes and i could invoke them from pythonwin32.
> but if i try to do the same from my embedded application my
> application
> is hanging.
> Could some one suggest me if any special way i can get this?

It "should work" :)  By using win32ui, you are including all the MFC
framework, which can get in the way.  win32gui generally has less
side-effects, but may still impact when embedded with other GUI frameworks
that make their own assumptions.

If you are using win32gui rather than win32ui, then ensure you have build
201 installed - an obscure win32gui hang was fixed in that build.

But otherwise, unfortunately, and as usual, the best answer is to reduce the
problem down to the smallest possible sample code that demonstrates the
problem.

> Also i want to develop a layer which can read .frm file[ the one
> generated by VB for dialog boxes, i guess similar to .rc file
> in vc++]
> and create dialog boxes, and provide message loop for call backs.

That should be quite simple, and a reference to vb2py has already been made.
Note however that "message loop for callbacks" is still fairly low-level -
you are dealing with the various Windows messages, which really can't be
considered a friendly callback framework.  I *still* can't believe how hard
GUIs are, even with a decent framework; a conceptual leap is waiting to
happen here, IMO.

Mark.




More information about the Python-win32 mailing list