<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1572876944455283615</id><updated>2012-01-24T13:07:44.879-06:00</updated><category term='Gtk#'/><category term='Pixbuf'/><category term='Visual Studio'/><category term='Respect'/><category term='Reflection'/><category term='Help'/><category term='Cross-Platform'/><category term='Cairo'/><category term='Organization'/><category term='GAC'/><category term='TreeView'/><category term='Drawing'/><category term='ComboBox'/><category term='Asp.Net'/><category term='Gdk'/><category term='Love'/><category term='MembershipProvider'/><category term='101'/><category term='Window'/><category term='Windows'/><category term='Change'/><category term='Wiki'/><category term='PostgreSql'/><category term='Drag/Drop'/><title type='text'>Mono 101</title><subtitle type='html'>Filling in the gaps...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-6622879084909180255</id><published>2008-07-13T10:40:00.002-05:00</published><updated>2008-07-13T11:07:34.582-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wiki'/><category scheme='http://www.blogger.com/atom/ns#' term='Help'/><category scheme='http://www.blogger.com/atom/ns#' term='101'/><title type='text'>Mono 101</title><content type='html'>I just got a nice email thanking me for covering "Mono 101", which I realized is a much better name for this blog.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Some of the things you are covering are "Mono 101" which I feel is lacking&lt;br /&gt;badly. The more experienced programmers can always find a way to get things done&lt;br /&gt;it's the beginners and intermediate that we need to address, help and give real&lt;br /&gt;world examples to.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Thank You. I couldn't agree more, and I guess that was always a subconscience idea I had. I was already an experienced programmer when I started using Mono and I still had great trouble figuring out how to do so many basic things that just weren't covered. The best examples I found were few and far between and usually buried somewhere deep in the documentation. Anyone can figure out how to pack a VBox, but something as simple as stopping a window when it tries to close is damn near impossible to figure out.&lt;br /&gt;&lt;br /&gt;So I have changed the name of the blog and now I actually have a conscience intention. To help fill in the gaps between the tutorials. Its just too bad I have to do it on this blog because getting any kind of access to update the (antiquated) Mono wiki is like breaking into Fort Knox. However if any of you official Mono people made it this far in the post without getting offended then I would love to offer my efforts (again, as I have in the past more than once) to contribute to the wiki, which would be far more helpful to more people than this blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-6622879084909180255?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/6622879084909180255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=6622879084909180255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/6622879084909180255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/6622879084909180255'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/07/mono-101.html' title='Mono 101'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-4119991969283985033</id><published>2008-07-11T13:43:00.004-05:00</published><updated>2008-07-11T14:38:01.056-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='ComboBox'/><category scheme='http://www.blogger.com/atom/ns#' term='TreeView'/><category scheme='http://www.blogger.com/atom/ns#' term='Pixbuf'/><title type='text'>Resize Pixbuf in TreeView/ComboBox</title><content type='html'>TreeView:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;public ProjectsTreeView()&lt;br /&gt;{&lt;br /&gt;this.Model = projectModel;&lt;br /&gt;&lt;br /&gt;this.AppendColumn("Icon", new CellRendererPixbuf(), new&lt;br /&gt;TreeCellDataFunc(Render));&lt;br /&gt;this.AppendColumn("Project", new&lt;br /&gt;CellRendererText(), new TreeCellDataFunc(Render));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void Render(TreeViewColumn column, CellRenderer cell, TreeModel&lt;br /&gt;model, TreeIter iter)&lt;br /&gt;{&lt;br /&gt;switch (column.Title)&lt;br /&gt;{&lt;br /&gt;case&lt;br /&gt;"Icon":&lt;/p&gt;&lt;p&gt;&lt;strong&gt;// Using the GetIcon and Scale is the easiest way to resize a pixbuf&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Gdk.Pixbuf icon = ((Project)model.GetValue(iter,&lt;br /&gt;0)).GetIcon.ScaleSimple(16, 16,&lt;br /&gt;Gdk.InterpType.Bilinear);&lt;br /&gt;((CellRendererPixbuf)cell).Pixbuf = icon;&lt;/strong&gt;&lt;br /&gt;break;&lt;br /&gt;case "Project":&lt;br /&gt;((CellRendererText)cell).Text =&lt;br /&gt;((Project)model.GetValue(iter, 0)).Name; break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;ComboBox:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;public class ProjectComboBox : ComboBox&lt;br /&gt;{&lt;br /&gt;public&lt;br /&gt;ProjectComboBox()&lt;br /&gt;{&lt;br /&gt;this.Model = myProjectsModel;&lt;br /&gt;CellRendererPixbuf&lt;br /&gt;cIcon = new CellRendererPixbuf();&lt;br /&gt;this.PackStart(cIcon,&lt;br /&gt;true);&lt;br /&gt;this.AddAttribute(cIcon, "pixbuf", 0);&lt;br /&gt;CellRendererText cName = new&lt;br /&gt;CellRendererText();&lt;br /&gt;this.PackStart(cName, true);&lt;br /&gt;this.AddAttribute(cName,&lt;br /&gt;"text", 1);&lt;br /&gt;this.SetCellDataFunc(cIcon,&lt;br /&gt;RenderIcon);&lt;br /&gt;this.SetCellDataFunc(cName, RenderName);&lt;br /&gt;}&lt;br /&gt;private void&lt;br /&gt;RenderIcon(CellLayout layout, CellRenderer cellrenderer, TreeModel model,&lt;br /&gt;TreeIter iter)&lt;br /&gt;{ &lt;/p&gt;&lt;p&gt;&lt;strong&gt;// Using the GetIcon and Scale is the easiest way to resize a pixbuf&lt;br /&gt;((CellRendererPixbuf)cellrenderer).Pixbuf =&lt;br /&gt;((Project)model.GetValue(iter, 0)).GetIcon.ScaleSimple(16, 16,&lt;br /&gt;Gdk.InterpType.Bilinear); &lt;/strong&gt;&lt;br /&gt;}&lt;br /&gt;private void RenderName(CellLayout layout,&lt;br /&gt;CellRenderer cellrenderer, TreeModel model, TreeIter&lt;br /&gt;iter)&lt;br /&gt;{&lt;br /&gt;((CellRendererText)cellrenderer).Text =&lt;br /&gt;((Project)model.GetValue(iter, 0)).Name;&lt;br /&gt;}&lt;br /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-4119991969283985033?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/4119991969283985033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=4119991969283985033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/4119991969283985033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/4119991969283985033'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/07/resize-pixbuf-in-treeviewcombobox.html' title='Resize Pixbuf in TreeView/ComboBox'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-618691670535752998</id><published>2008-06-25T18:28:00.010-05:00</published><updated>2008-06-25T18:46:54.371-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gdk'/><category scheme='http://www.blogger.com/atom/ns#' term='Cairo'/><category scheme='http://www.blogger.com/atom/ns#' term='Drawing'/><title type='text'>Draw a Rounded background border on a GdkWindow</title><content type='html'>Note that this does not draw the actual border of the control, just draws on the GdkWindow, like a psuedo-border&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;using System;&lt;br /&gt;using Gtk;&lt;br /&gt;using Gdk;&lt;br /&gt;using Cairo;&lt;br /&gt;using&lt;br /&gt;System.Runtime.InteropServices;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Drawing;&lt;br /&gt;using System.Drawing.Imaging;&lt;br /&gt;&lt;br /&gt;[DllImport("libgdk-win32-2.0-0.dll")]&lt;br /&gt;private static extern IntPtr gdk_cairo_create(IntPtr drawable);&lt;br /&gt;&lt;br /&gt;private void DrawBorderRounded()&lt;br /&gt;{&lt;br /&gt;Context g = new&lt;br /&gt;Context(gdk_cairo_create(myBG.GdkWindow));&lt;br /&gt;&lt;br /&gt;double dWidth =&lt;br /&gt;((Double)this.Allocation.Width) - 10.5;&lt;br /&gt;double dWidthInner =&lt;br /&gt;((Double)this.Allocation.Width - 15.5);&lt;br /&gt;double dHeight =&lt;br /&gt;((Double)this.Allocation.Height) - 10.5;&lt;br /&gt;double dHeightInner =&lt;br /&gt;((Double)this.Allocation.Height - 15.5);&lt;br /&gt;&lt;br /&gt;PointD p1, p2, p3, p4, pA, pB,&lt;br /&gt;pC, pD, pE, pF, pG, pH;&lt;br /&gt;pA = new PointD(10.5, 15.5);&lt;br /&gt;pB = new&lt;br /&gt;PointD(15.5, 10.5);&lt;br /&gt;pC = new PointD(dWidthInner, 10.5);&lt;br /&gt;pD = new&lt;br /&gt;PointD(dWidth, 15.5);&lt;br /&gt;pE = new PointD(dWidth, dHeightInner);&lt;br /&gt;pF = new&lt;br /&gt;PointD(dWidthInner, dHeight);&lt;br /&gt;pG = new PointD(15.5, dHeight);&lt;br /&gt;pH = new&lt;br /&gt;PointD(10.5, dHeightInner);&lt;br /&gt;p1 = new PointD(10, 10);&lt;br /&gt;p2 = new&lt;br /&gt;PointD(dWidth, 10);&lt;br /&gt;p3 = new PointD(dWidth, dHeight);&lt;br /&gt;p4 = new&lt;br /&gt;PointD(10, dHeight);&lt;br /&gt;&lt;br /&gt;g.MoveTo(pA);&lt;br /&gt;g.CurveTo(pA, p1, pB);&lt;br /&gt;g.LineTo(pC);&lt;br /&gt;g.CurveTo(pC, p2, pD);&lt;br /&gt;g.LineTo(pE);&lt;br /&gt;g.CurveTo(pE,&lt;br /&gt;p3, pF);&lt;br /&gt;g.LineTo(pG);&lt;br /&gt;g.CurveTo(pG, p4, pH);&lt;br /&gt;g.LineTo(pA);&lt;br /&gt;g.ClosePath();&lt;br /&gt;&lt;br /&gt;((IDisposable)g.Target).Dispose();&lt;br /&gt;((IDisposable)g).Dispose();&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Want to Fill the background with a gradient? Before the dispose add&lt;br /&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;blockquote&gt;// g.Save();&lt;br /&gt;// Cairo.Gradient pat = new Cairo.LinearGradient(100, 200, 200,&lt;br /&gt;100);&lt;br /&gt;// pat.AddColorStop(0, new Cairo.Color(0, 0, 0));&lt;br /&gt;//&lt;br /&gt;pat.AddColorStop(1, new Cairo.Color(.240, .248, .3));&lt;br /&gt;// g.Pattern = pat;&lt;br /&gt;// Fill the path with pattern&lt;br /&gt;// g.FillPreserve();&lt;br /&gt;// We "undo" the&lt;br /&gt;pattern setting here&lt;br /&gt;// g.Restore();&lt;/blockquote&gt;&lt;p&gt;NOTE: I feel like I saw this tutorial somehwere a long time ago. Probably on the Mono Wiki, however I don't feel like digging through all that nonsense to find out. So, if you are the proud owner of the original, or you recognize this code and know where I can find it, please tell me so I can give proper credit to the original. I'm just trying to pass on knowledge, not steal anybodies thunder&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-618691670535752998?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/618691670535752998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=618691670535752998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/618691670535752998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/618691670535752998'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/draw-rounded-background-border-on.html' title='Draw a Rounded background border on a GdkWindow'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-3951872974000972475</id><published>2008-06-25T16:37:00.003-05:00</published><updated>2008-06-25T18:47:56.979-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='TreeView'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Enable TreeView RulesHint in Windows</title><content type='html'>I don't know why but the default windows mono install does not have TreeView RulesHint (alternating row colors) enabled by default. The fix is very easy though. Go to your Gtk-2.0 folder located in your default Mono install. Mine is located at:&lt;br /&gt;C:\Program Files\Mono-1.9.1\etc\gtk-2.0&lt;br /&gt;Open the file 'gtkrc' in a text editor like notepad or wordpad (it doesn't have an extension so windows won't recognize it, you'll have to use 'open with'&lt;br /&gt;At the end of the file add these lines:&lt;br /&gt;&lt;br /&gt;style "rules-hint"&lt;br /&gt;{&lt;br /&gt;GtkTreeView::allow-rules = 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class "*" style "rules-hint"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Save and close the file and RulesHint should work&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-3951872974000972475?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/3951872974000972475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=3951872974000972475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/3951872974000972475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/3951872974000972475'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/enable-treeview-ruleshint-in-windows.html' title='Enable TreeView RulesHint in Windows'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-7255079499512772607</id><published>2008-06-25T14:58:00.004-05:00</published><updated>2008-06-25T15:03:14.882-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MembershipProvider'/><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSql'/><category scheme='http://www.blogger.com/atom/ns#' term='Asp.Net'/><title type='text'>PostgreSql Membership Provider</title><content type='html'>I don't know about everyone out there but I have used just about every database available and I have settled on PostgreSql. Definitely my favorite. To use PostgreSql with the .Net MembershipProvider, a guy named Lee has put in some great work to make it happen. You can get it here: &lt;a href="http://blog.woodchop.com/2006/09/postgresql-membership-provider-for.html"&gt;http://blog.woodchop.com/2006/09/postgresql-membership-provider-for.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-7255079499512772607?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/7255079499512772607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=7255079499512772607' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/7255079499512772607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/7255079499512772607'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/postgresql-membership-provider.html' title='PostgreSql Membership Provider'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-185561795551121462</id><published>2008-06-25T11:46:00.005-05:00</published><updated>2008-06-25T11:54:46.081-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='Window'/><title type='text'>Stop a Window when it tries to close</title><content type='html'>&lt;blockquote&gt;// this = the window&lt;br /&gt;this.DeleteEvent += delegate(object sender,&lt;br /&gt;DeleteEventArgs e)&lt;br /&gt;{&lt;br /&gt;// Here I am checking to see if my Application is&lt;br /&gt;on the login Screen&lt;br /&gt;// If it is, then I can quit the program when this (my&lt;br /&gt;main window) tries to close&lt;br /&gt;if (IsOnLogin)&lt;br /&gt;{&lt;br /&gt;Application.Quit();&lt;br /&gt;}&lt;br /&gt;// If it is not on the login screen, I cancel the close and show the&lt;br /&gt;user my login screen&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;NavigateTo("Login");&lt;br /&gt;// This is the&lt;br /&gt;only line you need to cancel a window close&lt;br /&gt;e.RetVal = true;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-185561795551121462?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/185561795551121462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=185561795551121462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/185561795551121462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/185561795551121462'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/stop-window-when-it-tries-to-close.html' title='Stop a Window when it tries to close'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-8372980327650893991</id><published>2008-06-25T11:15:00.006-05:00</published><updated>2008-06-25T11:55:37.435-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='TreeView'/><category scheme='http://www.blogger.com/atom/ns#' term='Drag/Drop'/><title type='text'>Simple Drag-Drop between 2 TreeViews</title><content type='html'>This is the simplest way I can come with to drag drop between 2 TreeViews. I haven't tested it much but I'm sure it could be used with other widgets as well&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;TreeView treeView1 = new TreeView();&lt;br /&gt;TreeView treeView2 = new TreeView();&lt;br /&gt;&lt;br /&gt;TargetEntry[] te1 = new TargetEntry[] { new TargetEntry("treeView1 ",&lt;br /&gt;TargetFlags.App, 1) };&lt;br /&gt;TargetEntry[] te2 = new TargetEntry[] { new&lt;br /&gt;TargetEntry("treeView2 ", TargetFlags.App, 2) };&lt;br /&gt;&lt;br /&gt;treeView1&lt;br /&gt;.EnableModelDragSource(Gdk.ModifierType.Button1Mask, te1, Gdk.DragAction.Move);&lt;br /&gt;treeView1 .DragDataGet += treeView1 _DragDataGet;&lt;br /&gt;treeView1&lt;br /&gt;.EnableModelDragDest(te1, Gdk.DragAction.Move);&lt;br /&gt;treeView1 .DragDataReceived&lt;br /&gt;+= treeView1 _DragDataReceived;&lt;br /&gt;&lt;br /&gt;treeView2&lt;br /&gt;.EnableModelDragSource(Gdk.ModifierType.Button1Mask, te1, Gdk.DragAction.Move);&lt;br /&gt;treeView2 .DragDataGet += treeView2 _DragDataGet;&lt;br /&gt;treeView2&lt;br /&gt;.EnableModelDragDest(te1, Gdk.DragAction.Move);&lt;br /&gt;treeView2 .DragDataReceived&lt;br /&gt;+= treeView2 _DragDataReceived;&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// Drag and Drop from the First&lt;br /&gt;TreeView to the Second&lt;br /&gt;//&lt;br /&gt;private void treeView1_DragDataGet(object o,&lt;br /&gt;DragDataGetArgs args)&lt;br /&gt;{&lt;br /&gt;TreeModel model;&lt;br /&gt;TreeIter row;&lt;br /&gt;((TreeSelection)treeView1.Model.Selection).GetSelected(out model, out row);&lt;br /&gt;args.SelectionData.Set(args.SelectionData.Target, 8,&lt;br /&gt;Encoding.UTF8.GetBytes(model.GetValue(row, 0).ToString()));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void treeView2 _DragDataReceived(object o, DragDataReceivedArgs&lt;br /&gt;args)&lt;br /&gt;{&lt;br /&gt;// Get the string you passed through&lt;br /&gt;string str =&lt;br /&gt;Encoding.UTF8.GetString(args.SelectionData.Data)));&lt;br /&gt;&lt;br /&gt;// Here you could do&lt;br /&gt;a check to see whether or not the TreeView has the value already&lt;br /&gt;&lt;br /&gt;// Add&lt;br /&gt;to the second TreeView&lt;br /&gt;treeView2.Model.AppendValues(str);&lt;br /&gt;&lt;br /&gt;// Remove&lt;br /&gt;from the first TreeView&lt;br /&gt;treeView1.Model.Foreach(delegate(TreeModel mod,&lt;br /&gt;TreePath path, TreeIter it)&lt;br /&gt;{&lt;br /&gt;if (mod.GetValue(it, 0).ToString() == str)&lt;br /&gt;{&lt;br /&gt;treeView1.Model.Remove(ref it);&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;return&lt;br /&gt;false;&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// Drag and Drop from the Second TreeView to&lt;br /&gt;the First&lt;br /&gt;//&lt;br /&gt;private void treeView2_DragDataGet(object o,&lt;br /&gt;DragDataGetArgs args)&lt;br /&gt;{&lt;br /&gt;TreeModel model;&lt;br /&gt;TreeIter row;&lt;br /&gt;((TreeSelection)treeView2.Model.Selection).GetSelected(out model, out row);&lt;br /&gt;args.SelectionData.Set(args.SelectionData.Target, 8,&lt;br /&gt;Encoding.UTF8.GetBytes(model.GetValue(row, 0).ToString()));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void treeView1 _DragDataReceived(object o, DragDataReceivedArgs&lt;br /&gt;args)&lt;br /&gt;{&lt;br /&gt;// Get the string you passed through&lt;br /&gt;string str =&lt;br /&gt;Encoding.UTF8.GetString(args.SelectionData.Data)));&lt;br /&gt;&lt;br /&gt;// Here you could do&lt;br /&gt;a check to see whether or not the TreeView has the value already&lt;br /&gt;&lt;br /&gt;// Add&lt;br /&gt;to the first TreeView&lt;br /&gt;treeView1.Model.AppendValues(str);&lt;br /&gt;&lt;br /&gt;// Remove&lt;br /&gt;from the second TreeView&lt;br /&gt;treeView2.Model.Foreach(delegate(TreeModel mod,&lt;br /&gt;TreePath path, TreeIter it)&lt;br /&gt;{&lt;br /&gt;if (mod.GetValue(it, 0).ToString() == str)&lt;br /&gt;{&lt;br /&gt;treeView2.Model.Remove(ref it);&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;return&lt;br /&gt;false;&lt;br /&gt;});&lt;br /&gt;}&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-8372980327650893991?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/8372980327650893991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=8372980327650893991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/8372980327650893991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/8372980327650893991'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/simple-drag-drop-between-2-treeviews.html' title='Simple Drag-Drop between 2 TreeViews'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-187950777215301546</id><published>2008-06-25T11:03:00.005-05:00</published><updated>2008-06-25T11:56:25.498-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='TreeView'/><title type='text'>Fun with the TreeView</title><content type='html'>// &lt;strong&gt;Single Click&lt;/strong&gt;&lt;br /&gt;myTreeView.Selection.Changed += new EventHandler(OnSelectionChanged);&lt;br /&gt;&lt;br /&gt;// &lt;strong&gt;Double-Click&lt;/strong&gt;&lt;br /&gt;myTreeView.RowActivated += new RowActivatedHandler(myTreeView_RowActivated);&lt;br /&gt;&lt;br /&gt;// &lt;strong&gt;Set the Selected Iter&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;// Declared outside the Constructor in the class somewhere so it can be seen in the entire class&lt;br /&gt;TreeIter iterSelected;&lt;br /&gt;private void OnSelectionChanged(object o, EventArgs args)&lt;br /&gt;{&lt;br /&gt;((TreeSelection)o).GetSelected(out iterSelected);&lt;br /&gt;// Here you could also set what object is selected or do something with the selection&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-187950777215301546?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/187950777215301546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=187950777215301546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/187950777215301546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/187950777215301546'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/fun-with-treeview.html' title='Fun with the TreeView'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-492991778192343584</id><published>2008-06-25T10:50:00.004-05:00</published><updated>2008-06-25T11:56:53.329-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pixbuf'/><category scheme='http://www.blogger.com/atom/ns#' term='Gdk'/><title type='text'>Converting Pixbuf to byte[] and back again</title><content type='html'>This simple code is useful for saving a Pixbuf to a database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;// this.Icon is a byte[] that would eventually get saved to the db&lt;/p&gt;&lt;p&gt;public Gdk.Pixbuf GetIcon&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;// If there isn't an Icon return a&lt;br /&gt;default&lt;br /&gt;return (this.Icon == null) ? SomeDefaultPixbuf : new Pixbuf(this.Icon);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public void SetIcon(Gdk.Pixbuf&lt;br /&gt;icon)&lt;br /&gt;{&lt;/p&gt;&lt;p&gt;// Give it an image type&lt;br /&gt;this.Icon = icon.SaveToBuffer("png");&lt;br /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-492991778192343584?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/492991778192343584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=492991778192343584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/492991778192343584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/492991778192343584'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/converting-pixbuf-to-byte-and-back.html' title='Converting Pixbuf to byte[] and back again'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-1626474759118615087</id><published>2008-06-24T15:17:00.005-05:00</published><updated>2008-06-25T11:57:25.244-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wiki'/><category scheme='http://www.blogger.com/atom/ns#' term='Change'/><category scheme='http://www.blogger.com/atom/ns#' term='Love'/><title type='text'>The Mono Wiki - Or How I learned to stop worrying and learn to use Google</title><content type='html'>Before we get started: Yes, I am well aware that the Mono Project has a limited staff and they are all focused on other things, but to me this point seems very important... (Maybe I'm alone on this one)&lt;br /&gt;&lt;br /&gt;The Mono Project is housed at Novell, a large company, and yet to me it has always seemed more like a hobby project. The lack of a respectable wiki and forums makes it seem as though Mono (no matter how great it is) is run out of a kids basement.&lt;br /&gt;A few complaints:&lt;br /&gt;&lt;br /&gt;The home page looks like a 1980's VCR with as much stuff packed onto it as possible, whether it is relevant or not. Is information about the Mono 2007 Summit really necessary?&lt;br /&gt;On the home page, the links 'start' and 'contribute' take you to pages that seem to me to have more or less the same information, just split up. Related projects that give great first impressions would be&lt;br /&gt;&lt;a href="http://www.opensuse.org/"&gt;http://www.opensuse.org/&lt;/a&gt; &lt;a href="http://banshee-project.org/"&gt;http://banshee-project.org/&lt;/a&gt; &lt;a href="http://www.gtk.org/"&gt;http://www.gtk.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It seems like the forums are a compromise between the community who keeps asking for a great forums (based at the mono home site) and the developers who seem to love the mailing lists. It's not secret that &lt;a href="http://www.asp.net/"&gt;http://www.asp.net/&lt;/a&gt; and the msdn forums are heavily used for not just questions but also discussions, which end up being healthy for the community.&lt;br /&gt;&lt;br /&gt;The actual 'wiki' part of the wiki is basically non-existent. Very rarely does new content go up and very rarely does obsolete content change. The only way for someone in the community to contribute is to post to the mailing list, which is like throwing a paper airplane into a black hole and hoping it ends up in the newspaper, and submitting an article on codeproject, which seems like a huge pain in the ass (hence this blog). I understand the developers are worried about incorrect or incomplete content being posted but that leaves Nobody contributing.&lt;br /&gt;&lt;br /&gt;Maybe a solution would be to create 2 wiki's, one that is accessible to any registered user and another that is accessed only by administrators, and the admins could post good articles from the community wiki to the official wiki. Also, use usernames and tie the wiki into an official forums (real forums, not a list of emails from the mailing list).&lt;br /&gt;&lt;br /&gt;These changes along with cleaning up the home page and the content of the wiki can give Mono a more professional look and attitude, which will go a long way towards generating interest and support. The appearance of the mono-project home web site has a strong effect on the project as a whole..&lt;br /&gt;&lt;br /&gt;And I know you developers love the mailing lists, but they suck ass.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-1626474759118615087?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/1626474759118615087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=1626474759118615087' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/1626474759118615087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/1626474759118615087'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/mono-wiki-or-how-i-learned-to-stop.html' title='The Mono Wiki - Or How I learned to stop worrying and learn to use Google'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-3949098764966725409</id><published>2008-06-24T14:31:00.000-05:00</published><updated>2008-06-24T14:41:22.890-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><title type='text'>Some of my favorite Mono Resources</title><content type='html'>// If you haven't learned to use the Mono Documentation yet, stop what you're doing and do that now. Google is no match for the amount you can learn from perusing the Documentation correctly&lt;br /&gt;&lt;a href="http://www.go-mono.com/docs/index.aspx"&gt;http://www.go-mono.com/docs/index.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mono-project.com/GtkSharp_TreeView_Tutorial"&gt;http://www.mono-project.com/GtkSharp_TreeView_Tutorial&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mono-project.com/GtkSharp:_Widget_Colours"&gt;http://www.mono-project.com/GtkSharp:_Widget_Colours&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mono-project.com/Responsive_Applications"&gt;http://mono-project.com/Responsive_Applications&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.go-mono.com/monologue/"&gt;http://www.go-mono.com/monologue/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mono-project.com/Mono.Addins"&gt;http://www.mono-project.com/Mono.Addins&lt;/a&gt;&lt;br /&gt;// Learn to read C/C++ and use the original Gtk Documentation as well&lt;br /&gt;&lt;a href="http://library.gnome.org/devel/gtk/stable/"&gt;http://library.gnome.org/devel/gtk/stable/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;NOTE: This post will continue to be updated as I find more great references&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-3949098764966725409?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/3949098764966725409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=3949098764966725409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/3949098764966725409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/3949098764966725409'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/some-of-my-favorite-mono-resources.html' title='Some of my favorite Mono Resources'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-1690633483869820562</id><published>2008-06-24T14:20:00.000-05:00</published><updated>2008-06-24T14:29:14.451-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='ComboBox'/><title type='text'>Rendering a ComboBox(Entry)</title><content type='html'>There is a good tutorial on the TreeView &lt;a href="http://www.mono-project.com/GtkSharp_TreeView_Tutorial"&gt;here&lt;/a&gt;. But when I went to try and execute something similar in a ComboBox I ran unto some problems.&lt;br /&gt;&lt;br /&gt;Specifically what I was trying to do was render a List/TreeStore that held only specific objects instead of multiple columns, (new ListStore(typeof(Project))). This doesn't work the same way in a ComboBox but after much trial and error I came up with this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;    public class ProjectComboBox : ComboBox&lt;br /&gt;    {&lt;br /&gt;        public ProjectComboBox() : base()&lt;br /&gt;        {&lt;br /&gt;            Initialize(null);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public ProjectComboBox(TreeModelFilter filter) : base()&lt;br /&gt;        {&lt;br /&gt;            Initialize(filter);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void Initialize(TreeModelFilter filter)&lt;br /&gt;        {&lt;br /&gt;           // Set a filter if there is one&lt;br /&gt;            if (filter == null)&lt;br /&gt;                this.Model = MyCachedListStore;&lt;br /&gt;            else&lt;br /&gt;                this.Model = filter;&lt;br /&gt;&lt;br /&gt;            CellRendererPixbuf cIcon = new CellRendererPixbuf();&lt;br /&gt;            this.PackStart(cIcon, true);&lt;br /&gt;            this.AddAttribute(cIcon, "pixbuf", 0);&lt;br /&gt;           &lt;br /&gt;            CellRendererText cName = new CellRendererText();&lt;br /&gt;            this.PackStart(cName, true);&lt;br /&gt;            this.AddAttribute(cName, "text", 1);&lt;br /&gt;&lt;br /&gt;            // This is how the Render mode is set&lt;br /&gt;            this.SetCellDataFunc(cIcon, RenderIcon);&lt;br /&gt;            this.SetCellDataFunc(cName, RenderName);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void RenderIcon(CellLayout layout, CellRenderer cellrenderer, TreeModel model, TreeIter iter)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                ((CellRendererPixbuf)cellrenderer).Pixbuf = ((Project)model.GetValue(iter, 0)).GetIcon.ScaleSimple(16, 16, Gdk.InterpType.Bilinear);&lt;br /&gt;            }&lt;br /&gt;            catch&lt;br /&gt;            {&lt;br /&gt;                // HACK: Here we have the oddest 'Object Reference Not Set to an Instance of an Object' error ever&lt;br /&gt;                // It doesn't actually cause any problems that I can see so for now we're just going to catch it and ignore it&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void RenderName(CellLayout layout, CellRenderer cellrenderer, TreeModel model, TreeIter iter)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                ((CellRendererText)cellrenderer).Text = ((Project)model.GetValue(iter, 0)).Name;&lt;br /&gt;            }&lt;br /&gt;            catch&lt;br /&gt;            {&lt;br /&gt;                // HACK: Here we have the oddest 'Object Reference Not Set to an Instance of an Object' error ever&lt;br /&gt;                // It doesn't actually cause any problems that I can see so for now we're just going to catch it and ignore it&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;NOTE: If anybody can tell me why the Object Reference error is occurring and how to fix it, it would be much appreciated, but for now this solution works and doesn't have any problems so it's not that big a deal&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-1690633483869820562?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/1690633483869820562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=1690633483869820562' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/1690633483869820562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/1690633483869820562'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/rendering-comboboxentry.html' title='Rendering a ComboBox(Entry)'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-8236139766088110327</id><published>2008-06-24T13:58:00.000-05:00</published><updated>2008-06-24T14:30:15.291-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='Organization'/><title type='text'>Do I have to have everything in a single install folder?</title><content type='html'>In my projects I have multiple .dll's I reference with my project and when I go to the /bin folder I don't want to see all of them just hanging out in a jumble. Call me anal, but I like my code nice and organized. However if the referenced assemblies are not in the same folder as the executing assembly (and not in the GAC) then .Net throws a temper tantrum.&lt;br /&gt;&lt;br /&gt;To solve this problem you can hook up to the AppDomain event AssemblyResolve and it will be called whenever .Net can't find your referenced assembly. You can then tell .Net where to find it.&lt;br /&gt;&lt;br /&gt;The simplest code I could break it down to is:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;public class Program&lt;br /&gt;{&lt;br /&gt;public static void Main()&lt;br /&gt;{&lt;br /&gt;// Tell .Net what to do if it can't find the referenced Assembly&lt;br /&gt;           AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(currentDomain_AssemblyResolve);&lt;br /&gt;&lt;br /&gt;// Program Initialization has to be in a different class (I dont know why)&lt;br /&gt;           MyProgram.Initialize();&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;// Your Assembly finding method&lt;br /&gt;     static Assembly currentDomain_AssemblyResolve(object sender, ResolveEventArgs args)&lt;br /&gt;     {&lt;br /&gt;// Set the Name of the .dll you are looking for (or .exe)&lt;br /&gt;           string assemblyName = (new AssemblyName(args.Name).Name) + ".dll";&lt;br /&gt;&lt;br /&gt;// Tell .Net where to find your Assembly&lt;br /&gt;// This can be anywhere you want&lt;br /&gt;// In this case it is a subdirectory of the folder my executable is in&lt;br /&gt;// Use Path.Combine instead of "/" or "\" for cross-platform reasons&lt;br /&gt;           string path = Path.Combine( Path.Combine( Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location.ToString()), "lib"), assemblyName);&lt;br /&gt;&lt;br /&gt;// Load the Assembly&lt;br /&gt;           Assembly myAssembly = Assembly.LoadFrom(path);&lt;br /&gt;&lt;br /&gt;// Optionally, if you have more than one directory you can check that&lt;br /&gt;//    here with something like:&lt;br /&gt;// if(myAssembly == null)&lt;br /&gt;// {&lt;br /&gt;&lt;/code&gt;&lt;code&gt;// path = Path.Combine( Path.Combine( Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location.ToString()), "lib2"), assemblyName);&lt;/code&gt;&lt;br /&gt;// &lt;code&gt;myAssembly = Assembly.LoadFrom(path);&lt;br /&gt;// }&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;           return myAssembly;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private class MyProgram&lt;br /&gt;{&lt;br /&gt;public static void Initialize()&lt;br /&gt;         {&lt;br /&gt;               Gtk.Application.Init();&lt;br /&gt;&lt;br /&gt;               new wMain();&lt;br /&gt;&lt;br /&gt;               Gtk.Application.Run();&lt;br /&gt;         }&lt;br /&gt;   }&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-8236139766088110327?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/8236139766088110327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=8236139766088110327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/8236139766088110327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/8236139766088110327'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/do-i-have-to-have-everything-in-single.html' title='Do I have to have everything in a single install folder?'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-1253491564953340230</id><published>2008-06-24T13:40:00.001-05:00</published><updated>2008-06-24T16:11:36.641-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gtk#'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='GAC'/><category scheme='http://www.blogger.com/atom/ns#' term='Cross-Platform'/><title type='text'>Mono with Visual Studio</title><content type='html'>There seems to be a lot of questions about this and no real clear answers that I could find when I was beginning.&lt;br /&gt;&lt;br /&gt;There is no real secret to using Mono and Gtk# with Visual Studio. You don't need the Mono compiler and you don't need to set any configuration settings.&lt;br /&gt;&lt;br /&gt;Look under your Mono install directory, probably something like C:\Program Files\Mono-1.9.1\ and look in the Global Assembly Cache, which in my install is located at&lt;br /&gt;&lt;br /&gt;C:\Program Files\Mono-1.9.1\lib\mono\gac&lt;br /&gt;&lt;br /&gt;Look for these assemblies at least:&lt;br /&gt;&lt;br /&gt;atk-sharp&lt;br /&gt;gdk-sharp&lt;br /&gt;glib-sharp&lt;br /&gt;gtk-sharp&lt;br /&gt;&lt;br /&gt;If you like you can also add glade-sharp, pango-sharp, mono.addins, mono.cairo, and any others you might need.&lt;br /&gt;&lt;br /&gt;*Copy and paste those into your project /bin directory&lt;br /&gt;*In Visual Studio right-click your project and select Add Reference, then browse to your bin directory and include those libraries&lt;br /&gt;*Then build and run your project using Visual Studio. It should run just fine.&lt;br /&gt;&lt;br /&gt;When you distribute your app just include those .dll's in the same folder as your executable and everything should work. In Linux you will need to add the .config files (like gtk-sharp.dll.config) to the bin as well. You should be able to find those in the mono install directory under your /usr directory (I think, I'm not using Linux at the moment so I'm not positive)&lt;br /&gt;&lt;br /&gt;At any rate, that should do it. Very easy. Just Copy/Reference/Build.&lt;br /&gt;&lt;br /&gt;Note: I am quite certain this is not the proper way to handle this and I should reference my global cache and set the vs project settings to use the mono compiler and blah blah blah, but seeing as how there are no clear instructions on how to easily do this, I have come up with this way, which I find simple and working (well). Shipping these libraries also assures my program is using the right one, without having to worry about which version of Mono is actually installed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-1253491564953340230?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/1253491564953340230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=1253491564953340230' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/1253491564953340230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/1253491564953340230'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/gtk-with-visual-studio.html' title='Mono with Visual Studio'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1572876944455283615.post-6294099763967196198</id><published>2008-06-18T20:49:00.001-05:00</published><updated>2008-06-24T14:31:32.603-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Respect'/><category scheme='http://www.blogger.com/atom/ns#' term='Love'/><title type='text'>I Love Mono...</title><content type='html'>I just wanted to throw that out there from the beginning. Good job Mono team! Yall have obviously worked hard and it's much appreciated.&lt;br /&gt;&lt;br /&gt;This blog is an attempt to give back to the community with code samples and tips and tricks that I learn along the way, that hopefully will help someone else.&lt;br /&gt;&lt;br /&gt;I may also occasionally fall into a rant about something that bothers me about Mono, but be assured it is out of love and the hope of making a better product, and not a personal attack. After all, nothing is perfect and where would an open source community be without the opinion of the community...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: Some of the posts here may seem simplistic to Mono developers who know what they are doing, but they may be things I struggled with when I first began learning Mono, so maybe they'll help a few beginners&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1572876944455283615-6294099763967196198?l=iggyma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iggyma.blogspot.com/feeds/6294099763967196198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1572876944455283615&amp;postID=6294099763967196198' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/6294099763967196198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1572876944455283615/posts/default/6294099763967196198'/><link rel='alternate' type='text/html' href='http://iggyma.blogspot.com/2008/06/i-love-mono.html' title='I Love Mono...'/><author><name>Iggy MA</name><uri>http://www.blogger.com/profile/17641888791225347319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
