pygtk

PyGTK StatusIcon with transparency

Hi, I'm trying to create a PyGTK StatusIcon with transparent background. I need to draw the contents of the StatusIcon at runtime. StatusIcon wants a Pixbuf object (which can have transparency). No problem with that: pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, width, height) pixbuf.fill(0xffffffff) The problem is, I can...

Dynamic resize with MPlayer and PyGTK

Hi everyone; I've wrote a piece of code in python and pygtk for an embeded mplayer in a gui. I assume I use GtkSocket and the slave mode of mplayer with the -wid option. But I've got an issue, when the size of my GTK window is smaller than my stream, the stream appears to be cropped. And when the size of my window is bigger than my stre...

Getting values from Multiple Text Entry using Pygtk and Python

On a click of a button named "Add Textbox" it calls a function which creates a single textbox using (gtk.Entry) function. So each time i click that button it creates a textbox. I have a submit button which should fetches all the values of the text boxes(say 10 textboxes) generated with the name of "entry". It works for one textbox but no...

Can I avoid a threaded UDP socket in Python dropping data?

...

pygtk - dynamically update the widgets taking input from the gtk combo box

On selecting value from 1 to 10 from gtk combox box it should populate the checkbox by taking combo box value as an input. Say for example if i select 5 then 5 checkbox will be generated. It works.. But the issue is after i selected 5 now im selecting next value as 3 from combo box then there 8 checkboxes are displayed. The old 5 checkbo...

Detect user logout / shutdown in Python / GTK under Linux - SIGTERM/HUP not received

OK this is presumably a hard one, I've got an pyGTK application that has random crashes due to X Window errors that I can't catch/control. So I created a wrapper that restarts the app as soon as it detects a crash, now comes the problem, when the user logs out or shuts down the system, the app exits with status 1. But on some X errors i...

Pygtk entry placeholder

How to create pygtk entry with placeholder like in HTML 5 input element? ...

How to list directory hierarchy in PyGTK treeview widget?

I am trying to generate a hierarchical directory listing in pyGTK. Currently, I have this following directory tree: /root folderA - subdirA - subA.py - a.py folderB - b.py I have written a function that -almost- seem to work: def go(root, piter = None): for filename in os.listdir(ro...

PyGTK, Glade, Changing the window view and threads

Heya Everyone, Forgive me if this seems like a stupid question, just so far no where on the internet can I find someone offering a solution to this and I just wanted to get some feedback from someone with more experience than myself (I've only been using python, pyGTK and Glade for 2 days now). I have a UI window displaying and it upda...

How to add a separator in a PyGTK combobox?

I'm using gtk.combo_box_new_text() to make combobox list, this uses a gtk.ListStore to store only strings, so there are some way to add a separator between items without use a complex gtk.TreeModel? If this is not possible, what is the simplest way to use a gtk.TreeModel to able secuential widget addition? ...

Start PyGTK cellrenderer edit from code

I have a treeview with an editable CellRendererText: self.renderer = gtk.CellRendererText() self.renderer.set_property('editable', True) But now I need to launch the edition from code instead from user, this is to focus the user attention in the fact he just created a new row and needs to be named. I tried this but does not work: sel...

Zoomed PyGTK image without scale pixbuf

I want to display a gtk.Image with a high level of zoom, but scale the image to a new pixbuf with the gtk.gdk.Pixbuf methods waste a lot of memory and processor. Are there some simply way to display a zoomed image? ...

Enable PyGTK Eventbox motion-notify-event while is a Layout child

I noticed when a Eventbox is added into a Layout some events are missed, this does not happend for example adding it to a Fixed (very similar widget), I tried to restore the event mask in this way with no sucess: import pygtk import gtk def foo(widget, event): print event pygtk.require('2.0') window = gtk.Window(gtk.WINDOW_TOPL...

GUI freezes when executing def function. Use threads?

Hi, I've made a small program which has 2 buttons and each does certain thing. Here's a simplified version of the code. Thing is it works fine except that the button freezes and stays in a clicked position and whole GUI freezes until the command is completed. As far as I know threads would be best to use in this situation, but I have no...

Simple pygtk and threads example please.

Hello, Can someone give me a simple example involving threads in this manner, please. Problem with my code is that when I click button One, GUI freezes until its finished. I want buttons to stay responsive when def is being executed. How can i fix that? class fun: wTree = None def __init__( self ): ...

Help calling def from class.

Hello, Noob question... class msgbox: def __init__(self, lbl_msg = '', dlg_title = ''): self.wTree = gtk.glade.XML('msgbox.glade') self.wTree.get_widget('dialog1').set_title(dlg_title) self.wTree.get_widget('label1').set_text(lbl_msg) self.wTree.signal_autoconnect( {'on_okbutto...

Error install PyGtk.

I tried to install pygtk on mac. I downloaded the pygtk file, opened up terminal and set it to my working directory, then ran the command "python setup.py install". There was an import error because there was no module dsextras. Does anyone know how to install pygtk on a mac or get dsextras. ...

Using mac ports to install py26-gtk switches off my Mac

Hi I have Mac OS 10.6.3, python 2.6, mac ports 1.8.2. Im trying to run 'sudo port install py26-gtk' but my mac book doesn't get further than 'building gcc43', while doing that it switches off without shutting down. It is not overheating since I tried it again while my mac book was sandwiched between 2 cold packs. The mac was cool and t...

Python/X11: find out if user switches virtual desktops

Hello everyone, I'm looking for a way to determine if the user switches virtual desktops under X11. I'm using Python with X11 libraries and PyGTK. I found some working examples in C, but I lack the expertise to translate them into Python, and I read the source code of several X11 pager applications (fbpanel, pypanel), but I can't seem ...

Problem building PyGTK on CentOS

I am trying to build PyGTK on CentOS for a non-standard Python (2.6, vs the out-of-the-box 2.4). It requires that I first build pygobject. pygobject-2.18.0 fails at the configure step. The error messages is as follows: checking for GLIB - version >= 2.14.0... no *** Could not run GLIB test program, checking why... *** The test program f...