Subscribe: WinForms on Mac OS X
http://mwfosx.blogspot.com/feeds/posts/default?alt=rss
Added By: Feedage Forager Feedage Grade C rated
Language: English
Tags:
back  carbon  code  didn  dirty hack  invoke  piece code  piece  put scale  render  scale  things  translation code  translation  window 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: WinForms on Mac OS X

WinForms on Mac OS X



The progress of Systems.Windows.Forms support in mono on Mac OS X.



Last Build Date: Fri, 03 Oct 2014 04:56:33 +0000

 



Getting it out of bitrot

Fri, 20 Jul 2007 14:37:00 +0000

The past few weeks I've been working hard on trying to learn all that's involved with MWF on mono. It's quite a complex system--it's not even complete on X11 on UNIX. However, I was determined to get at least something on the screen. I waded through the source, debugged things, got perplexed at really weird crashes. I eventually updated the bitrotten code to render something.

(image)
Well that was comforting. Back to the source code. After a few exchanges with the existing maintainer I focused more on a certain piece of code and delved into Cairo and Carbon to see what I should be doing. The C# P/Invoke call didn't work--so I decided to try to put the scale to properly invert the image in C code that was P/Invoked later than where I had been messing around. Well that worked, but the controls were all on the lower left corner. So I looked up through the Carbon API, looking at the Translation function. I remembered that piece of C# code that didn't seem to P/Invoke correctly, so I took that out and moved it back to where I previously put the scale. That kind of worked:

(image)
Where'd the background go? I looked at the translation code again and apparently the translation code works well for all the subviews, except the window. So I wrote a dirty hack to detect the window size and guess if it's the window. It's a very dirty hack and I intend to clean it up and find a proper way because if you have, for example, a button that is exactly the same size as that window, it won't be drawn properly. I'm currently researching that and how to keep track of children views so things would render better.

(image)
That's all for today. As always, we need more people working on this! If interested, please contact me and I'll provide the patches to work with.