<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mcBachmann.de TechBlog &#187; tray</title>
	<atom:link href="http://blog.mcbachmann.de/tag/tray/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.mcbachmann.de</link>
	<description>Der Blog zur Website ;-)</description>
	<lastBuildDate>Wed, 11 Jan 2012 21:12:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GTK: Trayicon with effective 2 lines of C-Code</title>
		<link>http://blog.mcbachmann.de/linux/gtk-trayicon-with-effective-2-lines-of-c-code</link>
		<comments>http://blog.mcbachmann.de/linux/gtk-trayicon-with-effective-2-lines-of-c-code#comments</comments>
		<pubDate>Mon, 20 Jul 2009 15:29:57 +0000</pubDate>
		<dc:creator>Sven Bachmann</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[tray]]></category>

		<guid isPermaLink="false">http://blog.mcbachmann.de/?p=347</guid>
		<description><![CDATA[Because I always wanted to learn some GTK, I decided to try it first with a trayicon. And wow, it was that easy &#8211; ok, the functional factor is zero, but you&#8217;ll have a trayicon with a tooltip. And if you want more you can read the GTK documentation and extend it to the max. [...]]]></description>
			<content:encoded><![CDATA[<p>Because I always wanted to learn some GTK, I decided to try it first with a trayicon. And wow, it was that easy &#8211; ok, the functional factor is zero, but you&#8217;ll have a trayicon with a tooltip. And if you want more you can read the <a href="http://library.gnome.org/devel/gtk/2.16/GtkStatusIcon.html">GTK documentation</a> and extend it to the max.<span id="more-347"></span></p>
<p>So here it is: <strong>trayicon.c</strong></p>
<blockquote><p><code>#include &lt;gtk/gtk.h&gt;</p>
<p>int main(int argc, char *argv[])<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;gtk_init (&#038;argc, &#038;argv);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;GtkStatusIcon *status = gtk_status_icon_new_from_stock(GTK_STOCK_NO);<br />
&nbsp;&nbsp;&nbsp;&nbsp;gtk_status_icon_set_tooltip(status, "Nice Tooltip");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;gtk_main();<br />
&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br />
}</code></p></blockquote>
<p>As you can see, beside the C-Standard header and footer, and also the GTK header and footer, we have only two lines of code. Without the tooltip it would be only one.</p>
<p>To compile it, you&#8217;ll need the GTK libs and their development headers. The gcc command is:</p>
<blockquote><p><code>gcc -Wall trayicon.c -o trayicon `pkg-config --cflags --libs gtk+-2.0`</code></p></blockquote>
<p>After starting it, you&#8217;ll see a red circle in your tray &#8211; Good Luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mcbachmann.de/linux/gtk-trayicon-with-effective-2-lines-of-c-code/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

