[Mono-winforms-list] Project status of WinForms on MacOS

Geoff Norton gnorton at novell.com
Fri Nov 2 10:58:54 EDT 2007


> I have been playing with your stuff on the Mac. Basic things are
> working and I am impressed. I am also impressed with the whole
> WindowsForms cross platform effort thus far. We have tested some of
> our custom WindowsForms components on Linux and for the most part
> things work (we haven't done exhastive testing. Have submitted a few
> bugs). 

I'm very glad to hear you have things working in the current state. :)

> I have a question about supporting the MacOS aqua stuff. I know the
> WindowsForms stuff has the Theme classes that do the drawing, but that
> seems to be a lot of work to draw all this stuff using GDI+. I was
> playing around with DrawThemeButton in the Carbon stuff to try and
> draw a themed button. My current approach (which is not working) was
> to derivie from Button and draw in OnPaint by calling DrawThemeButton
> from there. I am new to the Mac API's (Carbon and Cocoa) but I think
> the MacOS only allows drawing at certain times. From examples of
> DrawThemeButton, they put the call inside of the event loop callback's
> kEventControlDraw (we have that code in XplatUIOSX.cs). I haven't
> tried this solution but it is obviously not the right place to put the
> call because all the drawing is abstracted out into the Theme
> classes. 

The way this should be tackled is to use the HITheme APIs in HIToolkit
(thanks Stefan), instead of DrawTheme*.  These should be able to paint
out of loop for you.  We support out of loop painting already in MWF
(with a few caveats) so it is indeed possible.  I would suggest starting
with a simple theme that extends the Win32 one but overrides Button for
instance and calls HIThemeDrawButton.  

Take a look through HIToolbox/HITheme.h for more information on HITheme,
its a public supported API as of 10.4


More information about the Mono-winforms-list mailing list