Thursday, August 25, 2011

20 Years of linux - a humoristic view

From an Israeli Linux forum:

<KingYes> Today, 20 years ago, Linus announced he is working on a new operating system
<KingYes> This is Great, how time passes by.
<Haimn> WOW I didn't know his post still exists.
<Guest> In windows it would not happen...
<KingYes> What would not happen?
<Guest> Your lack of sense of humor.

Credit: Original Link in Hebrew

I found it amusing, so I think it was worth a translation. I tried submitting to, but it does not work ...

Wednesday, August 03, 2011

A Usefull PyGTK Example

I have been looking for a good pygtk tutorial for a very long time. I have found a few tutorials which where an overkill, so I don't link to them. By over kill I mean that they where full with details which prevented me from actually having an application working.
I found this nice pygtk tutorial, which is actually more a capabilities demonstration. After reading for a few hours, I got intrigued. But I was very frustrated since the tutorial does not produce any real life example. For example, I would have expand the calculator example to working one. I did a Google search and bumped into this pygtk calculator working example. After a couple of more hours, I have managed to produce the following "Hello World!" pygtk application which demonstrates some basic pygtk principles:


# A Usefull and Active PyGTK Example
# This example demonstrates a few Widgets which actually do 
# some stuff, and interact with each other.
# oz nahum
# August 2011

import gtk

class PyApp(gtk.Window):

    def __init__(self):
        super(PyApp, self).__init__()
        self.set_size_request(250, 200)

        self.fixed = gtk.Fixed()

        self.label = gtk.Label("Please Enter Your Name below")
        self.fixed.put(self.label, 60, 40)
        self.entry = gtk.Entry()
        self.fixed.put(self.entry, 60, 100)

        self.fixed.put(self.outlabel, 60,180)
        self.button = gtk.Button("Greeting:")
        self.fixed.put(self.button, 60,140)
        self.clearbutton = gtk.Button("Clear")
        self.fixed.put(self.clearbutton, 140,140)
        self.button = gtk.Button("Close")
        self.fixed.put(self.button, 200,140)

        self.connect("destroy", gtk.main_quit)
    def greeting(self, event):
        self.outlabel.set_text("Hello "+self.UserName)
        self.entry.set_text('Hello '+self.UserName)
    def cleartxt(self, event):