From: Mark Krell Date: 2002-11-02T07:15:33+09:00 Subject: Fun with FX ruby.... I'm want to dynamicly add.delete rows to a table using FX ruby, but I'm running into some difficulty. In My dialog I have a connect for when I click an item in my table @table.connect(SEL_COMMAND, method(:push)) which runs this method (It looks in Col 4 for the "add" button, adds a row, and changes the button to delete. If it's delete, the delete the row) def push(sender, sel, ptr) x = ptr.col y = ptr.row return if y == 0 if x == 4 if @table.getItem(y,x).to_s == "Add" @table.setItemText(y,4, "Delete") FXTable::ID_INSERT_ROW @table.setItemText(y,0, y.to_s) @table.getItem(y, 0).setButton(true) @table.getItem(y, 0).justify = 0 @table.setItemText(y,4, "Add") @table.getItem(y, 4).setButton(true) @table.getItem(y, 4).justify = 0 elsif @table.getItem(y,x).to_s == "Delete" puts "DELETE" FXTable::ID_DELETE_ROW end end end I'm sure I'm using FXTable::ID_INSERT_ROW and FXTable::ID_DELETE_ROW incorrectly, how do you use it correctly? How do you delete the row you are currently clicking on? -Mark. __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/