Delay trait notification

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Delay trait notification

mike tallhamer
I would like to delay a trait notification until after I have finished
typing the value into a field. Is that possible? Right now every
keystroke triggers a calculation which is an issue when the calc is
rather expensive and the number is something like 110 which results in 3
individual calculations instead of just one.

Thanks,
Mike
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Delay trait notification

Chris Colbert
you can set the `auto_set` trait of the Item's editor to False.

On Wed, Feb 23, 2011 at 3:49 PM, Mike Tallhamer <[hidden email]> wrote:
I would like to delay a trait notification until after I have finished
typing the value into a field. Is that possible? Right now every
keystroke triggers a calculation which is an issue when the calc is
rather expensive and the number is something like 110 which results in 3
individual calculations instead of just one.

Thanks,
Mike
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Delay trait notification

Anthony Scopatz
Also, codetools has a much more robust example of how to defer a bunch of traits in an executing context.  https://github.com/enthought/codetools/blob/master/enthought/execution/executing_context.py

Chris's way is probably cleaner.


On Wed, Feb 23, 2011 at 8:57 PM, Chris Colbert <[hidden email]> wrote:
you can set the `auto_set` trait of the Item's editor to False.


On Wed, Feb 23, 2011 at 3:49 PM, Mike Tallhamer <[hidden email]> wrote:
I would like to delay a trait notification until after I have finished
typing the value into a field. Is that possible? Right now every
keystroke triggers a calculation which is an issue when the calc is
rather expensive and the number is something like 110 which results in 3
individual calculations instead of just one.

Thanks,
Mike
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Delay trait notification

Warren Weckesser
In reply to this post by Chris Colbert
Mike, attached is a small demo showing the use of the 'auto_set' and 'enter_set' traits.

Warren


On Wed, Feb 23, 2011 at 2:57 PM, Chris Colbert <[hidden email]> wrote:
you can set the `auto_set` trait of the Item's editor to False.


On Wed, Feb 23, 2011 at 3:49 PM, Mike Tallhamer <[hidden email]> wrote:
I would like to delay a trait notification until after I have finished
typing the value into a field. Is that possible? Right now every
keystroke triggers a calculation which is an issue when the calc is
rather expensive and the number is something like 110 which results in 3
individual calculations instead of just one.

Thanks,
Mike
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

auto_set_demo.py (910 bytes) Download Attachment