[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] mix pygame with win32?



On, Tue Mar 09, 2010, inhahe wrote:

> I'm thinking of making a GUI for pygame (I know it's been done already), but
> I don't want to unless I can render fonts with bold, italic, etc. in-lined
> into the string, like, e.g., Qt's "RTF" strings.  It's not the same when you
> render them separately and patch it together; the spacing isn't right.  I've
> been told that not even the new beta pygame that uses freetype can do that.
>  So I was thinking maybe I could (on Windows) call some win32 function to
> render text, but I'd imagine I have to pass it a device context handle or
> whatever for the surface to draw on, and I don't see a function in pygame to
> return a device context handle.  So...Is there any way to do this?  Thanks.

pygame.display.get_wm_info() will return a dict() with a "window"
property, which contains the window handle as HWND address. You can use
this to manipulate the window itself, but be aware that this might cause
some unwanted side effects, as SDL uses an own WndProc handle.

Regards
Marcus

Attachment: pgpXf4u4FFqS9.pgp
Description: PGP signature