[Mono-dev] Gtk depends on Winforms ¿?

Christian Hoff christian_hoff at gmx.net
Wed Sep 9 11:05:42 EDT 2009

Hi folks,

as you may have noticed, old Gtk# versions (< 2.12.8) did not use XP's 
visual styles. Later versions have a workaround: they call 
System.WIndows.Forms.Application.DoEvents which seems to enable XP's 
theming. This workaround is far from optimal as it created a Winforms 

That's why I tried to integrate the code of Application.DoEvents into 
Gtk# directly. As I do not have a Windows XP machine to test, I cannot 
verify if it works.
I have attached an assembly and it's source code (change extension to 
.exe; GMail does not allow executables as attachments) that can be run 
with any Gtk# 2.12 version on XP. It uses a tweaked Gtk.Application 
class with a new mechanism to enable theming.

I would really appreciate some feedback from the community as to whether 
the new approach works (that is, if the attached application appears 
with visual styles enabled). Just reply with a screenshot of the running 
app on XP if you're not sure what I mean :-) .


Mike Kestner wrote:
> On Sat, 2009-09-05 at 09:15 +0200, Christian Hoff wrote:
>>> In Windows I use 'mkbundle' [1]
>> We should probably put that code in a try-block. What do you think, Mike?
> My question would be, what do you do in the catch block?  
> The winforms reflection thing is a huge hack, we know that, and the
> poster is tripping over it because of using mkbundle instead of
> depending on mono or .Net.
> We could also take the stance that if somebody wants to do this sort of
> minimal packaging, they are required to add an artificial ref to swf to
> ensure it gets bundled.  But they won't have any clue that's required if
> we just silently fallback to unthemed windows when we can't find swf.
> According to Robert Jordan on this thread, it's a PeekMessage/GetMessage
> loop that's required to happen before the first handle is created.  We
> should try a pinvoke solution like that and see if it works so we can
> remove the hack altogether instead of figuring out ways to make the hack
> more palatable.
> Mike

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ThemingTest.cs
Type: text/x-csharp
Size: 7376 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090909/4a7e5010/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ThemingTest.runme
Type: application/octet-stream
Size: 7680 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090909/4a7e5010/attachment.obj 

More information about the Mono-devel-list mailing list