<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: What&#8217;s in a name?</title>
	<atom:link href="http://www.chrishowie.com/2007/05/13/whats-in-a-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/</link>
	<description>Trading social skills for technical prowess since 1994</description>
	<pubDate>Tue, 06 Jan 2009 12:13:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/comment-page-1/#comment-709</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 15 May 2007 00:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishowie.com/2007/05/13/whats-in-a-name/#comment-709</guid>
		<description>On your second comment, yes, I knew that this was the issue.  (That's what I was trying to illustrate in my post.)

Good job on the research.  That at least explains this phenomenon.  Stuff like this should be included somewhere in the Gtk# docs so other people don't shoot themselves in the foot too.</description>
		<content:encoded><![CDATA[<p>On your second comment, yes, I knew that this was the issue.  (That&#8217;s what I was trying to illustrate in my post.)</p>
<p>Good job on the research.  That at least explains this phenomenon.  Stuff like this should be included somewhere in the Gtk# docs so other people don&#8217;t shoot themselves in the foot too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Bockover</title>
		<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/comment-page-1/#comment-708</link>
		<dc:creator>Aaron Bockover</dc:creator>
		<pubDate>Mon, 14 May 2007 21:04:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishowie.com/2007/05/13/whats-in-a-name/#comment-708</guid>
		<description>There's a lot of good RC/Style information here:
http://developer.gnome.org/doc/API/2.2/gtk/gtk-Resource-Files.html</description>
		<content:encoded><![CDATA[<p>There&#8217;s a lot of good RC/Style information here:<br />
<a href="http://developer.gnome.org/doc/API/2.2/gtk/gtk-Resource-Files.html" rel="nofollow">http://developer.gnome.org/doc/API/2.2/gtk/gtk-Resource-Files.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Bockover</title>
		<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/comment-page-1/#comment-707</link>
		<dc:creator>Aaron Bockover</dc:creator>
		<pubDate>Mon, 14 May 2007 21:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishowie.com/2007/05/13/whats-in-a-name/#comment-707</guid>
		<description>It's a theme/RC issue. gtkrc files do pattern matching on GTK+ class names to set the proper theme class for a widget. The Gtk# binding sets the GTK+ widget path/class name via reflection to something like "__gtksharp_3_MyClassName". You can see what it is by checking the Name property in Gtk.Widget.

So straight from the Clearlooks gtkrc file:

widget_class "*MenuItem.*" style "clearlooks-menu-item"

That is, the "clearlooks-menu-item" style is only applied to widgets whose class name ends in MenuItem. So the easy fix is to just tack on MenuItem to your class name, which is good form for naming convention anyway.

If you do not want to break API, you can probably manually override the widget path that Gtk# sets to something ending in "MenuItem".</description>
		<content:encoded><![CDATA[<p>It&#8217;s a theme/RC issue. gtkrc files do pattern matching on GTK+ class names to set the proper theme class for a widget. The Gtk# binding sets the GTK+ widget path/class name via reflection to something like &#8220;__gtksharp_3_MyClassName&#8221;. You can see what it is by checking the Name property in Gtk.Widget.</p>
<p>So straight from the Clearlooks gtkrc file:</p>
<p>widget_class &#8220;*MenuItem.*&#8221; style &#8220;clearlooks-menu-item&#8221;</p>
<p>That is, the &#8220;clearlooks-menu-item&#8221; style is only applied to widgets whose class name ends in MenuItem. So the easy fix is to just tack on MenuItem to your class name, which is good form for naming convention anyway.</p>
<p>If you do not want to break API, you can probably manually override the widget path that Gtk# sets to something ending in &#8220;MenuItem&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Bockover</title>
		<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/comment-page-1/#comment-706</link>
		<dc:creator>Aaron Bockover</dc:creator>
		<pubDate>Mon, 14 May 2007 20:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishowie.com/2007/05/13/whats-in-a-name/#comment-706</guid>
		<description>Oh wow, this is interesting. 

// Proper text color when item is selected (actually is "prelit")
public class CustomMenuItem : MenuItem
{ public CustomMenuItem(string label) : base(label) { } }

// Text color always remains Text(StateType.Normal)
public class CustomBlah : MenuItem
{ public CustomBlah(string label) : base(label) { } }

I'll look into where and why this happens - quite intriguing.</description>
		<content:encoded><![CDATA[<p>Oh wow, this is interesting. </p>
<p>// Proper text color when item is selected (actually is &#8220;prelit&#8221;)<br />
public class CustomMenuItem : MenuItem<br />
{ public CustomMenuItem(string label) : base(label) { } }</p>
<p>// Text color always remains Text(StateType.Normal)<br />
public class CustomBlah : MenuItem<br />
{ public CustomBlah(string label) : base(label) { } }</p>
<p>I&#8217;ll look into where and why this happens - quite intriguing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/comment-page-1/#comment-705</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 14 May 2007 19:22:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishowie.com/2007/05/13/whats-in-a-name/#comment-705</guid>
		<description>The class I wrote is like ten lines.  I simply chained to the base(String) constructor and overrode OnActivated, so no custom drawing.  The graphical error only happens when the name of the class doesn't end with "MenuItem".</description>
		<content:encoded><![CDATA[<p>The class I wrote is like ten lines.  I simply chained to the base(String) constructor and overrode OnActivated, so no custom drawing.  The graphical error only happens when the name of the class doesn&#8217;t end with &#8220;MenuItem&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Bockover</title>
		<link>http://www.chrishowie.com/2007/05/13/whats-in-a-name/comment-page-1/#comment-703</link>
		<dc:creator>Aaron Bockover</dc:creator>
		<pubDate>Mon, 14 May 2007 17:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.chrishowie.com/2007/05/13/whats-in-a-name/#comment-703</guid>
		<description>If that custom Gtk.MenuItem is doing its own drawing (sounds like it is), it needs to ensure that it sets the correct text color (Style.TextGC) based on the Gtk.StateType.Selected state, which should result in white text in clearlooks.

Although if I remember correctly, if you embed a Gtk.Label into a Gtk.MenuItem, it should be handled automagically.

Either way, this shouldn't be a Gtk# issue - this is a common issue with custom widgets derived from GtkMenuItem.

I've been working lately on some really strange and complex custom menu items that handle all the proper theming, so you may find this helpful:

http://abock.org/projects/complex-menu-example/

Good luck!</description>
		<content:encoded><![CDATA[<p>If that custom Gtk.MenuItem is doing its own drawing (sounds like it is), it needs to ensure that it sets the correct text color (Style.TextGC) based on the Gtk.StateType.Selected state, which should result in white text in clearlooks.</p>
<p>Although if I remember correctly, if you embed a Gtk.Label into a Gtk.MenuItem, it should be handled automagically.</p>
<p>Either way, this shouldn&#8217;t be a Gtk# issue - this is a common issue with custom widgets derived from GtkMenuItem.</p>
<p>I&#8217;ve been working lately on some really strange and complex custom menu items that handle all the proper theming, so you may find this helpful:</p>
<p><a href="http://abock.org/projects/complex-menu-example/" rel="nofollow">http://abock.org/projects/complex-menu-example/</a></p>
<p>Good luck!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
