<div dir="ltr">Hi Jason,<div><br></div><div style>Take a look at this post about SharpDevelop, IronPython and form resources which goes into more detail than I will cover here. </div><div style><br></div><div style><a href="http://community.sharpdevelop.net/blogs/mattward/archive/2009/09/28/IronPythonFormResources.aspx">http://community.sharpdevelop.net/blogs/mattward/archive/2009/09/28/IronPythonFormResources.aspx</a><br>
</div><div style><br></div><div style>The basic problem is that the forms designer in SharpDevelop generates code that assumes you will be compiling your application to an executable so the resources for the form are compiled into that executable. The image for the toolstrip button will be part of a .resx file in your project and on compilation will be embedded into your exe.</div>
<div style><br></div><div style>PTVS will run your IronPython application with ipy.exe and will not compile it to an executable, instead running your main IronPython file directly, so you are going to have to load the resources in a different way, such as loading them directly from a file or an assembly.</div>
<div><br></div><div style>Regards,</div><div style><br></div><div style>Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 30 May 2013 17:48, Jason Barner <span dir="ltr"><<a href="mailto:necroak@hotmail.com" target="_blank">necroak@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Hello, I have recently stumbled upon IronPython, and have taken quite an interest in getting to know the workings of it. I've got experience with C#, and many other languages so I am quite comfortable with most of the underlying principles of how things work.<div>
<br></div><div>I've been tinkering with simple WinForms apps, and have come upon a bit of a snag. In normal C#, (with design view) you can simply drag and drop a toolstrip, insert the "standard" items to it, and it ever so nicely generates a bunch of code for you.</div>
<div><br></div><div>While I have certainly informed myself through Google that PTVS just doesn't support the WYSIWYG designer for WinForms (I see it does for WPF) I haven't let it deter me from fiddling around. I also noticed that SharpDevelop does support the designer for WinForms with python, and can handle the toolstrip issues I am facing now, but I would rather understand the issue I am having rather then just using a tool/designer to spew code out for me...</div>
<div><br></div><div>I've got a few IronPython books, of which I believe only one touches on the issue I have, but I just can't get a good understanding from how they present it...so hopefully one of you fine people can help me out =)</div>
<div><br></div><div><br></div><div>My problem :</div><div><br></div><div><b>In SharpDevelop, when using the standard items on the toolstrip, you are generated this :</b></div><div> resources = System.Resources.<span style="color:#191970;font-weight:bold">ResourceManager</span>(<span style="color:#0000ff">"Test.MainForm"</span>, System.Reflection.Assembly.<span style="color:#191970;font-weight:bold">GetEntryAssembly</span>())</div>
<div><br></div><div><b>Which allows this to be done : </b></div><div><br></div><div> self._newToolStripButton.Image = resources.<span style="color:#191970;font-weight:bold">GetObject</span>(<span style="color:#0000ff">"newToolStripButton.Image"</span>)</div>
<div><br></div><div><br></div><div><b>In C#, when doing the same you are generated this : </b></div><div>System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));</div>
<div><br></div><div><b>Which allows this :</b></div><div><br></div><div> this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image")));</div><div><br></div><div><br></div>
<div>These images are provided with visual studios as far as I am aware, but I am just not sure how exactly they are found, and more specifically I cannot get an implementation like this to work with normal IronPython and PTVS.</div>
<div><br></div><div><br></div><div>If anyone has any knowledge on how I can implement this with IronPython with the PTVS setup, I would love to know how it can be done..it would also be highly appreciated to know what exactly the difference is, and some of (if not all) of what exactly is being done for the images to be pulled...</div>
<div><br></div><div>Thanks for your time!</div>                                     </div></div>
<br>_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
<br></blockquote></div><br></div>