pygtk

pyGTK ComboBox List Height

I'm just getting started with pyGtk programming, so bear with me. I have a dialog with a ComboBox. The list that shows up when I click on the combo box has 70+ times in it. It extends from the top of the screen to the bottom. I can live with it, but I'd rather have the ComboBox perform like an html select element(i.e. top of menu is ...

Watching sockets with Glib on Windows puts them in non-blocking mode

The following code does not work correctly on Windows (but does on Linux): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setblocking(True) sock.connect(address) gobject.io_add_watch( sock.fileno(), gobject.IO_OUT | gobject.IO_ERR | gobject.IO_HUP, callback) Snippets o...

Widget Transparency in PyGTK?

What is the best way to have transparency of specific widgets in a PyGTK application? I do not want to use themes because the transparency of each of the widgets will be changing through animation. The only thing I can find is to use cairo to draw widgets with an Alpha, but I can't figure out how to do this. Is there perhaps a better wa...

Pygtk StatusIcon not loading?

Hey everyone, I'm currently working on a small script that needs to use gtk.StatusIcon(). For some reason, I'm getting some weird behavior with it. If I go into the python interactive shell and type: >> import gtk >> statusIcon = gtk.status_icon_new_from_file("img/lin_idle.png") Pygtk does exactly what it should do, and shows an icon...

Are there any examples of a Python PyGTK Pango editor toolbar?

I am looking for an example application written in Python and PyGTK. There should be an editor out there somewhere that already does this. Some app with a text editor row of buttons: - Font - Bold/italic/underline - etc I am hoping to avoid reinventing the wheel on this one! thanks ...

Visibility_notify event in pyGTK

Hello, I am on windows and I am developing a pygtk app. I need to know when a window is visible or hidden by another window. In order to stop an heavy drawing process. http://www.pygtk.org/docs/pygtk/class-gtkwidget.html#signal-gtkwidget--visibility-notify-event I Use the visibility_notify_event to be notified on windows visibility st...

change gtk.Paned handle size

gtk.Paned contains a style property called 'handle-size' which i assume will change the size of the handle, it's read only, so how do i change it?(in PyGtk) ...

How to escape characters in Pango markup?

My program has a gtk.TreeView which displays a gtk.ListStore. The gtk.ListStore contains strings like this: "<span size='medium'><b>"+site_title+"</b></span>"+"\n"+URL Where URL is (obviously) a URL string. Sometimes there are characters in URL that cause pango to fail to parse the markup. Is there a way to escape URL as a whole so...

Is there a way to uncheck all radio buttons in a group? (PyGTK)

Is there a way to uncheck all radio buttons in a group with PyGTK? No radio buttons are checked on startup, so I think there must be a way to return them all to that unchecked state. ...

Is PyGTK or PyQT preferred for making GTK-native Python apps?

I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons. What do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the oth...

Python, thread and gobject

I am writing a program by a framework using pygtk. The main program doing the following things: Create a watchdog thread to monitor some resource Create a client to receive data from socket call gobject.Mainloop() but it seems after my program enter the Mainloop, the watchdog thread also won't run. My workaround is to use gobject.t...

python GTK container for mjpeg stream

I have an mjpeg stream from a web-cam and would like to display it in an application written in python using pygtk. The stream is a string of bytes from the driver. What widget would be best for displaying this and would I need to do some intermediate conversion before putting it in the widget? Should I write my own widget to do this? ...

Scaling an image to its parent button size in GTK?

I have a GTK layout with a widget on the left of an HBox deciding the maximum height I want, and a VBox on the right containing three buttons, each containing only an image and no text. The images are a GTK stock icon, and so have the stock storage type. Using expand=True, fill=True packing the buttons without images are exactly the hei...

Unable to get Wacom events from /dev/input/event*.

I have created a pygtk program to monitor the keyboard status and mouse clicks across any application (i.e. not just for my application). This uses evdev by Micah Dowty which basically monitors /dev/input/event* for output and decodes the information in a way that I can display the information to the user. The program works perfectly fo...

Need example/help with GtkTextBuffer (of GtkTextView) serialize/deserialize

I am trying to save user's bold/italic/font/etc tags in a GtkTextView. Using GtkTextBuffer.get_text() does not return the tags. The best documentation I have found on this is: http://www.pygtk.org/docs/pygtk/class-gtktextbuffer.html#method-gtktextbuffer--register-serialize-format However, I do not understand the function arguments. It ...

Blocking behavior of PyGTK's main loop

My intention was to use pyGTK's main loop to create a function that blocks while it waits for the user's input. The problem I've encountered is best explained in code: #! /usr/bin/python import gtk def test(): retval = True def cb(widget): retval = False gtk.main_quit() window = gtk.Window(gtk.WINDOW_TOPLE...

Shaders with pygtkglext

Do someone know how to get glsl shaders work in gtk-opengl window? With glut all glCreateProgram etc. functions works, but when I tried to put the same gl code into pygtkglext window, its complaining about NullReference: OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgram, check for bool(glCreateProgram...

PyGTK: dynamic label wrapping

It's a known bug/issue that a label in GTK will not dynamically resize when the parent changes. It's one of those really annoying small details, and I want to hack around it if possible. I followed the approach at 16 software, but as per the disclaimer you cannot then resize it smaller. So I attempted a trick mentioned in one of the com...

howto scroll a gtk.scrolledwindow object from python code

I'm writing a python application that has a glade gui. Using subprocess to execute some shell commands in the background. Using a glade GUI which has a scrolledwindow widget and a textview widget inside the scrolledwindow widget. The textview gets populated as the subprocess.Popen object run and display their stdout and stderr to this t...

how to properly destroy gtk.Dialog objects/widgets

Noob @ programming with python and pygtk. I'm creating an application which includes a couple of dialogs for user interaction. #!usr/bin/env python import gtk info = gtk.MessageDialog(type=gtk.DIALOG_INFO, buttons=gtk.BUTTONS_OK) info.set_property('title', 'Test info message') info.set_property('text', 'Message to be displayed in the m...