Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default RangeEditor produces double error popups which cannot be closed #158

Open
itziakos opened this issue Feb 19, 2014 · 4 comments
Open

Comments

@itziakos
Copy link
Member

To replicate the issue run the following example and set the age value to -1.

from traits.api import HasTraits, Str, Range
from traitsui.api import View


class Person(HasTraits):
    """ A simple class representing a person object.

    """
    last_name = Str()

    first_name = Str()

    age = Range(low=0)

    traits_view = View('last_name', 'first_name', 'age', resizable=True)

if __name__ == '__main__':
    john = Person(first_name='John', last_name='Doe', age=42)
    john.configure_traits()
@corranwebster
Copy link
Contributor

I can't reproduce - I get a popup dialog (not entirely sure if that's ideal, but it's not the issue here), but it can be closed.

Is this windows-specific?

@bergtholdt
Copy link
Contributor

I had the same problem before and can also reproduce this on Win-7 x64. Also note that if I move the popup window, then there seems to appear immediately a second popup underneath, which cannot be moved. If I close the first, then move the second, I see the same behaviour (note the original dialog is below the upper popup).

image

When I use the task-bar to select the original dialog, it still focuses on the modal popup, but then after clicking the closing (X) of the popup (several times), I am able to break the immortal loop somehow and reach the point where I can reach the original dialog.

image

However I truly think that there should not be a popup at all because I find it really annoying when auto_set is active for any input.

@itziakos
Copy link
Member Author

one workaround of the RangeEditor issue is the following

python
from traits.api import HasTraits, Str, Int
from traitsui.api import View, RangeEditor


class Person(HasTraits):
    """ A simple class representing a person object.

    """
    last_name = Str()

    first_name = Str()

    # Added the editor keyword here to keep the ranges close to 
    # the definition. 
    age = Int(0, editor=RangeEditor(low=0, high=200))

    traits_view = View('last_name', 'first_name', 'age', resizable=True)

if __name__ == '__main__':
    john = Person(first_name='John', last_name='Doe', age=42)
    john.configure_traits()

However, it changes the semantics of the model

@jonathanrocher
Copy link
Contributor

I was able to reproduce the issue, and indeed this only happens on Windows (I have also seen it once on Linux (CentOS 6.7). On OSX (10.10) and most of the time on Linux (CentOS 6.7), there are only 2 popups (granted at least 1 too many), and they can be closed with the X or the ok button.

I agree that a popup isn't needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants