<?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>paulocabido.com &#187; python</title>
	<atom:link href="http://www.paulocabido.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulocabido.com</link>
	<description>I do all my own stunts!</description>
	<lastBuildDate>Mon, 06 Feb 2012 00:32:20 +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>pygtk + toolbar + toolbutton with custom image</title>
		<link>http://www.paulocabido.com/python/pygtk-toolbar-toolbutton-with-custom-image/</link>
		<comments>http://www.paulocabido.com/python/pygtk-toolbar-toolbutton-with-custom-image/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 10:15:01 +0000</pubDate>
		<dc:creator>pcabido</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[pygtk]]></category>
		<category><![CDATA[toolbar]]></category>
		<category><![CDATA[toolbutton]]></category>

		<guid isPermaLink="false">http://www.paulocabido.com/?p=152</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=paulocabido.com&link=http%3A%2F%2Fwww.paulocabido.com%2Fpython%2Fpygtk-toolbar-toolbutton-with-custom-image%2F&title=pygtk+%2B+toolbar+%2B+toolbutton+with+custom+image&desc=Last+night+I+had+more+trouble+than+I+was+expecting+while+trying+to+put+a+custom+image+on+a+toolbar+button.+I+had+already+done+this+with+tabs%2C+normal+buttons+and+solo.+It+was+easy+but+for+the+toolbutto&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Last night I had more trouble than I was expecting while trying to put a custom image on a toolbar button. I had already done this with tabs, normal buttons and solo. It was easy but for the toolbutton it wasn&#8217;t so obvious&#8230; maybe it was because of the hour, I don&#8217;t know. So here [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=paulocabido.com&link=http%3A%2F%2Fwww.paulocabido.com%2Fpython%2Fpygtk-toolbar-toolbutton-with-custom-image%2F&title=pygtk+%2B+toolbar+%2B+toolbutton+with+custom+image&desc=Last+night+I+had+more+trouble+than+I+was+expecting+while+trying+to+put+a+custom+image+on+a+toolbar+button.+I+had+already+done+this+with+tabs%2C+normal+buttons+and+solo.+It+was+easy+but+for+the+toolbutto&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>Last night I had more trouble than I was expecting while trying to put a custom image on a toolbar button. I had already done this with tabs, normal buttons and solo. It was easy but for the toolbutton it wasn&#8217;t so obvious&#8230; maybe it was because of the hour, I don&#8217;t know.<br />
So here goes a sample to help any one in need:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># create the pixbuf with the image and it's size.</span>
<span style="color: #808080; font-style: italic;"># 24,24 is the TaskEditor's toolbar icon size</span>
<span style="color: #808080; font-style: italic;"># the path gets the current document path to use with the image</span>
path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">abspath</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
icon_path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>path, <span style="color: #483d8b;">&quot;image.png&quot;</span><span style="color: black;">&#41;</span>
pixbuf = gtk.<span style="color: black;">gdk</span>.<span style="color: black;">pixbuf_new_from_file_at_size</span><span style="color: black;">&#40;</span>icon_path , <span style="color: #ff4500;">24</span>, <span style="color: #ff4500;">24</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># create the image and associate the pixbuf</span>
image = gtk.<span style="color: black;">Image</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
image.<span style="color: black;">set_from_pixbuf</span><span style="color: black;">&#40;</span>pixbuf<span style="color: black;">&#41;</span>
image.<span style="color: black;">show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># create the toolbutton</span>
btn = gtk.<span style="color: black;">ToolButton</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
btn.<span style="color: black;">set_icon_widget</span><span style="color: black;">&#40;</span>image<span style="color: black;">&#41;</span>
btn.<span style="color: black;">set_label</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Task location&quot;</span><span style="color: black;">&#41;</span>
btn.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'clicked'</span>, <span style="color: #008000;">self</span>.<span style="color: black;">some_method</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># then just add the item (btn) to the position you want</span>
toolbar.<span style="color: black;">insert</span><span style="color: black;">&#40;</span>btn, position<span style="color: black;">&#41;</span>
btn.<span style="color: black;">show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>That&#8217;s all! <img src='http://www.paulocabido.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulocabido.com/python/pygtk-toolbar-toolbutton-with-custom-image/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Summer of Code: Week 7</title>
		<link>http://www.paulocabido.com/gsoc/google-summer-of-code-week-7/</link>
		<comments>http://www.paulocabido.com/gsoc/google-summer-of-code-week-7/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 22:14:43 +0000</pubDate>
		<dc:creator>pcabido</dc:creator>
				<category><![CDATA[geoclue]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[getting things gnome]]></category>
		<category><![CDATA[gtg]]></category>
		<category><![CDATA[python-geoclue]]></category>
		<category><![CDATA[soc]]></category>

		<guid isPermaLink="false">http://www.paulocabido.com/?p=111</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=paulocabido.com&link=http%3A%2F%2Fwww.paulocabido.com%2Fgsoc%2Fgoogle-summer-of-code-week-7%2F&title=Google+Summer+of+Code%3A+Week+7&desc=I%27m+glad+to+be+working+with+the+GTG%21+community%2C+it%27s+growing+real+fast%21+This+week%2C+Getting+Things+Gnome%21+0.1.2+was+released.%0D%0A%0D%0AMore+screenshots+here.%0D%0AFor+the+curious+ones+a+review+of+GTG%21+made+by+Ry&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>I&#8217;m glad to be working with the GTG! community, it&#8217;s growing real fast! This week, Getting Things Gnome! 0.1.2 was released. More screenshots here. For the curious ones a review of GTG! made by Ryan Paul is available here. There are still lots of new features coming up! Anyone that wants to join us, feel [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=paulocabido.com&link=http%3A%2F%2Fwww.paulocabido.com%2Fgsoc%2Fgoogle-summer-of-code-week-7%2F&title=Google+Summer+of+Code%3A+Week+7&desc=I%27m+glad+to+be+working+with+the+GTG%21+community%2C+it%27s+growing+real+fast%21+This+week%2C+Getting+Things+Gnome%21+0.1.2+was+released.%0D%0A%0D%0AMore+screenshots+here.%0D%0AFor+the+curious+ones+a+review+of+GTG%21+made+by+Ry&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>I&#8217;m glad to be working with the GTG! community, it&#8217;s growing real fast! This week, <a href="http://gtg.fritalk.com/">Getting Things Gnome!</a> 0.1.2 was released.</p>
<p><a href="http://www.paulocabido.com/wp-content/uploads/2009/07/GTG.png" rel="prettyPhoto[111]" rel="lightbox[111]"><img src="http://www.paulocabido.com/wp-content/uploads/2009/07/GTG.png" alt="GTG" title="GTG" width="582" height="474" class="aligncenter size-medium wp-image-126" /></a><br />
More screenshots <a href="http://gtg.fritalk.com/pages/screenshots">here</a>.<br />
For the curious ones a review of GTG! made by Ryan Paul is available <a href="http://arstechnica.com/open-source/news/2009/07/getting-things-done-with-linux-todo-list-programs.ars">here</a>. There are still lots of new features coming up! Anyone that wants to join us, feel free to do it at IRC (gimp net at #gtg).</p>
<p>I just received an e-mail from Google notifying me that I have successfully passed the Midterm Evaluations. I already knew that I was going to pass but the confirmation is always good. <img src='http://www.paulocabido.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In week 7 I mainly worked on the python-geoclue module. A list of the module&#8217;s features are available <a href="http://live.gnome.org/gtg/soc/whatihavelearned#head-ddd5976fe2a85104f3913ad724af663b24560a43">here</a>.<br />
I also made a test file to test the module&#8217;s features and added the setup to install the module.<br />
Suggestions to improve the module are welcome! I already got the suggestion to add gobject-introspection support, so keep those suggestions coming!<br />
The code is available at <a href="https://code.launchpad.net/~pcabido/+junk/pygeoclue">https://code.launchpad.net/~pcabido/+junk/pygeoclue</a>.</p>
<p>I updated the wiki page that I left behind on the past weeks and created a page (<a href="http://live.gnome.org/gtg/soc/whatihavelearned">http://live.gnome.org/gtg/soc/whatihavelearned</a>) that is kind of a general report of what I done until now. The idea is to share what I have learned and it is intended to be allot more technical than it is now. It is also a good starting point for all the documentation that I&#8217;ll have to do.</p>
<p>Now I&#8217;m starting to work with libchamplain. I plan to have a working plugin with geoclue+libchamplin by the end of this week.<br />
All of this part of my work is available here: <a href="https://code.launchpad.net/~pcabido/gtg/plugin-engine">https://code.launchpad.net/~pcabido/gtg/plugin-engine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulocabido.com/gsoc/google-summer-of-code-week-7/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Google Summer of Code: Week 3</title>
		<link>http://www.paulocabido.com/gsoc/google-summer-of-code-week-3/</link>
		<comments>http://www.paulocabido.com/gsoc/google-summer-of-code-week-3/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 19:05:01 +0000</pubDate>
		<dc:creator>pcabido</dc:creator>
				<category><![CDATA[gnome]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[getting things gnome]]></category>
		<category><![CDATA[plug-in]]></category>

		<guid isPermaLink="false">http://www.paulocabido.com/?p=87</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=paulocabido.com&link=http%3A%2F%2Fwww.paulocabido.com%2Fgsoc%2Fgoogle-summer-of-code-week-3%2F&title=Google+Summer+of+Code%3A+Week+3&desc=On+week+three+I+accomplished+an+important+part+of+the+project%2C+that+was+to+have+by+the+end+of+the+week+a+%22working+prototype%22+of+the+plug-in+engine.+Its+not+complete+but+the+difficult+part+and+the+part&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>On week three I accomplished an important part of the project, that was to have by the end of the week a &#8220;working prototype&#8221; of the plug-in engine. Its not complete but the difficult part and the part where I was (very) confused is done. Plug-ins are loading and working. Briefly, the system is divided [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=paulocabido.com&link=http%3A%2F%2Fwww.paulocabido.com%2Fgsoc%2Fgoogle-summer-of-code-week-3%2F&title=Google+Summer+of+Code%3A+Week+3&desc=On+week+three+I+accomplished+an+important+part+of+the+project%2C+that+was+to+have+by+the+end+of+the+week+a+%22working+prototype%22+of+the+plug-in+engine.+Its+not+complete+but+the+difficult+part+and+the+part&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>On week three I accomplished an important part of the project, that was to have by the end of the week a &#8220;working prototype&#8221; of the plug-in engine. Its not complete but the difficult part and the part where I was (very) confused is done.<br />
Plug-ins are loading and working. Briefly, the system is divided into three parts:</p>
<ul>
<li>The Plugin Manager that handles the GUI for the plug-ins</li>
<li>The Plugin Engine that handles the load, initialization, activation, etc for the plug-ins</li>
<li>A third part that is the plug-in API (the methods that are allowed for a plug-in to use)</li>
</ul>
<p>
And for the screen shot lovers here are some images of what is done:<br />
<br />
<a href="http://www.paulocabido.com/wp-content/uploads/2009/06/Plugin_GUI.png" rel="prettyPhoto[87]" rel="lightbox[87]"><img src="http://www.paulocabido.com/wp-content/uploads/2009/06/Plugin_GUI-300x235.png" alt="Plugin_GUI" title="Plugin_GUI" width="300" height="235" class="aligncenter size-medium wp-image-89" /></a><br />
<a href="http://www.paulocabido.com/wp-content/uploads/2009/06/Plugin_working.png" rel="prettyPhoto[87]" rel="lightbox[87]"><img src="http://www.paulocabido.com/wp-content/uploads/2009/06/Plugin_working-300x133.png" alt="Plugin_working" title="Plugin_working" width="300" height="133" class="aligncenter size-medium wp-image-90" /></a><br />
<br />
The first screen shot is obvious, it&#8217;s the Plug-in Manager GUI and the second screen shot is the features that the plug-ins are implementing. The plug-ins are copys of each other, the each add a menu to the Plug-in menu on the menu bar and by clicking that menu you can see the action on the gnome-terminal and the last two buttons on the ToolBar are also put there by the plug-ins (you can also see the output on the gnome-terminal that resulted by a click on a button). New screen shots or maybe a video next week!<br />
<br />
For week 4 I have the intention to finish the plug-in engine, it will be a work in progress but I want to finish all the main parts, and start the geoclue-python module that I will later use with a plug-in in GTG!.<br />
<br />
Besides this I will continue my university marathon, here in Portugal the professors seam to wait for each other and set the tasks we have to do all at the same time. I still have 3 exams and 4 assignments to submit during June.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulocabido.com/gsoc/google-summer-of-code-week-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

