I will try that as well. Thanks!<br><br><br><div class="gmail_quote">On Wed, Aug 19, 2009 at 3:47 PM, Dino Viehland <span dir="ltr"><<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If 2.6 doesn't work unmodified there's also adding the 2 needed lines<br>
to 2.0's pyc:<br>
<br>
mainMethod = tb.DefineMethod('Main', MethodAttributes.Public | MethodAttributes.Static, int, ())<br>
+ if targetKind == System.Reflection.Emit.PEFileKinds.WindowApplication:<br>
+ mainMethod.SetCustomAttribute(clr.GetClrType(System.STAThreadAttribute).GetConstructor(()), System.Array[System.Byte](()))<br>
gen = mainMethod.GetILGenerator()<br>
<div><div></div><div class="h5"><br>
-----Original Message-----<br>
From: <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>] On Behalf Of Michael Foord<br>
Sent: Wednesday, August 19, 2009 3:45 PM<br>
To: <a href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a>; Discussion of IronPython<br>
Subject: Re: [IronPython] FolderBrowserDialog does not show folders<br>
<br>
David Escobar wrote:<br>
> How would I tag Main with the [STAThread] attribute in IronPython? I<br>
> thought IP didn't yet have the ability to use attributes...<br>
Unfortunately that is something that needs to be done in the Pyc<br>
compiler. Did you try Curt's suggestion of using the 2.6 Pyc.py?<br>
<br>
Michael<br>
<br>
><br>
> On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher<br>
> <<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a> <mailto:<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a>>> wrote:<br>
><br>
> ...which has been fixed for IronPython 2.6. You might be able to<br>
> use the 2.6 pyc.py script against 2.0.<br>
><br>
><br>
> On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher<br>
> <<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a> <mailto:<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a>>> wrote:<br>
><br>
> It's a COM issue. The emitted Main needs to be tagged with the<br>
> [STAThread] attribute.<br>
><br>
> On Wed, Aug 19, 2009 at 11:41 AM, David Escobar<br>
> <<a href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a> <mailto:<a href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a>>> wrote:<br>
><br>
> Yes, I am. The full command line I'm using is:<br>
> *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py<br>
> /out:FolderBrowserDialogTest<br>
> /main:FolderBrowserDialogTest.py /target:winexe<br>
> FolderBrowserDialogTest.py*.<br>
><br>
> The dialog window does come up with every control except<br>
> the tree view of folders.<br>
><br>
><br>
><br>
> On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland<br>
> <<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a> <mailto:<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>>> wrote:<br>
><br>
> Are you compiling w/ the "/target:winexe" option?<br>
> You'll need to provide that for doing WinForms<br>
> development.<br>
><br>
><br>
><br>
> *From:* <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a><br>
> <mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>><br>
> [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a><br>
> <mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>>] *On<br>
> Behalf Of *David Escobar<br>
> *Sent:* Wednesday, August 19, 2009 11:03 AM<br>
> *To:* Discussion of IronPython<br>
> *Subject:* [IronPython] FolderBrowserDialog does not<br>
> show folders<br>
><br>
><br>
><br>
> I've noticed an issue with the FolderBrowserDialog<br>
> window from IronPython. When I display it with the<br>
> ShowDialog method in a compiled script (through<br>
> pyc.py), it does not show the TreeView of folders. It<br>
> will display the Description title and the buttons,<br>
> however. If I run the script straight through the<br>
> interpreter, it will display the folders just fine.<br>
> For reference, I also tried the OpenFileDialog and<br>
> SaveFileDialog, and those show up correctly in both<br>
> methods. Is this a bug, or am I doing something wrong?<br>
><br>
> Sample code below:<br>
><br>
> *import clr<br>
> clr.AddReference("System.Windows.Forms")<br>
> from System import *<br>
> from System.Windows.Forms import *<br>
><br>
> dlg = FolderBrowserDialog( )<br>
> dlg.Description = "Testing..."<br>
> dlg.ShowDialog( )*<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a> <mailto:<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a>><br>
> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
><br>
><br>
><br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
><br>
<br>
<br>
--<br>
<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
<a href="http://www.voidspace.org.uk/blog" target="_blank">http://www.voidspace.org.uk/blog</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br>