<?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>Dan Bishop &#187; Software</title>
	<atom:link href="http://www.danbishop.org/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danbishop.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 28 May 2010 07:16:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Programming with PyGTK and Glade</title>
		<link>http://www.danbishop.org/2010/02/02/programming-with-pygtk-and-glade/</link>
		<comments>http://www.danbishop.org/2010/02/02/programming-with-pygtk-and-glade/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 16:17:19 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[glade]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=209</guid>
		<description><![CDATA[This is my translation of Florian Diesch&#8217;s guide found here: http://www.florian-diesch.de/doc/python-und-glade/online/einleitung.html I translated this guide as there doesn&#8217;t seem to be anything about using gtkbuilder and glade, rather than the older libGlade, with python. The guide is not yet complete, but I will keep working on it over the coming weeks. Dieser Werk bzw. Inhalt [...]]]></description>
			<content:encoded><![CDATA[<p>This is my translation of Florian Diesch&#8217;s guide found here: <a href="http://www.florian-diesch.de/doc/python-und-glade/online/einleitung.html" onclick="pageTracker._trackPageview('/outgoing/www.florian-diesch.de/doc/python-und-glade/online/einleitung.html?referer=');">http://www.florian-diesch.de/doc/python-und-glade/online/einleitung.html</a></p>
<p>I translated this guide as there doesn&#8217;t seem to be anything about using gtkbuilder and glade, rather than the older libGlade, with python. The guide is not yet complete, but I will keep working on it over the coming weeks.</p>
<p>Dieser Werk bzw. Inhalt ist unter einer <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/de/" onclick="pageTracker._trackPageview('/outgoing/creativecommons.org/licenses/by-nc-sa/3.0/de/?referer=');">Creative Commons-Lizenz</a> lizenziert. This work is released under a creative commons licence (cc-by-nc-sa).</p>
<p><span id="more-209"></span></p>
<h1>Introduction</h1>
<p>This guide should give you a first look at how to use the programming language Python and the interface designer Glade.</p>
<p>I will concentrate on the Python code rather than the use of Glade, which is already well documented in the Glade Interface Designer Handbook.</p>
<p>This text neither should, nor can be used as a replacement for the PyGTK Reference Manual, or the offical PyGTK Tutorial.</p>
<p>I will take it as a given that you have experience with Python and that you are working with Glade 3.6.x on Linux and that your project is saved in the GTKBuilder format for GTK 2.16.</p>
<h1>Signals and Events</h1>
<p>Like many libraries for graphical user interfaces, GTK is event driven. A central event loop waits until something happens then forwards the control onto the routines responsible for the processing of the event.</p>
<p>In order to process events, GTK uses signals: control elements and other objects react to events, which the corresponding signals trigger. Using these signals, you can control callbacks, which will then always be called, so that the corresponding signal will be triggered.</p>
<address>Note:</address>
<address>It is conventional to name callbacks &#8216;on_OBJECTNAME_SIGNALNAME&#8217; E.g. the &#8216;pressed&#8217; signal of the object bt_ok (an ok button) would be &#8216;on_bt_ok_pressed&#8217;.</address>
<p>Signals make the connection between the user interface and the program&#8217;s code such that: every action of the user triggers one or more signals, which you can connect to with callbacks, in order to react to the user&#8217;s request. In addition, signals are often used to enable different parts of the program to communicate with one another. Therefore, a GTK program often contains very many signal callback routines.</p>
<h1>Connecting to Signals</h1>
<p>Using the method gtk.Widget.connect() you can connect a callback with a signal.</p>
<p>Instead of this, you can use gtk.Builder.connect_signals() to automatically connect all callbacks with their corresponding signals.</p>
<p>Additionally, you must specify the name of the callback in the signal properties of the gui element in Glade.</p>
<p>Whilst a callback is being called, the main loop cannot process any signals. Therefore, the interface doesn&#8217;t react to the mouse, or the keyboard and also, changes to the interface elements are usually seen only after completion of the routine.</p>
<p>Therefore, in a callback which is activated by the keyboard/mouse, it is often useful to trigger a handler, for example a progress bar, using the following lines of code:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">while</span> gtk.<span style="color: black;">events_pending</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
      gtk.<span style="color: black;">main_iteration</span> <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<h1>Important Functions</h1>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">gtk.<span style="color: black;">main</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Starts the main loop.</p>
<p>This function is normally called after you have shown the main window of your program.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">gtk.<span style="color: black;">main_quit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This function ends the main loop. It is usually called in the callback for the delete-even signal of your main window.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">gtk.<span style="color: black;">events_pending</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>returns:	True if an event is waiting to be processed, otherwise False</p>
<p>Checks whether there is currently an event waiting to be processed.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">gtk.<span style="color: black;">main_iteration</span><span style="color: black;">&#40;</span>block=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Parameter:	block – True, if the function should wait an event has been processed.</p>
<p>Executes a single iteration of the main loop.</p>
<p>This function is typically called together with</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">gtk.<span style="color: black;">events_pending</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p> in order to execute all queued events.</p>
<h1>Example</h1>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> on_window1_delete_event<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>args<span style="color: black;">&#41;</span>:
     gtk.<span style="color: black;">main_quit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>This is the on_window1_delete_event, the callback for the delete-event signal of window &#8220;window1&#8243;. Should this window be destroyed (closed), then gtk.main_quit() will be called, so as to end the main loop and with that, the program itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2010/02/02/programming-with-pygtk-and-glade/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix Slow EPG on Samsung DVD-SH871M and DVD-SH875M</title>
		<link>http://www.danbishop.org/2009/06/21/fix-slow-epg-on-samsung-dvd-sh871m-and-dvd-sh875m/</link>
		<comments>http://www.danbishop.org/2009/06/21/fix-slow-epg-on-samsung-dvd-sh871m-and-dvd-sh875m/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 09:05:37 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=167</guid>
		<description><![CDATA[EDIT: See comments from David for an even newer firmware! I recently came across a Samsung DVD-SH871M that was unusable due to the EPG and several other menu features being incredibly slow to respond to the remote. I have no idea what Samsung were thinking of when they released this player with completely unusable firmware&#8230; [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_171" class="wp-caption alignleft" style="width: 160px"><img class="size-thumbnail wp-image-171" title="DVD-SH871M" src="http://www.danbishop.org/wp-content/uploads/2009/06/DVD-SH871M-150x150.jpg" alt="The Samsung DVD-SH871M" width="150" height="150" /><p class="wp-caption-text">The Samsung DVD-SH871M</p></div>
<p>EDIT: See comments from David for an even newer firmware!</p>
<p>I recently came across a Samsung DVD-SH871M that was unusable due to the EPG and several other menu features being incredibly slow to respond to the remote. I have no idea what Samsung were thinking of when they released this player with completely unusable firmware&#8230; but there is a fix.</p>
<p>A quick google showed that this was a common problem and the solution was to upgrade the firmware. The new firmware is supposed to be available from Samsung&#8217;s website, but there is only a manual listed for the DVD-SH871M. However, it turns out that the DVD-SH875M, for which there is a firmware update listed, uses exactly the same firmware. To the point that when performing the upgrade, you will see that the old (i.e. the shipped) firmware contains the SH875M&#8217;s name in its version number.</p>
<p>So, the solution is a simple one, download the DVD-SH875M&#8217;s firmware from here: <a href="http://org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=uk&amp;CttFileID=2003747&amp;CDCttType=FM&amp;ModelType=N&amp;ModelName=DVD-SH875M&amp;VPath=FM/200809/20080908164404281_sh875m_20080728.zip" onclick="pageTracker._trackPageview('/outgoing/org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=uk_amp_CttFileID=2003747_amp_CDCttType=FM_amp_ModelType=N_amp_ModelName=DVD-SH875M_amp_VPath=FM/200809/20080908164404281_sh875m_20080728.zip&amp;referer=');">http://org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=uk&amp;CttFileID=2003747&amp;CDCttType=FM&amp;ModelType=N&amp;ModelName=DVD-SH875M&amp;VPath=FM/200809/20080908164404281_sh875m_20080728.zip</a></p>
<p>I will also mirror the file here, unless Samsung request I remove it: <a href="http://www.danbishop.org/downloads-files/sh875m_20080728.ruf.tar.bz2">http://www.danbishop.org/downloads-files/sh875m_20080728.ruf.tar.bz2</a></p>
<p>Then unzip the file, burn it to a cd/dvd/cdrw/dvdrw, then put the disc in the DVD-SH871M. The player will load for a bit, then ask you if you&#8217;d like to upgrade the firmware. Select &#8220;Yes&#8221;, then go and make a cup of tea (the process takes about 6-8minutes).</p>
<p>Once finished the player will eject the disc automatically, remove it et voilà, the process is complete.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2009/06/21/fix-slow-epg-on-samsung-dvd-sh871m-and-dvd-sh875m/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>IOP Journal of Physics D, Lyx and Ubuntu</title>
		<link>http://www.danbishop.org/2009/03/17/iop-journal-of-physics-d-lyx-and-ubuntu/</link>
		<comments>http://www.danbishop.org/2009/03/17/iop-journal-of-physics-d-lyx-and-ubuntu/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 15:07:12 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[lyx]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=116</guid>
		<description><![CDATA[If you&#8217;re getting an error when you try to produce a pdf, or any other output from Lyx using the built in Journal of Physics D style, then try the following: Download the following file to your home directory: http://www.danbishop.org/downloads-files/iop.tar.gz Then run the following commands: sudo tar zxvf iop.tar.gz -C /usr/share/texmf/tex/latex sudo texhash Voilà! Don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re getting an error when you try to produce a pdf, or any other output from Lyx using the built in Journal of Physics D style, then try the following:</p>
<p>Download the following file to your home directory: <a href="http://www.danbishop.org/downloads-files/iop.tar.gz">http://www.danbishop.org/downloads-files/iop.tar.gz</a></p>
<p>Then run the following commands:</p>
<p>sudo tar zxvf iop.tar.gz -C /usr/share/texmf/tex/latex</p>
<p>sudo texhash</p>
<p>Voilà! Don&#8217;t even have to restart Lyx <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2009/03/17/iop-journal-of-physics-d-lyx-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell Mini 9 (and how to fix the keyboard!)</title>
		<link>http://www.danbishop.org/2009/01/27/dell-mini-9-and-how-to-fix-the-keyboard/</link>
		<comments>http://www.danbishop.org/2009/01/27/dell-mini-9-and-how-to-fix-the-keyboard/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 08:52:28 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[mini 9]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=92</guid>
		<description><![CDATA[I bought a Dell Mini 9 from Tesco Direct about two weeks ago now, unfortunately, the battery was dead when it arrived, but after a quick chat to Dell the laptop was collected from my house the next day and redelivered with a new battery and a new motherboard the next week. Since then I [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_97" class="wp-caption alignright" style="width: 160px"><img class="size-thumbnail wp-image-97" title="Dell Mini 9" src="http://www.danbishop.org/wp-content/uploads/2009/01/dell_inspiron_mini9-150x150.jpg" alt="Dell Mini 9" width="150" height="150" /><p class="wp-caption-text">Dell Mini 9</p></div>
<p>I bought a Dell Mini 9 from Tesco Direct about two weeks ago now, unfortunately, the battery was dead when it arrived, but after a quick chat to Dell the laptop was collected from my house the next day and redelivered with a new battery and a new motherboard the next week.</p>
<p>Since then I have been VERY impressed with it. However, the version of Ubuntu that came pre-installed is a specially customised version of Hardy Heron 8.04, I really need at least 8.10 so that I can use LyX across all my machines properly. Installing 8.10 was easy and everything except the sound worked out of the box. To fix the sound a single line had to be added to a config file (easily searchable on google).</p>
<p>The problem came, however, when I tried to use LyX and my &#8220;&#8221; kay didn&#8217;t work. I tried all the other keys on the keyboard and discovered that [ and ] were also non-functional.</p>
<p>My inital assumption was that I needed to specify some special dell keyboard layout in xorg.conf and as two of my friends also have Mini 9s running the default pre-installed version of Ubuntu I thought this would be quite easy to find&#8230; Their xorg.conf files were very standard though, nothing  Dell specific at all.</p>
<p>Finally, after much searching, I found this:<br />
Setting keyboard matrix:<br />
1. Turn off your computer.<br />
2. If your computer is connected to the ac adapter, disconnect the ac adapter from the computer.<br />
3. Press and hold &lt;Fn&gt;&lt;K&gt;.<br />
4. Connect the ac adapter to the computer (assuming that the AC adapter is already plugged into an electrical outlet).<br />
5. Release the key combination.</p>
<p>It worked! This came from someone who had replaced the keyboard and was having the same issue as me, I have not read of anyone who has instaloled 8.10 and had the same issue. I can only assume that my issue came about because either, my keyboard was also replaced when it went in for repair, or, I did upgrade the BIOS to A04 before installing 8.10,  so perhaps that had something to do with it&#8230;</p>
<p>I could definitely recommend the Mini 9, it is perfectly capable of full screen iPlayer playback, the battery life is around 4-6 hours and the keyboard, though small, is actually very pleasent to work with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2009/01/27/dell-mini-9-and-how-to-fix-the-keyboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spotify: music that&#039;s free as in beer&#8230; Free invites!</title>
		<link>http://www.danbishop.org/2009/01/18/spotify-music-thats-free-as-in-beer-free-invites/</link>
		<comments>http://www.danbishop.org/2009/01/18/spotify-music-thats-free-as-in-beer-free-invites/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 10:43:36 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=87</guid>
		<description><![CDATA[Spotify is a free, legal, ad-supported way to stream music. Their catalogue of music is HUGE and whilst there is no native-linux client there are very comprehensive instructions for how to run it under wine on their own site (this is very easy too, no hacking around). At the moment, the service is in beta [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_99" class="wp-caption alignleft" style="width: 118px"><img class="size-full wp-image-99" title="Spotify Logo" src="http://www.danbishop.org/wp-content/uploads/2009/01/spotify-logo.png" alt="Spotify Logo" width="108" height="116" /><p class="wp-caption-text">Spotify Logo</p></div>
<p>Spotify is a free, legal, ad-supported way to stream music. Their catalogue of music is HUGE and whilst there is no native-linux client there are very comprehensive instructions for how to run it under wine on their own site (this is very easy too, no hacking around).</p>
<p>At the moment, the service is in beta and you need to be invited to join it, or pay for one of the premium services. However, for a limited time, if you&#8217;re in the UK you can use this link to sign up: <a href="http://www.tinyurl.com/spotifylink" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.tinyurl.com/spotifylink?referer=');">tinyurl.com/spotifylink</a>. There are native clients for Windows and Mac OSX&#8230; perhaps with a little bit of lobbying a native Linux client will be released too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2009/01/18/spotify-music-thats-free-as-in-beer-free-invites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
