[PEAK] Trellis-ified wx Dialog
Phillip J. Eby
pje at telecommunity.com
Thu Jul 19 16:05:03 EDT 2007
At 12:46 PM 7/19/2007 -0700, Grant Baillie wrote:
>On 19 Jul, 2007, at 11:55, Phillip J. Eby wrote:
>
>>By the way, another way to do the above would be:
>>
>> class EditBridge(trellis.Component):
>> trellis.values(
>> widget = None,
>> cell = None,
>> )
>> trellis.rules(
>> setup = lambda self: self.widget.Bind
>> (wx.EVT_KILL_FOCUS, self.write),
>> read = lambda self: self.widget.SetValue(self.cell),
>> )
>> def write(self, event):
>> self.cell = self.widget.GetValue()
>
>Hmmm ... if I do that, then the read rule gets called with a widget
>of None.
Eh? That shouldn't be possible -- isn't the code passing in a widget
in the kwargs to EditBridge? The setting of 'widget' should be
happening before *any* rules are called. Can you check to make sure
that you are passing a non-None widget to EditBridge()?
More information about the PEAK
mailing list