2008-03-03
Posted in Geek Stuff
at 12:52
In case you were unaware, GTK+ doesn’t let you set_active(False) on every single button in a RadioToolButton group. One must be pressed at all times.
So, if you want to have a user interface where it’s possible to have none of them pressed (for example, using RadioToolButtons for “Zoom 100%” and “Zoom to Fit” and regular buttons for “Zoom In” and “Zoom Out”), you need to use a little trickery.
self.zoom_100 = self.wTree.get_widget("zoom_100")
self.zoom_fit = self.wTree.get_widget("zoom_fit")
self.zoom_manual = gtk.RadioToolButton(self.zoom_100)
zoom_100 and zoom_fit are the RadioToolButtons as defined in my Glade XML file. The trick is zoom_manual. It is now part of the button group, but I’m not adding it to the user interface.
This is a preview of
Quick Tip - GTK RadioToolButton With All Buttons Unset
.
Read the full post (173 words, estimated 42 secs reading time)
Permalink
Posted in Geek Stuff
at 5:37
PyGTK - EntryCompletion hacked up to give nicer tab-completion
While working on a batch organizing tool, I found out the hard way that GTK’s EntryCompletion is not meant for people who want speed. (It’s a memory aid, not a speed aid) I also couldn’t just switch to PyQt or wxPython because they all do basically the same thing.
As such, I hacked the GTK auto-complete up a bit so that it behaves more like shell auto-complete. (It doesn’t do anything until you hit Tab. When you do, if there’s one match, it’s completed. If there are multiple matches, it pops open the normal auto-complete list so you can pick one.
Permalink
2008-02-27
Posted in Geek Stuff
at 0:33
You might not be aware of this, but since some time during the glibc 2.3 era, Linux apparently doesn’t enforce the RSS memory limit. (ulimit -m) My tests seem to confirm this.
As such, the only way I could find to limit a program’s memory allocations was by the VIRT size (ulimit -v)… which can differ a lot from the RSS. (Upon which the “percentage of memory used” value in system monitors is based on, if you weren’t sure)
Permalink
2008-02-23
Posted in Geek Stuff, Music, Web Wandering & Opinion
at 1:09
Ever seen the Fett’s Vette vid? What about this part of AMV Hell 4?
Well, in case you haven’t, both “The Tussin” and “Fett’s Vette” are by MC Chris and he’s currently running a fan music video contest for his new song, “Nrrrd Grrrl”. (YouTube Results)
You may not know how to make a music video and, while I have the general idea, I don’t have time. Either way, I suggest you drop by his MySpace page and hit the download link in the music player. The song’s pretty catchy and I doubt it’ll be in the player forever.
Permanent link to this post (108 words, estimated 26 secs reading time)
Permalink
2008-02-21
Posted in Web Wandering & Opinion
at 6:53
Ever heard of the Streisand Effect? It refers to how, as John Gilmore said, “The Net interprets censorship as damage and routes around it.”
Want some examples?
Just a little something I ran across which I thought to be noteworthy.
Permanent link to this post (51 words, estimated 12 secs reading time)
Permalink