pygtk

Simple, non-networking example of Twisted/PyGTK

I was struggling with getting some asynchronous activity to work under PyGTK, when someone suggested that I look at using Twisted. I know that Twisted started as a networking framework, but that it can be used for other things. However, every single example I've ever seen involves a whole lot of network-based code. I would like to see a...

How to create a pop window using pygtk?

HI I have created a simple software. Now Iam trying to give a GUI to it . Since I have coded in python Iam using pygtk . I have made main window and now I want to add a pop up window ,which will become active as I press open button(already created) in main window . I have no previous experience with pygtk .............. ...

PyGTK Window not hiding when told to

In my PyGTK application, I am asking a user to find a file so that operations can be performed on it. The application asks the user for the file, and relays that filename to the necessary methods. Unfortunately, when calling the gtk.dispose() method on that dialog, it just hangs there until the method being called upon to perform the f...

making more rows in a row of treeview!

I wanna make sth like this in transmission: [link text]here1 (also in pidgin too, Status under IDs) can anyone show me a sample code here? ...

why does my pygtk application crash when copying text on a clipboard?

Hi all, I'm writing a python application using pygtk. I have a main thread who occasionally calls another thread that is supposed to build a string and then copy it on the clipboard before dying. My "slave" thread looks pretty much like this: class Slave(threading.Thread): def run(self): s = build_string() c = gtk.Cl...

What's easier and cleaner? GTK or QT?

Possible Duplicate: What should I choose: GTK+ or Qt? What's easier to understand and more natural, faster to master, pleasant to use every day with different languages - the latest version of GTK or QT? The question may be a bit subjective and hollyWar-ish, but interesting, significant and possible to answer objectively, I b...

save gtk.DrawingArea to file

Hi. I want to save gtk.DrawingArea() object contents to jpeg file using PIL. Particularly I want add to this script possibility to make photo. I found how to save image to jpeg. All I need - get pixbuf object from gtk.DrawingArea() object. How can I do this? ...

Why can't I import pygtk?

I followed the instructions in this post. Everything installed successfully. However, when I run python I cannot import pygtk. Specifically, it says this: >>> import pygtk \n “ImportError: No module named pygtk” I'm guessing I have to do some commands like make or something, but I can't find anywhere where it says what to do. Please h...

[PyGTK] Saving gtk.TextTags to file?

So I am trying to write a rich text editor in PyGTK, and originally used the older, third party script InteractivePangoBuffer from Gourmet to do this. While it worked alright, there were still plenty of bugs with it which made it frustrating to use at times, so I decided to write my own utilizing text tags. I have got them displaying and...

[PyGTK] Move cursor upon right click in TextView?

At the moment, when one right clicks in a TextView, a popup menu is brought up, but the cursor doesn't actually change position to where one is right clicking, it just leaves the cursor alone. For me, whom is trying to implement a spell checking menu, this isn't good since I have to click THEN right click in order to get the cursor in th...

Get the length in characters of a PyGTK TextView

I have a gtk TextView in a maximized window and I want to know how many characters a line can fit before you have to scroll. ...

Windows XP GTK App Glib Import Error

Hello, I am trying to run my GTK app on Windows XP and I am having troubles with an import. I have installed the following as needed and recommended: python-2.6.msi gtk2-runtime.2-16.6.exe pycairo-1.8.6.exe pygobject-2.20.0 pygtk-2.16.0.exe pyserial-2.5.exe However, I am getting the following error when running my script: Tracebac...

Continuing code execution after a pygtk.main() in python

I have an application where my DataFetch() class "Wraps" around my HBHTray() class for the purpose of interacting with the functions/variables of that class. Unfortunately, I can't seem to be able to get the code to continue execution after my DataFetch() class makes a instance of HBHTray and calls it, and on the Start() method of HBHTra...

Width of widget

In PyGTK what is the easiest way to figure out the dimensions of a widget? I know that it is easy to do with the gtk.Window object, but I can't find in the reference manual any way to get dimensions for the other objects. Any help is greatly appreciated thanks :D ...

Python Window Resize

Using Python + PyGTK. Is there a signal/event way of checking for a window resize? If so then what is the easiest way of implementing and using this signal. ...

PyGTK connect_signals

Ok so I have a little test program here: This is in my file that I load through gtk.Builder <object class="GtkWindow" id="mainWindow"> <property name="default_width">500</property> <property name="default_height">250</property> <signal name="delete_event" handler="endProgram" /> </object> I then use this: def endProgram ...

PyGTK Timers and Maximized Windows

I have a timer in a PyGTK app, and it works fine --- until I maximize the window; then the timer stops firing. Has anyone experienced this? What can be done about it? Here's a code sample: import gtk, gobject files = ["C:/images/test1.jpg", "C:/images/test2.jpg", "C:/images/test3.jpg"] win = gtk.Window() win.set_title("Slideshow") ...

How to search through a gtk.ListStore in pyGTK and remove elements?

I have the following code (where store is a gtk.ListStore and titer is a gtk.TreeIter. The docs say that if there is no next row, iter_next() will return None, hence the break when that is found. It is supposed to search through the ListStore of (int, str) and remove the one item whose int component matches item_id. while True: ...

Launch default image viewer from pygtk program

Hi there! I'm writing a PyGTK GUI application in Ubuntu to browse some images, and I'd like to open an image in the default image viewer application when it is double-clicked (like when it is opened in Nautilus). How can I do it? ...

Python window focus

I would like to find out if a window has focus. I am using pyGTK and would be helpful to us that but have got some Xlib in my script aswell. I've used: self.window.add_events( gdk.FOCUS_CHANGE_MASK ) # It took me ages to research this self.window.connect("focus-in-event", self.helloworld) but this gives me the event every time the win...