pygtk

pyGTK Multiple line input fields?

Already searched on google... doesnt seem to be there... help! ...

Control tab focus (choose next element to focus) with GTK / PyGTK

How can I force the Tab to focus the element I want, is it possible to give my software a list of elements to cycle focus ? I remember once using a property called tabindex, but I can't find it anymore. Maybe, preventing Tab to focus an element could also work ? ...

GTK / PyGTK make ComboBox searchable with keyboard

Is it possible to make a ComboBox searchable ? If yes, how ? I want to be able, when the ComboBox is active and a letter is typed with the keyboard, to select the first item beginning with this letter inside the ComboBox and so on with the next letters. The is the same functionality of a ComboBox inside a webpage, for example. I can't...

Font width returns incorrect values

The following code should return the width in pixels of the character 'a' in the default font; it doesn't: import pygtk gtk.require20() import gtk t = gtk.TextView() print t.get_style().get_font().width("w") # Always returns -6 ...

What is the fastest way to plot a 2d numpy array of pixel data with pygtk?

I have a numpy array of pixel data that I want to draw at interactive speeds in pygtk. Is there some simple, fast way to get my data onto the screen? ...

How to make GtkListStore store object attribute in a row?

I'w trying to keep at ListStore non-text objects using snippet I found. These are the objects: class Series(gobject.GObject, object): def __init__(self, title): super(Series, self).__init__() self.title = title gobject.type_register(Series) class SeriesListStore(gtk.ListStore): def __init__(self): super(SeriesListStore, self)....

Python `YYYY-MM-DD`

In Python, what is the best way to get the RFC 3339 YYYY-MM-DD text from the output of gtk.Calendar::get_date()? ...

twisted + gtk: should I run GUI things in threads, or in the reactor thread?

From what I understand about twisted, nothing running in the reactor thread should block. All blocking activities should be delegated to other threads, to fire callbacks back into the reactor thread when they're done. So does this apply to gtk things as well? For example, I want to display a "connection failed" message if the connection...

PyGTK TreeColumns all exact duplicates

I wrote a simple PyGTK script to show some basic process information in a TreeView: import gtk import os import pwd import grp class ProcParser: """ Parses the status file of a particular process """ def __init__(self, fname): self.lines = map(lambda x: x[:-1], open(fname).readlines()) def get_by_val(self, ...

PyGTK Update Sibling Widget Label

Just getting started with PyGTK and Glade3 and would love some help. Container Hierarchy: window -> vbox1 -> {button1 , label1} button1 calls back to on_button1_clicked(self, widget): print "Hello World!" #This sends the output to the console widget.set_label("Hello World!") #T...

make my gtk buttons more windows-like

How can I get my gtk buttons to look more like standard windows buttons? In this particular example, I have OK and Cancel buttons, but they're a different size than the OK and Cancel buttons in every windows app. How can I change their size to look more like windows'? ...

[GTK+ Builder] Trouble Updating Label Text

Environment: Built interface using Glade3. Backend is written in Python using the GTK+ Builder library. - Although I know the method I need to use to update a label's text (label.set_text("string")), I'm having trouble obtaining the label object in the python code. Here's what my code looks like: #!/usr/bin/python # Filename: Hel...

Can't scroll to the end of TreeView PyGTK / GTK

When I try to scroll down to the end of my TreeView, which is inside a ScrolledWindow, it doesn't scroll where it should but one or two lines before. I tried several methods and they all provide the same behavior : self.wTree.get_widget("tree_last_log").scroll_to_cell((self.number_results-1,)) # or self.wTree.get_widget("tree_last_log...

Cairo context and persistence?

Hi, I am just getting started using pycairo, and I ran into the following interesting error. The program I write creates a simple gtk window, draws a rectangle on it, and then has a callback to draw a random line on any kind of keyboard input. However, it seems that with each keyboard input, I have to create a new context, or I get an er...

created sorted table in gtk

What's the easieest way to create a sorted table view in gtk? I'm not sure if that's the right term, but you know the one: Is there a built-in widget for this? If not, how would I go about making those columns that look slightly different, click to change sorting, etc. Note I don't need multi-column sorting at the moment. ...

gtk: label which goes multi-line instead of expanding horizontally

I have a VBox which looks like this: ImportantWidget HSeparator Label I want this window to be only as wide as ImportantWidget needs to be, and no wider. However, the Label can sometimes grow to be very long. I want the following logic: if Label can fit all its text without expanding the VBox horizontally (after it has grown eno...

gtk: expand widget as if it had some text in it

I have a GTK widget, in this case, a TreeView. It starts off pretty small and compressed, as there's no text in it besides the columns names. As I add things, it grows horizontally to cover the text and vertically to cover the extra rows. If I then take those away, it retains its expanded size. It's kind of annoying for your window to a...

gtk logic behind treeviewcolumns needing cell renderers

From what I understand about GTK, if I have a TreeView, I can't just use any widget I want to display information about a column. For text, you need a gtk.CellRendererText. For toggle buttons, a gtk.CellRendererToggle. For anything else, it seems you have to implement yourself, which, from a sample one for buttons that I saw, doesn't loo...

gtk: detect click on a cell in a TreeView

I'm displaying some data as a TreeView. How can I detect a click on a particular tree-view cell, so that I know which column of which row was clicked on? This is what I want to do, so maybe there's a better way: Part of the data is a series of True/False values indicating a particular set of options. For example, the options might be pi...

gtk: trouble modifying TreeView model on CellRendererCombo 'changed' signal

I have a treeview with a CellRendererCombo in a given column. I use the following code to set up the column: crc = gtk.CellRendererCombo() crc.set_property('model', comboModel) crc.set_property('text-column', 0) crc.set_property('editable', True) crc.set_property('has_entry', False) cl = gtk.TreeViewColumn(ctitle, crc, text=i) def chan...