[Mono-list] Gtk print demo fails on Windows7 for all versions of Mono/Gtk

Doug Blank doug.blank at gmail.com
Fri Sep 9 07:06:37 EDT 2011


On Fri, Sep 9, 2011 at 3:34 AM, Elmar Haneke <elmar at haneke.de> wrote:
>
>
> Am 08.09.2011 20:06, schrieb Doug Blank:
>
>> Wow... nothing. No activity in the bug tracker. No response here.
>> Maybe someone can make some guesses about the issue, or why I can't
>> get any comments:
>
> Perhaps you can find an solution in
> https://bugzilla.novell.com/show_bug.cgi?id=380675

Yes! Thank you, thank you, thank you!

It turns out that if you want to use Gtk.PrintOperation, your Main
function, wherever it is, must have the [STAThread] attribute.

I've been using Mono and Gtk# for a year now without this (just using
Gtk.Application.Invoke for to run in the correct thread), but Printing
appears to require STAThread. (My application is actually written in
IronPython, which would be problematic as there is no way to set this
attribute, and so there appears to be no way to have a pure IronPython
app that prints in Windows. But this is easily remedied by creating a
little C# wrapper).

> If that does not help you should send your complaint about the missing
> support to the people you did contract for urgent support.

Well, this is an open source project, without money or contracts. So
it is up to people like us to make sure that we provide even little
hints to each other.

And so, this day shall be know as "Elmar Day" :) Your hint means a lot
to a lot of users. Thanks!

-Doug

> Elmar
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>


More information about the Mono-list mailing list