473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Editable lists in pygtk - Editing wrong cell

Hi all, i m trying to make an editable list with a toggle button, it
shows up and i can edit the list.. but its editing the wrong cell!

If i click on the toggle button on the first cell it sets FALSE on the
last cell of that row, if i change the text of the last cell if changes
another cell text... here is my code:

tree = self.principal.get_widget("file_list")
list = gtk.ListStore(str, str)
#Permite selecionar os arquivos
toggle = gtk.CellRendererToggle()
toggle.set_property('activatable', True)
tree.insert_column_with_attributes(-1, "Convert?", toggle)
toggle.connect('toggled', self.Select, tree)
#permite editar a lista
renderer = gtk.CellRendererText()
renderer.set_property( 'editable', True )
renderer.connect('edited', self.Edit, list)
tree.insert_column_with_attributes(-1, "Artist", renderer, text=0)
tree.insert_column_with_attributes(-1, "Song", renderer, text=1)
tree.set_model(list)

def Select(self,cell,path,model):
model[path][1] = not model[path][1]
return
def Edit(self, cell, path, new_text, model):
model[path][0] = new_text

What's wrong with it? i m following this example:
http://pygtk.org/pygtk2tutorial/sec-...tableTextCells

thanx in advance

Feb 25 '06 #1
0 1072

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Rod W | last post by:
I'm just starting out on Python but my primary goal is to provide applications with some user interface (GUI). Can someone point me to a good comparison of whether I should use wxPython (with...
7
by: deko | last post by:
SELECT tblTxAcct.TxAcctName, tblTxType.TxTypeName, Nz(qryTxAcctListCt.TxCount, 0) AS TxCt FROM (tblTxAcct INNER JOIN tblTxType ON tblTxAcct.TxType_ID=tblTxType.TxType_ID) LEFT JOIN qryTxAcctListCt...
1
by: wonil kim | last post by:
Hi, All. Can I use ListView control for sub item editing purpose? For example, Name Value ------------------ X 1 Y 2 ATTR 10
2
by: Greg | last post by:
Does anyone know of a way to allow a user to click on a cell within a datagrid and then edit the contents of that cell? Nearly all the topics I've come across on Google appear to be for the webform...
2
by: Tim N. van der Leeuw | last post by:
I tried to create a windows executable of a pygtk program. My first attempt worked, kinda, except that no themes were applied and no readable fonts were found by pango; so all letters where just...
1
by: Samuel Shulman | last post by:
Any method to make a cell editable programmatically The problem is that if the user entered a value which is not valid then instead of ignoring the value and explaining the user what was wrong ...
1
by: planetthoughtful | last post by:
Hi All, I have a web page that presents records in a table, with one row per record. I'd like to put an edit button next to each record, such that if a user clicks on the edit button next to...
0
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
When I have an editable combobox in a DataGridView and the user tries to correct an error they can not move the cursor from character to character with the arrow keys. The arrow keys move focus...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.