[PEAK] Trellis-ified wx Dialog
Grant Baillie
grant at osafoundation.org
Thu Jul 19 15:46:45 EDT 2007
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. Adding an 'if self.widget' causes an infinite loop.
--Grant
More information about the PEAK
mailing list