<?xml version="1.0" encoding="UTF-8"?><feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
  >
  <id>http://livingcode.org/feed/atom</id>
  <updated>2009-11-13T19:33:25Z</updated>
  <title type="text">Living Code</title>
  <subtitle type="text">Programming for the Fun of It</subtitle>
  <link rel="self" type="application/atom+xml" href="http://livingcode.org/feed" />
  <link rel="alternate" href="http://livingcode.org" />
  <rights type="text">Copyright 2009</rights>
  <generator uri="http://wordpress.org/" version="2.8.6">WordPress</generator>
      <entry>
    <id>http://livingcode.org/2007/ajax-with-and-without-xml</id>
    <title type="html"><![CDATA[Ajax with and without XML]]></title>
    <updated>2008-01-25T20:52:31Z</updated>
    <published>2007-01-19T06:56:59Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2007/01/18/ajax-with-and-without-xml/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2007/01/18/ajax-with-and-without-xml" />
    <category scheme="http://livingcode.org" term="Web" />
    <summary type="html"><![CDATA[I forgot to post last week that my latest article for David Mertz&#8217;s column, XML Matters, went live on the IBM developerWorks site. It&#8217;s fallen off the front page now, but it was gratifying to make it there. The article is Ajax Tradeoffs: The many flavors of XML, and it is an exploration of various [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2007/01/18/ajax-with-and-without-xml"><![CDATA[<p>I forgot to post last week that my latest article for David Mertz&#8217;s column, <a href="http://www.ibm.com/developerworks/views/xml/libraryview.jsp?search_by=xml+matters:">XML Matters,</a> went live on the IBM developerWorks site. It&#8217;s fallen off the front page now, but it was gratifying to make it there. The article is <a href="http://www-128.ibm.com/developerworks/xml/library/x-matters48/">Ajax Tradeoffs: The many flavors of XML</a>, and it is an exploration of various XML (Open Office, XHTML, custom) and non-XML (JSON, CSV) formats for data exchange in Ajax-enabled websites. I used my wife Daniela&#8217;s efforts at tracking her poetry submissions as my example data.</p>
<p>This article was also my pre-announcement of the Fame Not Fortune webapp that I&#8217;m working on (off-and-on). I&#8217;m using it as a way of learning Django, since I&#8217;m already somewhat familiar with TurboGears and I&#8217;m using Rails at work. More about Fame Not Fortune later. I&#8217;ll have a status report on the various livingcode projects soon too: updates for Drawing Board and Pastels, among other things.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2006/xml-article-without-the-xml</id>
    <title type="html"><![CDATA[XML Article without the XML]]></title>
    <updated>2008-01-21T05:02:55Z</updated>
    <published>2006-08-05T04:52:30Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2006/08/04/xml-article-without-the-xml/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2006/08/04/xml-article-without-the-xml" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[My latest article for David Mertz&#8217;s column XML Matters is up at IBM developerWorks: Lighter than microformats: Picoformats Ajax without X, Microformats without angle brackets went live a couple of days ago. It isn&#8217;t so much about XML as how to avoid XML. My feelings towards XML are that it is useful and good, but [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2006/08/04/xml-article-without-the-xml"><![CDATA[<p>My latest article for <a href="http://gnosis.cx/dW/">David Mertz&#8217;s </a>column <a href="http://www.ibm.com/developerworks/views/xml/libraryview.jsp?search_by=xml+matters">XML Matters</a> is up at <a href="http://www.ibm.com/developerworks">IBM developerWorks</a>: <a href="http://www-128.ibm.com/developerworks/library/x-matters46/">Lighter than microformats: Picoformats</a> <em>Ajax without X, Microformats without angle brackets</em> went live a couple of days ago. It isn&#8217;t so much about XML as how to avoid XML. My feelings towards XML are that it is useful and good, but overused and not a panacea. By providing some alternatives, maybe some of the backlash against the &#8220;XML everywhere for everything&#8221; meme can be averted.</p>
<p>I&#8217;ve been meaning to post about the article, but I keep getting caught up preparing my presentation for the <a href="http://www.vanpyz.org/conference">Vancouver Python Workshop</a> on Saturday (the workshop starts Friday August 3rd and goes through Sunday August 5th). My talk this year is on using [PyObjC] to create applications and plugins for OS X using Python. I&#8217;ll get the slides up after, as soon as I can. I&#8217;m also planning on doing a shorter version of this talk at <a href="http://upcoming.org/event/87852">Bar Camp Vancouver</a> which is 6 pm Friday, August 25 to 6 pm Saturday, August 26.</p>
<p>And I should have mentioned the Google talk at the<a href="http://www.bcgsc.ca/vanhpc/"> Vancouver High Performance Computing User Group</a> before it happened on July 27th. Narayanan &#8216;Shiva&#8217; Shivakumar came up from their Seattle office to present mostly old information from their published papers such as The <a href="http://labs.google.com/papers/gfs.html">Google File System</a>, <a href="http://labs.google.com/papers/mapreduce.html">MapReduce</a>, and <a href="http://video.google.com/videoplay?docid=7278544055668715642">BigTable</a> (video). The talk over beers after was fun, and it was good to see my friend <a href="http://www.vmunix.com/mark/">Mark</a> and find out he has a <a href="http://www.vmunix.com/mark/blog/">blog</a>, even if it&#8217;s over my head much of the time.</p>
<p>Well, that&#8217;s my update dump. More stuff on actually using PyObjC coming Real Soon Now.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2006/atom-and-microformats-intro</id>
    <title type="html"><![CDATA[Atom and Microformats Intro]]></title>
    <updated>2008-01-21T05:36:50Z</updated>
    <published>2006-06-01T05:05:18Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2006/05/31/atom-and-microformats-intro/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2006/05/31/atom-and-microformats-intro" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[My most recent article at IBM developerWorks is up (part of David Mertz&#8217;s &#8220;XML Matters&#8221; column), discussing the intersection of Atom Syndication Format, Atom Publishing Protocol, and Microformats:
Up And Atom
Actually, it&#8217;s been up for at least a week, but I was out of town at JavaOne (and too tired to post), then off the grid [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2006/05/31/atom-and-microformats-intro"><![CDATA[<p>My most recent article at IBM <a href="http://www-128.ibm.com/developerworks/xml">developerWorks</a> is up (part of David Mertz&#8217;s &#8220;XML Matters&#8221; column), discussing the intersection of <a href="http://www.ietf.org/rfc/rfc4287.txt">Atom Syndication Format</a>, <a href="http://www.ietf.org/internet-drafts/draft-ietf-atompub-protocol-08.txt">Atom Publishing Protocol</a>, and <a href="http://microformats.org/">Microformats</a>:</p>
<p><a href="http://www-128.ibm.com/developerworks/xml/library/x-matters45.html">Up And Atom</a></p>
<p>Actually, it&#8217;s been up for at least a week, but I was out of town at JavaOne (and too tired to post), then off the grid completely taking my daughter&#8217;s school to camp. I&#8217;m still getting caught up, but nearly recovered.</p>
<p>I think I&#8217;ve figured out why my new blog is not being picked up by <a href="http://planet.python.org/">Planet Python</a> too: the planet software has only recently begun to support Atom 1.0, and that version hasn&#8217;t been officially released yet. There should be a 1.0 release of the <a href="http://planetplanet.org/">planet</a> code soon, and hopefully Planet Python will upgrade then and all will be well with the world.</p>
<p>I guess that&#8217;s one downside to developing my own blogging tools to support open standards: I may not have to implement deprecated formats or protocols, but if others are still stuck with legacy systems it can still hurt.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2006/pipestreaming-microformats</id>
    <title type="html"><![CDATA[Pipestreaming Microformats]]></title>
    <updated>2008-01-21T05:52:05Z</updated>
    <published>2006-05-10T05:46:25Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2006/05/09/pipestreaming-microformats/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2006/05/09/pipestreaming-microformats" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[
My latest article for David Mertz&#8217;s column XML Matters on IBM&#8217;s developerWorks site has been up for over a week now, but I&#8217;m finally coming up for air long enough to post about it. The title is Pipestreaming Microformats and it is a survey of attempts to apply the Unix pipe metaphor to XML content, [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2006/05/09/pipestreaming-microformats"><![CDATA[<p><img src="http://livingcode.org/image/pipedreaming.jpg" /></p>
<p>My latest article for David Mertz&#8217;s column XML Matters on IBM&#8217;s developerWorks site has been up for over a week now, but I&#8217;m finally coming up for air long enough to post about it. The title is <a href="http://www-128.ibm.com/developerworks/xml/library/x-matters44.html">Pipestreaming Microformats</a> and it is a survey of attempts to apply the Unix pipe metaphor to XML content, then some blue-sky dreaming of how to apply that to <a href="http://microformats.org/">microformats</a>.</p>
<p>One thing I mention in the article is that Norm Walsh&#8217;s <a href="https://sxpipe.dev.java.net/">SXPipe</a> would be cool to re-implement in Python using <a href="http://codespeak.net/lxml/">lxml</a>. While I was writing the article and in the time since, lxml has been undergoing a flurry of activity the results of which (among other cool things) are that it now has Python eggs for easy install on Windows, OS X, and Linux. So I think it&#8217;s ready, I just need to find time to spend with that project. If there is interest in such a thing, let me know so I can bump the priority up.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2005/3d-its-not-just-for-breakfast-anymore</id>
    <title type="html"><![CDATA[3D, it&#8217;s not just for breakfast anymore]]></title>
    <updated>2008-01-23T06:48:35Z</updated>
    <published>2005-12-17T06:41:19Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2005/12/16/3d-its-not-just-for-breakfast-anymore/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2005/12/16/3d-its-not-just-for-breakfast-anymore" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[I&#8217;ve been fooling around with 3D lately. First off, my third article as guest-writer for David Mertz&#8217;s XML Matters column, The Web ain&#8217;t just for 2D anymore went live on IBM&#8217;s developerWorks site today. It&#8217;s about X3D (3D in XML), successor to VRML, and the possibility of it being relevant today. I have moderate hope [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2005/12/16/3d-its-not-just-for-breakfast-anymore"><![CDATA[<p>I&#8217;ve been fooling around with 3D lately. First off, my third article as guest-writer for <a href="http://www.gnosis.cx/publish/">David Mertz&#8217;s</a> XML Matters column, <a href="http://www-128.ibm.com/developerworks/web/library/x-matters43/index.html">The Web ain&#8217;t just for 2D anymore</a> went live on IBM&#8217;s developerWorks site today. It&#8217;s about X3D (3D in XML), successor to VRML, and the possibility of it being relevant today. I have moderate hope for it, now that SVG is starting to be a player. The funny thing is, I think X3D is probably less complicated to implement than SVG is. The real coolness starts when you can combine them, but that is still a ways off.</p>
<p>Years ago, I was the lead programmer for <a href="http://antarcti.ca/">Antarcti.ca&#8217;s</a> 3D web client (which was discontinued awhile back), and before that I implemented a simple 3D renderer in Java AWT (this was before Swing, and way before Java3D. So I&#8217;ve been tinkering around with 3D for awhile. Lately I&#8217;ve volunteered to take a stab at porting <a href="http://vpython.org/">VPython</a> over to OS X Aqua (it can be built for OS X, but only under X Windows, which doesn&#8217;t appeal to me). So far, the build process for it has been stumping me, and soaking up what little time I have to devote to my hobby coding, but I still plug away at it from time to time. It&#8217;s a C++ extension for Python which relies on boost, glib, and OpenGL libraries, and it uses autoconf in a fairly non-auto way. I&#8217;ve never been expert at build systems, most python projects I&#8217;ve needed were either .<span class="code">configure;make;make install</span> or <span class="code">python setup.py install</span>, so the struggle to port this really bugs me, but VPython is a very cool project and I want to use it (and I don&#8217;t want to give in and rely on fink and X). Sometimes I&#8217;m too stubborn for my own good.</p>
<p>In a previous post I mentioned that I was thinking of writing a tool for screencasting from OS X. It turns out that while Apple has included more advanced Cocoa libraries for Quicktime in Tiger, there isn&#8217;t a convenient way to create new, writable movies from Cocoa, so that project has stalled, for the time being. There is a solution, but I&#8217;m trying to wrap up other things before I delve into it.</p>
<p>I have two projects nearly ready to release which are both larger examples of using PyObjC. One is my own project, DrawingBoard, which is being tested right now by both my kids and my friend <a href="http://fergusson.net/">Michael&#8217;s</a> kids. I&#8217;m about ready to let other people see it, rough as it still is. The other project is a port of Apple&#8217;s Sketch example code from Objective-C into Python, which gives examples of how to use Core Data, undo/redo, and many other things. Both will be coming soon.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2006/interface-builder-vs-macromedia-flex-builder-2</id>
    <title type="html"><![CDATA[Interface Builder vs. Macromedia Flex Builder 2]]></title>
    <updated>2008-01-26T23:18:44Z</updated>
    <published>2005-11-04T06:48:38Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2005/11/03/interface-builder-vs-macromedia-flex-builder-2/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2005/11/03/interface-builder-vs-macromedia-flex-builder-2" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[I recently tried out the beta of Macromedia Flex Builder 2, and was quite impressed. I normally avoid Flash on principle, but it has some pretty powerful tools built in. It feels more limited than Apple&#8217;s Interface Builder, but it has one feature that I&#8217;ve been dying to see in IB: You can flip between [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2005/11/03/interface-builder-vs-macromedia-flex-builder-2"><![CDATA[<p>I recently tried out the beta of Macromedia Flex Builder 2, and was quite impressed. I normally avoid Flash on principle, but it has some pretty powerful tools built in. It feels more limited than Apple&#8217;s Interface Builder, but it has one feature that I&#8217;ve been dying to see in IB: You can flip between visual drag-and-drop widget mode, and editing the layout as XML. Interface Builder so needs this ability. It would help for folks writing about developing for OS X (sometimes 100 words is better than half a dozen pictures, and trying to show CTRL-dragging in a still picture is an exercise in futility), and it would help when you come to a new project (or one you haven&#8217;t worked on in awhile) and want to get a feel for what methods and event handlers are hooked in to various widgets. Heck, it would help with automated tools, with testing, with grep. Just do it, Apple, or hire me to do it.</p>
<p>The other part that was interesting for me was that Flex Builder runs inside of Eclipse. It&#8217;s been a long time since I&#8217;ve tried Eclipse and I was pleasantly suprised. It was fairly snappy, not too confusing to find my way around in, and looked better than I remembered. Of course, I was running it on a dual 3GHz Windows box, so I might be disappointed once more if I ran it on my Powerbook, but my brief encounter with it didn&#8217;t suck, which was a big improvement.</p>
<p>Of course, neither of these developments are going to lure me away from Python and Vim any time soon.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2005/tidbits</id>
    <title type="html"><![CDATA[Tidbits]]></title>
    <updated>2008-01-25T05:51:00Z</updated>
    <published>2005-05-26T05:46:02Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2005/05/25/tidbits/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2005/05/25/tidbits" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[My posts have been infrequent, in part because I&#8217;ve been working on lots of things to talk about. I&#8217;m in the last stages of putting together info on creating NSStatusItems (tools which show up in the menu bar across all applications in OS X) in PyObjC. I&#8217;ve also got some cool Quicktime and iSight tools [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2005/05/25/tidbits"><![CDATA[<p>My posts have been infrequent, in part because I&#8217;ve been working on lots of things to talk about. I&#8217;m in the last stages of putting together info on creating NSStatusItems (tools which show up in the menu bar across all applications in OS X) in PyObjC. I&#8217;ve also got some cool Quicktime and iSight tools coming soon. And I&#8217;ve renamed ZenPaint to DrawingBoard, but it&#8217;s working and just waiting for a little GUI cleanup before I post the first binary and source.</p>
<p>Two of my back-burner projects, better blue-screening, and easy lightsabre effects, have been done by others recently. Inspired by the same BoingBoing piece on rotoscoping your own lightsabres as I was, but <a href="http://www.lamarchefamily.net/nakedsoft/">Naked Software</a> actually sat down and wrote the code. It&#8217;s pretty slick, too. For blue-screen effects (and many more), check out Sam Kass&#8217; <a href="http://www.samkass.com/blog/">Quartz Composer Compositions</a>. Very neat stuff, Tiger-only though [Update: now Leopard]. Some of the compositions require a newer system with a higher-end video card than my three-year-old PowerBook.</p>
<p>But to be honest, the real point of this post is not to tease with coming attractions, but to point out my first paid publication. My friend <a href="http://gnosis.cx/publish/">David Mertz</a> asked me to collaborate with him on his <a href="http://www-128.ibm.com/developerworks/views/xml/libraryview.jsp?search_by=xml+matters:">XML Matters</a> column for IBM developerWorks, and my first column went live last Friday: <a href="http://www-128.ibm.com/developerworks/xml/library/x-matters41.html">Beyond the DOM</a>.</p>
<p>I&#8217;ve wanted to be a writer for as long as I can remember, with poetry notebooks and 200 pages of a novel gathering dust on my bookshelves, so finally getting around to finishing something and having it published leaves me pleased as punch. And more <strong>will</strong> be forthcoming.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2005/not-dead-yet</id>
    <title type="html"><![CDATA[Not dead yet]]></title>
    <updated>2008-01-26T04:30:22Z</updated>
    <published>2005-01-21T04:19:45Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2005/01/20/not-dead-yet/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2005/01/20/not-dead-yet" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[I&#8217;m still here. I&#8217;m going to post the previous examples .dmg with some corrections pointed out by Bob Ippolito (4-space indents, don&#8217;t modify data directly in the Bundle). I&#8217;ve been quiet because a) I&#8217;ve been hitting some walls with Renaissance and investigating work-arounds and alternatives, and b) my coding/blogging time is pretty much between the [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2005/01/20/not-dead-yet"><![CDATA[<p>I&#8217;m still here. I&#8217;m going to post the previous examples .dmg with some corrections pointed out by Bob Ippolito (4-space indents, don&#8217;t modify data directly in the Bundle). I&#8217;ve been quiet because a) I&#8217;ve been hitting some walls with Renaissance and investigating work-arounds and alternatives, and b) my coding/blogging time is pretty much between the time I get the kids to bed and the time my wife comes home from tutoring.</p>
<p>I&#8217;m investigating the PyGUI and Wax APIs, to see if they are worth porting to run on top of Cocoa (PyGUI runs on Carbon, Wax runs on top of wxPython). Both are attempts to make GUI creation more &#8220;Pythonic,&#8221; which is a <span style="font-weight: bold">Good Thing™</span>. I have figured out how to get the menus initialized using pure Python (on top of PyObjC, of course), or maybe the newer pyobjc/py2app has fixed the problem, but it is possible to build applications in Python with no Nib file (or Renaissance .gsmarkup file) at all. My earlier inabillity to do that is what drove me to Renaissance in the first place.</p>
<p>I&#8217;ve also discovered the nibtool utility, which I did not know about. This allows you to see a textual representation of the nibs created by Interface Builder, search and replace strings (class names, etc.). This is a major discovery. Now if you could take the textual representation and put it back&#8230; I&#8217;m going to have to investigate this further.</p>
<p>In other news, I will be giving a presentation on Tuesday, February 1 at the Vancouver Zope and Python Users Group (<a href="http://www.vanpyz.org/news">VanPyZ</a>) at 7:00 p.m. It will be a variation on the talk I gave in December to the XML users group, updated with what I&#8217;ve been exploring since then. Specifically I will show a simple (Hello World) application built three different ways, with Renaissance, with Interface Builder, and in pure Python. I&#8217;ll also show some apps written in other toolkits (wxPython, tkinter) for comparison. I hope some of my readers are close enough to make it.</p>
<p>I&#8217;ll also be attending the <a href="http://www.northernvoice.ca/">Northern Voice</a> blogging conference here in Vancouver on Saturday, February 19th. I&#8217;m looking forward to meeting some fellow bloggers face to face, rather than RSS to RSS.</p>
<p>Finally, I managed to install Python 2.4 today, and so far nothing has been obviously screwed up, so I&#8217;ll be exploring some of the crunchy new features here in the near future.</p>
<p>More posts coming soon. Honest!</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2004/slides-and-code-posted</id>
    <title type="html"><![CDATA[Slides and code posted]]></title>
    <updated>2008-01-26T05:02:41Z</updated>
    <published>2004-12-19T04:30:23Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2004/12/18/slides-and-code-posted/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2004/12/18/slides-and-code-posted" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[My talk at VanX last night was a success. Not many people showed (too close to Xmas), but the ones who did seemed to enjoy my presentation on Cocoa, Python, and Renaissance. Gerald was a great host, SchemaSoft provided a good (and convenient!) venue, Paul came to show support, and BlastRadius (my employer) sponsored the [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2004/12/18/slides-and-code-posted"><![CDATA[<p>My talk at <a href="http://vanx.org/">VanX</a> last night was a success. Not many people showed (too close to Xmas), but the ones who did seemed to enjoy my presentation on Cocoa, Python, and Renaissance. Gerald was a great host, <a href="http://schemasoft.com/">SchemaSoft</a> provided a good (and convenient!) venue, <a href="http://prescod.net/">Paul</a> came to show support, and <a href="http://blastradius.com/">BlastRadius</a> (my employer) sponsored the snacks. After we went to Mira in Yaletown for beers and tech talk, had the whole place to ourselves, and a musician playing Flamenco guitar, then I walked across the bridge to home. A great end to a great evening.</p>
<p>I&#8217;ve posted my slides at <a href="http://livingcode.org/slides/renaissance.html">livingcode.org/slides/renaissance.html</a> using Eric Meyer&#8217;s neat S5 tool to put the whole slideshow into one HTML file.</p>
<p>I&#8217;ve also built a new .dmg containing all the source code and built, runnable examples (seven of them now), although they&#8217;re not all fully functional yet. More example gsmarkup to view, improved setup scripts, and they all have icons now. The file is <a href="http://sourceforge.net/project/showfiles.php?group_id=19654">examples 2004-12-17</a> on SourceForge.</p>
<p>I&#8217;ve been working hard to put this all together, which hasn&#8217;t left much time for posting, but I will have a lot more to say real soon now.</p>
]]></content>
        </entry>
    <entry>
    <id>http://livingcode.org/2004/gmarkup-browser</id>
    <title type="html"><![CDATA[GMarkup Browser]]></title>
    <updated>2008-01-26T05:31:19Z</updated>
    <published>2004-11-10T05:27:02Z</published>
    <author>
      <name>Dethe</name>
      <email>delza@livingcode.org</email>
<uri>http://livingcode.org/</uri>    </author>
    <link rel="replies" type="application/atom+xml" href="http://livingcode.org/2004/11/09/gmarkup-browser/feed" thr:count="0"  />
    <link rel="alternate" href="http://livingcode.org/2004/11/09/gmarkup-browser" />
    <category scheme="http://livingcode.org" term="Python" />
    <summary type="html"><![CDATA[Today&#8217;s exercise was to port the GMarkup Browser, an Objective-C program which comes with Renaissance, to Python. Using this allows you to see what various gmarkup files will look like when they are loaded, which is very handy as you&#8217;re developing a program&#8217;s UI, without having to build a program around them. The source code [...]]]></summary>
      <content type="html" xml:base="http://livingcode.org/2004/11/09/gmarkup-browser"><![CDATA[<p>Today&#8217;s exercise was to port the GMarkup Browser, an Objective-C program which comes with Renaissance, to Python. Using this allows you to see what various gmarkup files will look like when they are loaded, which is very handy as you&#8217;re developing a program&#8217;s UI, without having to build a program around them. The source code of Renaissance (available separately from the binary we installed a few entries ago) contains an Examples folder showing all of the tags in use, both as small toy examples and tests, and as full-fledged applications. It&#8217;s well worth downloading this and poking around in it with the Browser.</p>
<p>There are three files today, the <span class="code">setup.py</span>, a simple <span class="code">MainMenu.gsmarkup</span>, and the <span class="code">browser.py</span> application. Note that loading resources, especially menu resources, into a running program can cause bad side effects. So far I&#8217;ve been able to exit by ctrl-clicking the application icon and selecting quit, even when the menus disappeared, but use caution. Also, buttons wired up to the &#8220;<span class="code">terminate:</span>&#8221; selector will exit your program if you click on them. With great power comes great responsibility, or something like that. Caveats aside, you can open multiple gsmarkup files at a time, just use the File-&gt;Open menu or Cmd-O.</p>
<p><strong>MainMenu.gsmarkup</strong></p>
<pre class="code">&lt;?xml version="1.0"?&gt;</pre>
<pre class="code">&lt;!DOCTYPE gsmarkup&gt;</pre>
<pre class="code">&lt;gsmarkup&gt;</pre>
<pre class="code">    &lt;objects&gt;</pre>
<pre class="code">        &lt;menu type="main"&gt;</pre>
<pre class="code">            &lt;menu title="GSMarkup Browser" type="apple"&gt;</pre>
<pre class="code">                &lt;menuItem title="About GSMarkup Browser"</pre>
<pre class="code">                    action="orderFrontStandardAboutPanel:"/&gt;</pre>
<pre class="code">                &lt;menuSeparator/&gt;</pre>
<pre class="code">                &lt;menu title="Services" type="services"/&gt;</pre>
<pre class="code">                &lt;menuSeparator/&gt;</pre>
<pre class="code">                &lt;menuItem title="Hide GSMarkup Browser" action="hide:" key="h"/&gt;</pre>
<pre class="code">                &lt;menuItem title="Hide Others" action="hideOtherApplications:"/&gt;</pre>
<pre class="code">                &lt;menuItem title="Show All" action="unhideAllApplications:"/&gt;</pre>
<pre class="code">                &lt;menuSeparator/&gt;</pre>
<pre class="code">                &lt;menuItem title="Quit GSMarkup Browser" action="terminate:" key="q"/&gt;</pre>
<pre class="code">            &lt;/menu&gt;</pre>
<pre class="code">            &lt;menu title="File"&gt;</pre>
<pre class="code">                &lt;menuItem title="Open" action="open:" key="o"/&gt;</pre>
<pre class="code">            &lt;/menu&gt;</pre>
<pre class="code">            &lt;menu title="Window" type="windows"&gt;</pre>
<pre class="code">                &lt;menuItem title="Minimize Window" action="performMiniaturize:" key="m"/&gt;</pre>
<pre class="code">                &lt;menuSeparator/&gt;</pre>
<pre class="code">                &lt;menuItem title="Bring All to Front" action="arrangeInFront:"/&gt;</pre>
<pre class="code">            &lt;/menu&gt;</pre>
<pre class="code">        &lt;/menu&gt;</pre>
<pre class="code">    &lt;/objects&gt;</pre>
<pre class="code">&lt;/gsmarkup&gt;</pre>
<p><strong>browser.py </strong></p>
<pre class="code">'''</pre>
<pre class="code">Port of GSMarkupBrowser from Objective-C to Python</pre>
<pre class="code">'''</pre>
<pre class="code">from Foundation import *</pre>
<pre class="code">from AppKit import *</pre>
<pre class="code">from Renaissance import *</pre>
<pre class="code">class Owner(NSObject):</pre>
<pre class="code">def takeValue_forKey_(self, obj, key):</pre>
<pre class="code">    #print 'Set value %s for key %s of NSOwner' % (obj, key)</pre>
<pre class="code">    pass</pre>
<pre class="code">def bundleDidLoadGSMarkup_(self, notification):</pre>
<pre class="code">    if NSUserDefaults.standardUserDefaults().boolForKey_('DisplayAutoLayout'):</pre>
<pre class="code">        topLevelObjects = notification.userInfo().objectForKey_('NSTopLevelObjects')</pre>
<pre class="code">        for obj in topLevelObjects:</pre>
<pre class="code">            if obj.isKindOfClass_(NSWindow) or obj.isKindOfClass_(NSView):</pre>
<pre class="code">                obj.setDisplayAutoLayoutContainers_(True)</pre>
<pre class="code">def applicationDidFinishLaunching_(self, notification):</pre>
<pre class="code">    self.open_(self)</pre>
<pre class="code">def open_(self, notification):</pre>
<pre class="code">    filetypes = ['gsmarkup']</pre>
<pre class="code">    panel = NSOpenPanel.openPanel()</pre>
<pre class="code">    result = panel.runModalForDirectory_file_types_(None, None, filetypes)</pre>
<pre class="code">    if result == NSOKButton:</pre>
<pre class="code">        self.pathname = panel.filenames()[0]</pre>
<pre class="code">        #print 'Loading', self.pathname</pre>
<pre class="code">        didLoad = NSBundle.loadGSMarkupFile_externalNameTable_withZone_localizableStringsTable_inBundle_(</pre>
<pre class="code">            self.pathname,</pre>
<pre class="code">            {'NSOwner': self}, None, None, None)</pre>
<pre class="code">        if didLoad:</pre>
<pre class="code">            print self.pathname, 'loaded!'</pre>
<pre class="code">        else:</pre>
<pre class="code">            #print 'Could not load', self.pathname</pre>
<pre class="code">            NSBeep()</pre>
<pre class="code">def main():</pre>
<pre class="code">    defaults = NSUserDefaults.standardUserDefaults()</pre>
<pre class="code">    defaults.registerDefaults_({'DisplayAutoLayout': 'NO'})</pre>
<pre class="code">    app = NSApplication.sharedApplication()</pre>
<pre class="code">    owner = Owner.alloc().init()</pre>
<pre class="code">    app.setDelegate_(owner)</pre>
<pre class="code">    NSBundle.loadGSMarkupNamed_owner_('MainMenu', owner)</pre>
<pre class="code">    NSApp().run()</pre>
<pre class="code">if __name__ == '__main__': main()</pre>
<p><strong>setup.py </strong></p>
<pre><span class="code">'''
Minimal setup.py example, run with:
% python setup.py py2app
'''
from distutils.core import setup
import py2app
setup(
    data_files = ['MainMenu.gsmarkup'],
    app = ['browser.py'],
)</span></pre>
]]></content>
        </entry>
  </feed>
