Re: Passing a column number to a cell renderer's edited signal




On May 17, 2005, at 10:56 PM, Dan wrote:

However the $column_no received when the 'edited' signal is fired is
always the last value of $column_no from when I set things up -
$column_no is being interpreted each time. I understand why.

For the record, it's closure capture problem.


I just
can't think of a way around it. How do I 'hard code' the column number
into the sub ... without having to have a separate signal_connect line
for each column?

For the closure, you could create a lexical to capture the value.

But the easiest and most robust way is, as you did in the other message, attach the column number directly to the instance.


--
The door is locked. I tried to open it, but the lock is harder to pick than a broken nose.
  -- Sensei, on 'I, Ninja'




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]