Dec 07 2012

enable/disable hibernate/suspend pygtk status icon

Tag: pygtkerm @ 12:33 am

Every once in a while my machine runs stuff in the background, like backups, db dumps and whatnot. This obviously causes performance issues at times, but among other things I don’t want to shutdown during these processes.

So I created a simple status icon to warn me if one of those processes were executing so I wouldn’t shutdown the machine, and it also will disable hibernate/suspend.

I figure I’d share it with the world.

Continue reading “enable/disable hibernate/suspend pygtk status icon”

Sep 07 2012

python, pygtk crumblist

Tag: pygtk,pythonerm @ 10:13 am

I needed a hbox that would automatically take children widgets from one row and put it into another row depending on the width of the widget. This is similar to how html elements are handled on a web page.

The desired result was to basically make a crumb/tag list with a close button that you could easily remove elements from.

Continue reading “python, pygtk crumblist”

May 25 2012

Pygtk star rating cellrenderer for a treeview

Tag: pygtk,pythonerm @ 6:12 am

This code is a complete hack. I’ve probably done it wrong in someones eyes out there, and if by chance you are better at this sort of thing, and see room for improvements please pass it along.  I can only stand so much insanity building this thing.  It works for what I need.
Continue reading “Pygtk star rating cellrenderer for a treeview”

Oct 27 2008

reload program after logoff in python/pygtk

Tag: gtk,pygtk,pythonerm @ 6:28 pm

This snippit of code will restart/reload your python/pygtk app when you log out so you don’t have to keep restarting it.

import gnome.ui
gnome.program_init('program name', "1.0")
client = gnome.ui.master_client()
command = os.path.normpath(os.path.join(os.getcwd(), sys.argv[0]))
try: client.set_restart_command([command] + sys.argv[1:])
except TypeError:
	client.set_restart_command(len(sys.argv), [command] + sys.argv[1:])
client.connect('die', gtk.main_quit)

Oct 22 2008

TreeView and the frustration

Tag: gtk,pygtk,pythonerm @ 3:47 pm

Anyone that’s ever used treeview, might understand my frustration.

I really don’t understand the reasoning behind forcing people to use cellrenders.

Continue reading “TreeView and the frustration”