<?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: Gtk Pie Chart Widget</title>
	<atom:link href="http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/</link>
	<description>The Element of Aron and Heather</description>
	<lastBuildDate>Mon, 27 Feb 2012 22:10:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: William</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/comment-page-1/#comment-9181</link>
		<dc:creator>William</dc:creator>
		<pubDate>Mon, 27 Feb 2012 22:10:29 +0000</pubDate>
		<guid isPermaLink="false">http://rubinium.org/blog/?p=181#comment-9181</guid>
		<description>How difficult would it be alter this so it draws with GDK primitives? Would you be interested in attempting this? I&#039;m working on a program that does not support cairo, it uses an older version of GTK.</description>
		<content:encoded><![CDATA[<p>How difficult would it be alter this so it draws with GDK primitives? Would you be interested in attempting this? I&#8217;m working on a program that does not support cairo, it uses an older version of GTK.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jf</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/comment-page-1/#comment-9145</link>
		<dc:creator>jf</dc:creator>
		<pubDate>Wed, 26 Jan 2011 18:24:56 +0000</pubDate>
		<guid isPermaLink="false">http://rubinium.org/blog/?p=181#comment-9145</guid>
		<description>Nice. When i compiled got a few warnings and minor errors.

compiled the widget with -D_GNU_SOURCE to remove math.h errors and when linking added -lm.

Thanks for the widget.</description>
		<content:encoded><![CDATA[<p>Nice. When i compiled got a few warnings and minor errors.</p>
<p>compiled the widget with -D_GNU_SOURCE to remove math.h errors and when linking added -lm.</p>
<p>Thanks for the widget.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A R Baboon</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/comment-page-1/#comment-9052</link>
		<dc:creator>A R Baboon</dc:creator>
		<pubDate>Tue, 19 May 2009 21:53:18 +0000</pubDate>
		<guid isPermaLink="false">http://rubinium.org/blog/?p=181#comment-9052</guid>
		<description>Sure:
&lt;pre lang=&quot;c&quot;&gt;
#include &lt;stdlib.h&gt;
#include &lt;math.h&gt;
#include &lt;glib.h&gt;
#include &lt;gtk/gtk.h&gt;
#include &quot;gtk_pie_chart.h&quot;


gboolean rotate_chart_tcb( GtkPieChart *pie ) {
  static unsigned long count = 0;
  double angle;
  
  angle = (M_PI*2.0/100.0)*(count%100) - M_PI;
  g_object_set( pie, &quot;start_angle&quot;, angle, NULL );
  
  count++;
  
  gtk_widget_queue_draw( (GtkWidget *)pie );
  
  return( TRUE );
}


void quit () {
  gtk_exit( 0 );
}


int main( int argc, char *argv[] ) {
  GtkWidget *win, *vbox, *pie;
  float rgba[4] = { 1.0, 1.0, 0.5, 1.0 };
  
  gtk_init( &amp;argc, &amp;argv );
  
  win = gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( win, &quot;Pie Chart Test&quot; );
  
  vbox = gtk_vbox_new( FALSE, 0 );
  gtk_container_add( GTK_CONTAINER(win), vbox );
  gtk_widget_show( vbox );
  
  gtk_signal_connect( GTK_OBJECT(win), &quot;destroy&quot;, GTK_SIGNAL_FUNC(quit), NULL );
  
  // Create the drawing area
  pie = gtk_pie_chart_new();
  gtk_pie_chart_add_segment( GTK_PIE_CHART(pie), 0.5, &quot;First&quot;, rgba );
  rgba[0] = 0.5;
  gtk_pie_chart_add_segment( GTK_PIE_CHART(pie), 0.25, &quot;Second&quot;, rgba );
  rgba[1] = 0.5;
  rgba[2] = 1.0;
  gtk_pie_chart_add_segment( GTK_PIE_CHART(pie), 0.25, &quot;Third&quot;, rgba );
  
  gtk_box_pack_start( GTK_BOX(vbox), pie, TRUE, TRUE, 0 );
  
  gtk_widget_show( pie );
  
  gtk_widget_show_all( win );
  
  g_timeout_add( 100, (GSourceFunc)rotate_chart_tcb, pie );
  
  gtk_main();
  
  exit( 0 );
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Sure:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;math.h&gt;</span>
<span style="color: #339933;">#include &lt;glib.h&gt;</span>
<span style="color: #339933;">#include &lt;gtk/gtk.h&gt;</span>
<span style="color: #339933;">#include &quot;gtk_pie_chart.h&quot;</span>
&nbsp;
&nbsp;
gboolean rotate_chart_tcb<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">static</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> count <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">double</span> angle<span style="color: #339933;">;</span>
&nbsp;
  angle <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>M_PI<span style="color: #339933;">*</span><span style="color:#800080;">2.0</span><span style="color: #339933;">/</span><span style="color:#800080;">100.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>count<span style="color: #339933;">%</span><span style="color:#800080;">100</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> M_PI<span style="color: #339933;">;</span>
  g_object_set<span style="color: #009900;">&#40;</span> pie<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;start_angle&quot;</span><span style="color: #339933;">,</span> angle<span style="color: #339933;">,</span> NULL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  count<span style="color: #339933;">++;</span>
&nbsp;
  gtk_widget_queue_draw<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>GtkWidget <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>pie <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> TRUE <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #993333;">void</span> quit <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  gtk_exit<span style="color: #009900;">&#40;</span> <span style="color: #0000dd;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkWidget <span style="color: #339933;">*</span>win<span style="color: #339933;">,</span> <span style="color: #339933;">*</span>vbox<span style="color: #339933;">,</span> <span style="color: #339933;">*</span>pie<span style="color: #339933;">;</span>
  <span style="color: #993333;">float</span> rgba<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color:#800080;">1.0</span><span style="color: #339933;">,</span> <span style="color:#800080;">1.0</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">,</span> <span style="color:#800080;">1.0</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
  gtk_init<span style="color: #009900;">&#40;</span> <span style="color: #339933;">&amp;</span>argc<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>argv <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  win <span style="color: #339933;">=</span> gtk_window_new<span style="color: #009900;">&#40;</span> GTK_WINDOW_TOPLEVEL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  gtk_widget_set_name<span style="color: #009900;">&#40;</span> win<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Pie Chart Test&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  vbox <span style="color: #339933;">=</span> gtk_vbox_new<span style="color: #009900;">&#40;</span> FALSE<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  gtk_container_add<span style="color: #009900;">&#40;</span> GTK_CONTAINER<span style="color: #009900;">&#40;</span>win<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> vbox <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  gtk_widget_show<span style="color: #009900;">&#40;</span> vbox <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  gtk_signal_connect<span style="color: #009900;">&#40;</span> GTK_OBJECT<span style="color: #009900;">&#40;</span>win<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;destroy&quot;</span><span style="color: #339933;">,</span> GTK_SIGNAL_FUNC<span style="color: #009900;">&#40;</span>quit<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> NULL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Create the drawing area</span>
  pie <span style="color: #339933;">=</span> gtk_pie_chart_new<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  gtk_pie_chart_add_segment<span style="color: #009900;">&#40;</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;First&quot;</span><span style="color: #339933;">,</span> rgba <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  rgba<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">;</span>
  gtk_pie_chart_add_segment<span style="color: #009900;">&#40;</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.25</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Second&quot;</span><span style="color: #339933;">,</span> rgba <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  rgba<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">;</span>
  rgba<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color:#800080;">1.0</span><span style="color: #339933;">;</span>
  gtk_pie_chart_add_segment<span style="color: #009900;">&#40;</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.25</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Third&quot;</span><span style="color: #339933;">,</span> rgba <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  gtk_box_pack_start<span style="color: #009900;">&#40;</span> GTK_BOX<span style="color: #009900;">&#40;</span>vbox<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> pie<span style="color: #339933;">,</span> TRUE<span style="color: #339933;">,</span> TRUE<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  gtk_widget_show<span style="color: #009900;">&#40;</span> pie <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  gtk_widget_show_all<span style="color: #009900;">&#40;</span> win <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  g_timeout_add<span style="color: #009900;">&#40;</span> <span style="color: #0000dd;">100</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>GSourceFunc<span style="color: #009900;">&#41;</span>rotate_chart_tcb<span style="color: #339933;">,</span> pie <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  gtk_main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  exit<span style="color: #009900;">&#40;</span> <span style="color: #0000dd;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Haneef</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/comment-page-1/#comment-9051</link>
		<dc:creator>Haneef</dc:creator>
		<pubDate>Tue, 19 May 2009 05:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://rubinium.org/blog/?p=181#comment-9051</guid>
		<description>Can u please expose sample app which uses above functionalities</description>
		<content:encoded><![CDATA[<p>Can u please expose sample app which uses above functionalities</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A R Baboon</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/comment-page-1/#comment-9034</link>
		<dc:creator>A R Baboon</dc:creator>
		<pubDate>Wed, 16 Jul 2008 01:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://rubinium.org/blog/?p=181#comment-9034</guid>
		<description>Sure I have a couple of fixes. I am not entirely sure what its meant by + or - but it sounds like it would not be an issue.</description>
		<content:encoded><![CDATA[<p>Sure I have a couple of fixes. I am not entirely sure what its meant by + or &#8211; but it sounds like it would not be an issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stacy Teet</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/comment-page-1/#comment-9033</link>
		<dc:creator>Stacy Teet</dc:creator>
		<pubDate>Tue, 15 Jul 2008 18:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://rubinium.org/blog/?p=181#comment-9033</guid>
		<description>Great widget! I was wondering if you made any progress in the series?  I need a pie chart widget that I can customize how many slices and enter in text and a simple + or - result for each slice. Think I could do that with your widget?

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Great widget! I was wondering if you made any progress in the series?  I need a pie chart widget that I can customize how many slices and enter in text and a simple + or &#8211; result for each slice. Think I could do that with your widget?</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
</channel>
</rss>

