<?xml version="1.0" encoding="iso-8859-1"?>
<feed version="0.3" 
	xmlns="http://purl.org/atom/ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xml:lang="eng">
	<title>Lluis' Blog</title>
	<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/index.php"/>
	<modified>2006-12-30T10:29:35-05:00</modified>
	<author>
	<name>lluis</name>
	<url>http://primates.ximian.com/~lluis/blog/index.php</url>
	<email>lluis@novell.com</email>
	</author>
	<tagline>By Lluis Sanchez Gual</tagline>
	<id>tag:pivotpowered,2006:lluisblog</id>
	<generator url="http://www.pivotlog.net" version="Pivot - 1.24.3: 'Arcee'">Pivot</generator>
	<copyright>Copyright (c) 2006, Authors of Lluis' Blog</copyright>
	
	
	
	<entry>
		<title>Blog moved</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=57" />
		<modified>2006-12-30T10:29:00-05:00</modified>
		<issued>2006-12-30T10:29:00-05:00</issued>
		<created>2006-12-30T10:29:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.57</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">Due to some problems with comment spammers and lack of time to fix it I decided to move my blog to Blogger. The new home for my blog is: http://foodformonkeys.blogspot.com.Thanks for listening!</summary>
		<dc:subject>Blog moved</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=57"><![CDATA[ Due to some problems with comment spammers and lack of time to fix it I decided to move my blog to Blogger. The new home for my blog is: <a href="http://foodformonkeys.blogspot.com"  target='_blank'>http://foodformonkeys.blogspot.com</a>.<br  />Thanks for listening!</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Shooting memory</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=56" />
		<modified>2006-11-13T12:29:00-05:00</modified>
		<issued>2006-11-13T12:29:00-05:00</issued>
		<created>2006-11-13T12:29:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.56</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">Heap-shot is a new memory profiler I've been working on. I used this profiler in the last MonoDevelop release to track down memory leaks, and it turned out to be really useful. So the idea is the following: you start a mono application using the heap-shot profiler like this:&amp;gt; mono --profile=heap-shot myapp.exeThen you start the heap-shot tool by just running:&amp;gt; heap-shot-guiWhen the application is running, click on &quot;Memory snapshot&quot; and select the process you just started. At this point, heap-shot will make a snapshot of the process memory and will load it into the heap-shot tool. You'll see then two tabs: one shows a summary of the snapshot (number of objects and total managed memory), the other tab shows a list of types, and for each type the number of instances, the total memory size and the average size. The list of types is in fact a tree of references. By expanding a type you'll get a list of types referenced by that type. If you want to examine a type in detail, you can double-click on the type name and it will show the type subtree in a separate tab.It is also possible to see inverse references, that is, see what objects reference objects of a given type. For example, if your app has 2000 int arrays in memory and you want to see what is holding all those int[], just click on the &quot;Inverse references&quot; checkbox and expand the int[] node. You can keep expanding as many levels as you want, what you'll see is something like this:heap-shot can also show differences between two snapshots (that is, which objects have been allocated between two snapshots). To use this feature just take two snapshots, click on the checkbox of the snapshot you want to use as base snapshot, and then select the second snapshot. All information you'll now see in the references tabs will be about newly allocated objects only.You can get heap-shot from SVN (module name: heap-shot). The README file has some more information. Enjoy!</summary>
		<dc:subject>Shooting memory</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=56"><![CDATA[ <b>Heap-shot</b> is a new memory profiler I've been working on. I used this profiler in the last MonoDevelop release to track down memory leaks, and it turned out to be really useful. So the idea is the following: you start a mono application using the heap-shot profiler like this:<br  /><pre>&gt; mono --profile=heap-shot myapp.exe</pre>Then you start the heap-shot tool by just running:<br  /><pre>&gt; heap-shot-gui</pre>When the application is running, click on "Memory snapshot" and select the process you just started. At this point, heap-shot will make a snapshot of the process memory and will load it into the heap-shot tool. You'll see then two tabs: one shows a summary of the snapshot (number of objects and total managed memory), the other tab shows a list of types, and for each type the number of instances, the total memory size and the average size. The list of types is in fact a tree of references. By expanding a type you'll get a list of types referenced by that type. If you want to examine a type in detail, you can double-click on the type name and it will show the type subtree in a separate tab.<br  /><br  />It is also possible to see inverse references, that is, see what objects reference objects of a given type. For example, if your app has 2000 int arrays in memory and you want to see what is holding all those int[], just click on the "Inverse references" checkbox and expand the int[] node. You can keep expanding as many levels as you want, what you'll see is something like this:<br  /><br  /><p style="text-align:center;"><a href='http://primates.ximian.com/~lluis/blog/images/heapshot.png'  style='border: 0;' target="_self"  class='pivot-popuptext' ><img src="http://primates.ximian.com/~lluis/blog/images/heapshot.thumb.png" border="1" alt="" title=""  class='pivot-popupimage'/></a></p><br  /><br  />heap-shot can also show differences between two snapshots (that is, which objects have been allocated between two snapshots). To use this feature just take two snapshots, click on the checkbox of the snapshot you want to use as base snapshot, and then select the second snapshot. All information you'll now see in the references tabs will be about newly allocated objects only.<br  /><br  />You can get heap-shot from SVN (module name: heap-shot). The <a href="http://svn.myrealbox.com/viewcvs/trunk/heap-shot/README?rev=67393&amp;view=auto"  target='_blank'>README</a> file has some more information. Enjoy! ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Away</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=55" />
		<modified>2006-09-30T16:38:00-05:00</modified>
		<issued>2006-09-30T16:38:00-05:00</issued>
		<created>2006-09-30T16:38:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.55</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">I hope I can find time in the following weeks to blog about those wonderful days I spent in Puerto Vallarta (Mexico). I was invited to talk about Mono and MonoDevelop in the 5º Festival GNU/Linux y Software Libre. Right now I'm getting ready for two weeks of holidays, which I'll spend visiting Mexico DF and Chiapas. And after that, I'll be traveling to Boston, where I'll attend the Mono Users and Developers Meeting. I look forward to meet with all Mono friends there!</summary>
		<dc:subject>Away</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=55"><![CDATA[ I hope I can find time in the following weeks to blog about those wonderful days I spent in Puerto Vallarta (Mexico). I was invited to talk about Mono and MonoDevelop in the <a href="http://festivaldesoftwarelibre.org/fsl2006/"  target='_blank'>5º Festival GNU/Linux y Software Libre</a>. Right now I'm getting ready for two weeks of holidays, which I'll spend visiting Mexico DF and Chiapas. And after that, I'll be traveling to Boston, where I'll attend the <a href="http://www.go-mono.com/meeting/"  target='_blank'>Mono Users and Developers Meeting</a>. I look forward to meet with all Mono friends there!</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Visiting Mexico</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=54" />
		<modified>2006-08-06T14:19:00-05:00</modified>
		<issued>2006-08-06T14:19:00-05:00</issued>
		<created>2006-08-06T14:19:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.54</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">I'm planning a trip the Mexico next september. I'm going to attend two conferences, the first one is the GULEV in Veracruz, from 14 to 16 september, and the second one is the FSL at Puerto Vallarta, from 27 to 29 september. So in the middle I'll have a couple of weeks of holidays I plan to spend visiting the country.So, I'm going to do a call for proposals. Taking into account that I have a couple of weeks, and that I want to avoid beach tourism, what are the best places to go? suggestions are welcome!And of course if somebody wants to meet to talk about Mono or just to have some beers together, just drop me an email  (lluis at ximian.com)</summary>
		<dc:subject>Visiting Mexico</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=54"><![CDATA[ I'm planning a trip the Mexico next september. I'm going to attend two conferences, the first one is the GULEV in Veracruz, from 14 to 16 september, and the second one is the FSL at Puerto Vallarta, from 27 to 29 september. So in the middle I'll have a couple of weeks of holidays I plan to spend visiting the country.<br  /><br  />So, I'm going to do a call for proposals. Taking into account that I have a couple of weeks, and that I want to avoid beach tourism, what are the best places to go? suggestions are welcome!<br  />And of course if somebody wants to meet to talk about Mono or just to have some beers together, just drop me an email <img src='http://primates.ximian.com/~lluis/blog/pivot/includes/emot/e_121.gif' alt=';-)' align='middle'/> (lluis at ximian.com)</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>An exciting GUADEC</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=53" />
		<modified>2006-06-21T13:31:00-05:00</modified>
		<issued>2006-06-21T13:31:00-05:00</issued>
		<created>2006-06-21T13:31:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.53</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">Only a few days left for the GUADEC, wow! I can't wait!. This is going
to be my first GUADEC ever, and it will be a very special one since
I'll giving three talks in the whole week.

The first one will be next saturday in catalan, as part of the mini-GUADEC we've been organizing for the catalan comunity. GUADEC-CA
is going to be a set of sessions with the special goal of introducing
GNOME to people who don't know much about the Linux desktop. We've done
some advertising of the event among local companies. My talk is done in
colaboration with Ramon Navarro. I'll present an overview of the GNOME
development platform, and Ramon will be demonstrating how to develop
applications using Mono.

On Sunday 25th there will be a small Mono track
for the spanish comunity. We have introductory sessions for Mono and
GTK#, and I'm giving a talk about MonoDevelop. If you like/use/want to
know more about Mono come to see us.

On Wednesday 28th I'll give my official GUADEC talk: &quot;MonoDevelop: a GNOME IDE&quot;. You can't miss it if you want to see the latest features of MonoDevelop!</summary>
		<dc:subject>An exciting GUADEC</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=53"><![CDATA[ Only a few days left for the GUADEC, wow! I can't wait!. This is going
to be my first GUADEC ever, and it will be a very special one since
I'll giving three talks in the whole week.<br  />
<br  />
The first one will be next saturday in catalan, as part of the mini-GUADEC we've been organizing for the catalan comunity. <a href="http://www.gnome.cat/Conferencia_GNOME"  target='_blank'>GUADEC-CA</a>
is going to be a set of sessions with the special goal of introducing
GNOME to people who don't know much about the Linux desktop. We've done
some advertising of the event among local companies. My talk is done in
colaboration with Ramon Navarro. I'll present an overview of the GNOME
development platform, and Ramon will be demonstrating how to develop
applications using Mono.<br  />
<br  />
On Sunday 25th there will be a small <a href="http://guadec.org/GUADEC2006/schedule/WUW/ES-CA"  target='_blank'>Mono track</a>
for the spanish comunity. We have introductory sessions for Mono and
GTK#, and I'm giving a talk about MonoDevelop. If you like/use/want to
know more about Mono come to see us.<br  />
<br  />
On Wednesday 28th I'll give my official GUADEC talk: "<a href="http://guadec.org/node/228"  target='_blank'>MonoDevelop: a GNOME IDE</a>". You can't miss it if you want to see the latest features of MonoDevelop!</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Designing menus</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=52" />
		<modified>2006-05-23T08:52:00-05:00</modified>
		<issued>2006-05-23T08:52:00-05:00</issued>
		<created>2006-05-23T08:52:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.52</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">I've been working lately on a menu designer for Stetic/Monodevelop. The
designer is based on the UIManager/Action/ActionGroup model, and it has
been a real challenge to make easy building menus, and at the same time
take advantage of all features this model provides.

Building a menu is really easy and 'visual'. You only need to add a
menu bar to the window and start writing options. The menu designer
looks like a regular menu, but clicking on a menu it will select it, so
you can change its properties using the Properties pad. Clicking again
on the menu item when it is selected will start the editing mode of the
menu item, in which you can change the label or the icon. This is how
it looks like:


When you are creating menu items in this way, at the same time the
designer creates Actions for each menu item. Those actions are added to
the window's default ActionGroup. In the screenshot you'll see that the
widget palette now has a new section named &quot;Actions&quot;, which shows all
actions added to the window. If you had a toolbar, you could drag &amp;amp;
drop those actions into it (not yet implemented, though). 

You've also probably noticed a new &quot;Actions&quot; tab in the text editor.
This new tab shows a visual representation of the action group bound to
the window, and looks like this:



It is basically a list of all actions defined in the window. In this
designer you can select and change the properties of the actions, and
even bind actions to fields, so you can change the sensitivity or
visibility of the action at run time. 

This default action group is local to the window, which means that
handlers for action signals will be added to the window's class, and
fields for the actions will be added also to the window class. It also
means that if you create another window with another menu bar, you
won't be able to reuse the actions from another window. In case you
want to share actions between windows, you'll need to create a global
action group. In the New File dialog there is a new icon for creating
global action groups. A global action group is not bound to a specific
window, but it has its own class, and signals and fields are mapped
there. Actions belonging to global action groups will always be shown
in the palette, so you can add them to any window.

Icon Factories

Stetic/MonoDevelop can now manage icons to be included in a project.
The idea is that you select some images, give them an ID, and Stetic
will generate a Gtk.IconFactory for you and will register the icons
there. You can then use that ID when creating buttons or whatever that
requires an stock id. This was needed to make it easy to create actions
with custom images, since actions can only use stock ids, not pixbufs.
Here is a screenshot of the Edit Icon dialog:




.NET 2.0 in MonoDevelop

MonoDevelop is now being compiled with gmcs. This change is needed to
be able to reuse some of the code from SharpDevelop 2.0, and will allow
us to use nice 2.0 features. I also committed NRefactory into MD's svn
and made the necessary changes to our c# binding, so now MD can
properly parse C# 2.0 source code files. Generic classes are still not
very well supported by our c# binding, but at least they are properly
parsed. If you find any issue after this change, please let me know. We
need to do a good testing before the next release, since this is an
important change.</summary>
		<dc:subject>Designing menus</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=52"><![CDATA[ I've been working lately on a menu designer for Stetic/Monodevelop. The
designer is based on the UIManager/Action/ActionGroup model, and it has
been a real challenge to make easy building menus, and at the same time
take advantage of all features this model provides.<br  />
<br  />
Building a menu is really easy and 'visual'. You only need to add a
menu bar to the window and start writing options. The menu designer
looks like a regular menu, but clicking on a menu it will select it, so
you can change its properties using the Properties pad. Clicking again
on the menu item when it is selected will start the editing mode of the
menu item, in which you can change the label or the icon. This is how
it looks like:<br  />
<br  /><a href="http://primates.ximian.com/%7Elluis/blog/images/monodevelop-menudesigner.png"  target='_blank'><p style="text-align:center;"><img src="http://primates.ximian.com/~lluis/blog/images/monodevelop-menudesigner-s.png" border="0" title="" alt="" class="pivot-image" /></p></a><br  />
<br  />
When you are creating menu items in this way, at the same time the
designer creates Actions for each menu item. Those actions are added to
the window's default ActionGroup. In the screenshot you'll see that the
widget palette now has a new section named "Actions", which shows all
actions added to the window. If you had a toolbar, you could drag &amp;
drop those actions into it (not yet implemented, though). <br  />
<br  />
You've also probably noticed a new "Actions" tab in the text editor.
This new tab shows a visual representation of the action group bound to
the window, and looks like this:<br  />
<br  /><a href="http://primates.ximian.com/%7Elluis/blog/images/monodevelop-actiongroup.png"  target='_blank'>
<p style="text-align:center;"><img src="http://primates.ximian.com/~lluis/blog/images/monodevelop-actiongroup-s.png" border="0" title="" alt="" class="pivot-image" /></p></a><br  />
<br  />
It is basically a list of all actions defined in the window. In this
designer you can select and change the properties of the actions, and
even bind actions to fields, so you can change the sensitivity or
visibility of the action at run time. <br  />
<br  />
This default action group is local to the window, which means that
handlers for action signals will be added to the window's class, and
fields for the actions will be added also to the window class. It also
means that if you create another window with another menu bar, you
won't be able to reuse the actions from another window. In case you
want to share actions between windows, you'll need to create a global
action group. In the New File dialog there is a new icon for creating
global action groups. A global action group is not bound to a specific
window, but it has its own class, and signals and fields are mapped
there. Actions belonging to global action groups will always be shown
in the palette, so you can add them to any window.<br  />
<br  />
<b>Icon Factories</b><br  />
<br  />
Stetic/MonoDevelop can now manage icons to be included in a project.
The idea is that you select some images, give them an ID, and Stetic
will generate a Gtk.IconFactory for you and will register the icons
there. You can then use that ID when creating buttons or whatever that
requires an stock id. This was needed to make it easy to create actions
with custom images, since actions can only use stock ids, not pixbufs.
Here is a screenshot of the Edit Icon dialog:<br  />
<br  /><a href="http://primates.ximian.com/%7Elluis/blog/images/monodevelop-iconeditor.png"  target='_blank'>

<p style="text-align:center;"><img src="http://primates.ximian.com/~lluis/blog/images/monodevelop-iconeditor-s.png" border="0" title="" alt="" class="pivot-image" /></p></a><br  />
<br  />
<b>.NET 2.0 in MonoDevelop</b><br  />
<br  />
MonoDevelop is now being compiled with gmcs. This change is needed to
be able to reuse some of the code from SharpDevelop 2.0, and will allow
us to use nice 2.0 features. I also committed NRefactory into MD's svn
and made the necessary changes to our c# binding, so now MD can
properly parse C# 2.0 source code files. Generic classes are still not
very well supported by our c# binding, but at least they are properly
parsed. If you find any issue after this change, please let me know. We
need to do a good testing before the next release, since this is an
important change.</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Summer is approaching</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=51" />
		<modified>2006-05-04T18:15:00-05:00</modified>
		<issued>2006-05-04T18:15:00-05:00</issued>
		<created>2006-05-04T18:15:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.51</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">I'm really happy with the last MonoDevelop release. Looks like a GUI
designer is just what people was waiting for, and we've got very
positive feedback.&amp;nbsp; I'm planing a new release (0.11) very soon
which will fix many of the bugs reported in the last weeks. MD 0.11
will also have support for compiling .NET 2.0 assemblies. To make it
possible I had to change some of the compilation and code completion
classes, since they could only manage .NET 1.1 assemblies, or being
more precise, assemblies compiled with the same version MD is compiled.
Now MD is completely independent from the assemblies it manages (thanks
to Cecil!), so we can safely start compiling MD with gmcs, and still be
able to support both 1.1 and 2.0 projects. MD 0.12 is probably a good
target for this change.

However, we still don't have a parser for C# 2.0, so code completion
will not work when using 2.0 syntax. The plan is to reuse the parser
from SharpDevelop, and this is yet another reason for compiling MD with
gmcs, since SharpDevelop needs .NET 2.0.

I'm also working on the menu designer, but it won't make it for this
release. This designer is starting to look really nice, but there are
still some issues I need to solve, specially about how to map Actions,
Action Groups and their signals into C# classes and methods. In any
case, I think the menu designer should be ready for MD 0.12.

I've been able to find some time lately for writing documentation. I updated the Writing an Add-in article (the old one was really obsolete), and added Add-in Extension Tree Reference.
This last article is (more or less) automatically generated from the
add-in xml files, and provides the complete list of items you can
extend in MonoDevelop.

Google Summer Of Code

We have several project proposals for the Google SOC. If you are willing to apply, do it quickly since the deadline is May 8, only 4 days left!</summary>
		<dc:subject>Summer is approaching</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=51"><![CDATA[ I'm really happy with the last MonoDevelop release. Looks like a GUI
designer is just what people was waiting for, and we've got very
positive feedback.  I'm planing a new release (0.11) very soon
which will fix many of the bugs reported in the last weeks. MD 0.11
will also have support for compiling .NET 2.0 assemblies. To make it
possible I had to change some of the compilation and code completion
classes, since they could only manage .NET 1.1 assemblies, or being
more precise, assemblies compiled with the same version MD is compiled.
Now MD is completely independent from the assemblies it manages (thanks
to Cecil!), so we can safely start compiling MD with gmcs, and still be
able to support both 1.1 and 2.0 projects. MD 0.12 is probably a good
target for this change.<br  />
<br  />
However, we still don't have a parser for C# 2.0, so code completion
will not work when using 2.0 syntax. The plan is to reuse the parser
from SharpDevelop, and this is yet another reason for compiling MD with
gmcs, since SharpDevelop needs .NET 2.0.<br  />
<br  />
I'm also working on the menu designer, but it won't make it for this
release. This designer is starting to look really nice, but there are
still some issues I need to solve, specially about how to map Actions,
Action Groups and their signals into C# classes and methods. In any
case, I think the menu designer should be ready for MD 0.12.<br  />
<br  />
I've been able to find some time lately for writing documentation. I updated the <a href="http://www.monodevelop.com/Writing_an_Add-In"  target='_blank'>Writing an Add-in</a> article (the old one was really obsolete), and added <a href="http://www.monodevelop.com/Extension_Tree_Reference"  target='_blank'>Add-in Extension Tree Reference</a>.
This last article is (more or less) automatically generated from the
add-in xml files, and provides the complete list of items you can
extend in MonoDevelop.<br  />
<br  />
<b>Google Summer Of Code</b><br  />
<br  />
We have several <a href="http://www.mono-project.com/StudentProjects#MonoDevelop"  target='_blank'>project proposals</a> for the Google SOC. If you are willing to apply, do it quickly since the deadline is May 8, <b>only 4 days left</b>!</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Using TreeView custom editors in GTK#</title>
		<link rel="alternate" type="text/html" href="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=50" />
		<modified>2006-03-27T11:00:00-05:00</modified>
		<issued>2006-03-27T11:00:00-05:00</issued>
		<created>2006-03-27T11:00:00-05:00</created>
		<id>tag:pivotpowered,2006:lluisblog.50</id>
		<link rel="related" type="text/html" href="" title="" />
		<summary type="text/plain">Right now GTK# has no support for GInterface, which means that you
can't implement GTK interfaces such as CellEditable. Due to this
limitation, although you can create custom cell renderers (by just
subclassing CellRenderer), those cell renderers won't be able to
provide custom cell editors. Until we have proper suppor for
GInterface, here is a hack to workaround this problem:

// In your CellRenderer...public override CellEditable StartEditing (Gdk.Event ev, Widget widget, string path, 	Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags){	MyEditor editor = new MyEditor ();	return new TreeViewCellContainer (editor);}MyEditor is the widget you want to use as cell editor. It can be
any widget, there is no need to implement CellEditable.
TreeViewCellContainer is the following class:

class TreeViewCellContainer: Entry{	EventBox box;		public TreeViewCellContainer (Gtk.Widget child)	{		box = new EventBox ();		box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);		box.ModifyBg (StateType.Normal, Style.White);		box.Add (child);		child.Show ();		Show ();	}		[GLib.ConnectBefore]	void OnClickBox (object s, ButtonPressEventArgs args)	{		// Avoid forwarding the button press event to the		// tree, since it would hide the cell editor.		args.RetVal = true;	}		protected override void OnParentSet (Gtk.Widget parent)	{		base.OnParentSet (parent);				if (Parent != null) {			if (ParentWindow != null)				box.ParentWindow = ParentWindow;			box.Parent = Parent;			box.Show ();		}		else			box.Unparent ();	}		protected override void OnShown ()	{		// Do nothing.	}		protected override void OnSizeAllocated (Gdk.Rectangle allocation)	{		base.OnSizeAllocated (allocation);		box.SizeRequest ();		box.Allocation = allocation;	}}

Enjoy.</summary>
		<dc:subject>Using TreeView custom editors in GTK#</dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://primates.ximian.com/~lluis/blog/pivot/entry.php?id=50"><![CDATA[ Right now GTK# has no support for GInterface, which means that you
can't implement GTK interfaces such as CellEditable. Due to this
limitation, although you can create custom cell renderers (by just
subclassing CellRenderer), those cell renderers won't be able to
provide custom cell editors. Until we have proper suppor for
GInterface, here is a <b>hack</b> to workaround this problem:<br  />
<br  />
<pre>// In your CellRenderer...<br  /><br  />public override CellEditable StartEditing (Gdk.Event ev, Widget widget, string path, <br  />	Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags)<br  />{<br  />	MyEditor editor = new MyEditor ();<br  />	return new TreeViewCellContainer (editor);<br  />}<br  /><br  /></pre>MyEditor is the widget you want to use as cell editor. It can be
any widget, there is no need to implement CellEditable.
TreeViewCellContainer is the following class:<br  />
<br  />
<pre>class TreeViewCellContainer: Entry<br  />{<br  />	EventBox box;<br  />	<br  />	public TreeViewCellContainer (Gtk.Widget child)<br  />	{<br  />		box = new EventBox ();<br  />		box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);<br  />		box.ModifyBg (StateType.Normal, Style.White);<br  />		box.Add (child);<br  />		child.Show ();<br  />		Show ();<br  />	}<br  />	<br  />	[GLib.ConnectBefore]<br  />	void OnClickBox (object s, ButtonPressEventArgs args)<br  />	{<br  />		// Avoid forwarding the button press event to the<br  />		// tree, since it would hide the cell editor.<br  />		args.RetVal = true;<br  />	}<br  />	<br  />	protected override void OnParentSet (Gtk.Widget parent)<br  />	{<br  />		base.OnParentSet (parent);<br  />		<br  />		if (Parent != null) {<br  />			if (ParentWindow != null)<br  />				box.ParentWindow = ParentWindow;<br  />			box.Parent = Parent;<br  />			box.Show ();<br  />		}<br  />		else<br  />			box.Unparent ();<br  />	}<br  />	<br  />	protected override void OnShown ()<br  />	{<br  />		// Do nothing.<br  />	}<br  />	<br  />	protected override void OnSizeAllocated (Gdk.Rectangle allocation)<br  />	{<br  />		base.OnSizeAllocated (allocation);<br  />		box.SizeRequest ();<br  />		box.Allocation = allocation;<br  />	}<br  />}<br  />
</pre>
<p>Enjoy.</p> ]]></content>
		<author>
			<name>lluis</name>
		</author>
	</entry>
	
	
	
</feed>