Pb with custom FileEditor on windows

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

Pb with custom FileEditor on windows

Jonathan Rocher

Dear all,

I am running the code below to select a file. On MAC and Linux, I have no problems as the list of drives can be expanded to explore the folders inside (little triangles appear on the left of drives to expand them). On windows however (tested on Vista and 7) the list of drives doesn't want to be expanded to search withing them (I tried double clicking, right clicking, ...).
Do you guys agree this is a bug or is there a trick I am not able to find it? If it is the latter the current situation is at least not intuitive ...

Best,
Jonathan

Ps I am using the WX toolkit...

----
from enthought.traits.api import File, HasTraits
from enthought.traits.ui.api import View, Item, FileEditor

class FileChooser(HasTraits):

    header = File()

    view = View(Item('header',
                         editor=FileEditor(),
                         style = 'custom'),
                    width=450,
                    resizable = True)

    def _header_changed(self):
        print "file changed to", self.header

if __name__ == "__main__":

    fc = FileChooser()
    fc.configure_traits()



--
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
[hidden email]
1-512-536-1057
http://www.enthought.com



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

Re: Pb with custom FileEditor on windows

Jonathan March
Right arrow expands node. Left arrow collapses it (Win 7).

On Fri, Mar 4, 2011 at 10:37 AM, Jonathan Rocher <[hidden email]> wrote:

Dear all,

I am running the code below to select a file. On MAC and Linux, I have no problems as the list of drives can be expanded to explore the folders inside (little triangles appear on the left of drives to expand them). On windows however (tested on Vista and 7) the list of drives doesn't want to be expanded to search withing them (I tried double clicking, right clicking, ...).
Do you guys agree this is a bug or is there a trick I am not able to find it? If it is the latter the current situation is at least not intuitive ...

Best,
Jonathan

Ps I am using the WX toolkit...

----
from enthought.traits.api import File, HasTraits
from enthought.traits.ui.api import View, Item, FileEditor

class FileChooser(HasTraits):

    header = File()

    view = View(Item('header',
                         editor=FileEditor(),
                         style = 'custom'),
                    width=450,
                    resizable = True)

    def _header_changed(self):
        print "file changed to", self.header

if __name__ == "__main__":

    fc = FileChooser()
    fc.configure_traits()



--
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
[hidden email]
1-512-536-1057
http://www.enthought.com



_______________________________________________
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: Pb with custom FileEditor on windows

mike tallhamer
I came accross this issue some time back and I believe it might be something going on in the handler for the 'custom' and 'readonly' styles. If you use the 'simple' style double clicking on the drive expands it as expected.

The same thing happens in the Traits demos on Windows. For example the File Dialog demos don't allow you to expand the drives unless you use the arrow keys as stated below or unless you type the drive in the text box at the bottom (e.g. M: followed by Enter expands the M:\ drive on my Windows PC while everything seems to work as expected on my Mac and Linux machines)

-Mike

On 3/4/2011 10:41 AM, Jonathan March wrote:
Right arrow expands node. Left arrow collapses it (Win 7).

On Fri, Mar 4, 2011 at 10:37 AM, Jonathan Rocher <[hidden email]> wrote:

Dear all,

I am running the code below to select a file. On MAC and Linux, I have no problems as the list of drives can be expanded to explore the folders inside (little triangles appear on the left of drives to expand them). On windows however (tested on Vista and 7) the list of drives doesn't want to be expanded to search withing them (I tried double clicking, right clicking, ...).
Do you guys agree this is a bug or is there a trick I am not able to find it? If it is the latter the current situation is at least not intuitive ...

Best,
Jonathan

Ps I am using the WX toolkit...

----
from enthought.traits.api import File, HasTraits
from enthought.traits.ui.api import View, Item, FileEditor

class FileChooser(HasTraits):

    header = File()

    view = View(Item('header',
                         editor=FileEditor(),
                         style = 'custom'),
                    width=450,
                    resizable = True)

    def _header_changed(self):
        print "file changed to", self.header

if __name__ == "__main__":

    fc = FileChooser()
    fc.configure_traits()



--
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
[hidden email]
1-512-536-1057
http://www.enthought.com



_______________________________________________
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: Pb with custom FileEditor on windows

mike tallhamer
FYI

Placing...

from enthought.etsconfig.api import ETSConfig
ETSConfig.toolkit = 'qt4'

at the top of the demo.py file for the Traits demo causes the File Dialog demos to work as expected on Windows. It looks like it might be a wx thing or again something not getting hooked up right in the handler or TraitsUI factory for the control.

-Mike

On 3/4/2011 10:57 AM, Mike Tallhamer wrote:
I came accross this issue some time back and I believe it might be something going on in the handler for the 'custom' and 'readonly' styles. If you use the 'simple' style double clicking on the drive expands it as expected.

The same thing happens in the Traits demos on Windows. For example the File Dialog demos don't allow you to expand the drives unless you use the arrow keys as stated below or unless you type the drive in the text box at the bottom (e.g. M: followed by Enter expands the M:\ drive on my Windows PC while everything seems to work as expected on my Mac and Linux machines)

-Mike

On 3/4/2011 10:41 AM, Jonathan March wrote:
Right arrow expands node. Left arrow collapses it (Win 7).

On Fri, Mar 4, 2011 at 10:37 AM, Jonathan Rocher <[hidden email]> wrote:

Dear all,

I am running the code below to select a file. On MAC and Linux, I have no problems as the list of drives can be expanded to explore the folders inside (little triangles appear on the left of drives to expand them). On windows however (tested on Vista and 7) the list of drives doesn't want to be expanded to search withing them (I tried double clicking, right clicking, ...).
Do you guys agree this is a bug or is there a trick I am not able to find it? If it is the latter the current situation is at least not intuitive ...

Best,
Jonathan

Ps I am using the WX toolkit...

----
from enthought.traits.api import File, HasTraits
from enthought.traits.ui.api import View, Item, FileEditor

class FileChooser(HasTraits):

    header = File()

    view = View(Item('header',
                         editor=FileEditor(),
                         style = 'custom'),
                    width=450,
                    resizable = True)

    def _header_changed(self):
        print "file changed to", self.header

if __name__ == "__main__":

    fc = FileChooser()
    fc.configure_traits()



--
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
[hidden email]
1-512-536-1057
http://www.enthought.com



_______________________________________________
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: Pb with custom FileEditor on windows

Jonathan Rocher
In reply to this post by Jonathan March
Yes that's working on Vista too Jonathan. Thanks very much. Was not obvious to me (am I the only one? Worth changing?).

Thanks also to Mike for your explanations. I will try to track this down to see if it is a traits UI or a WX problem...

Jonathan

On Fri, Mar 4, 2011 at 11:41 AM, Jonathan March <[hidden email]> wrote:
Right arrow expands node. Left arrow collapses it (Win 7).

On Fri, Mar 4, 2011 at 10:37 AM, Jonathan Rocher <[hidden email]> wrote:

Dear all,

I am running the code below to select a file. On MAC and Linux, I have no problems as the list of drives can be expanded to explore the folders inside (little triangles appear on the left of drives to expand them). On windows however (tested on Vista and 7) the list of drives doesn't want to be expanded to search withing them (I tried double clicking, right clicking, ...).
Do you guys agree this is a bug or is there a trick I am not able to find it? If it is the latter the current situation is at least not intuitive ...

Best,
Jonathan

Ps I am using the WX toolkit...

----
from enthought.traits.api import File, HasTraits
from enthought.traits.ui.api import View, Item, FileEditor

class FileChooser(HasTraits):

    header = File()

    view = View(Item('header',
                         editor=FileEditor(),
                         style = 'custom'),
                    width=450,
                    resizable = True)

    def _header_changed(self):
        print "file changed to", self.header

if __name__ == "__main__":

    fc = FileChooser()
    fc.configure_traits()



--
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
[hidden email]
1-512-536-1057
http://www.enthought.com



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





--
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
[hidden email]
1-512-536-1057
http://www.enthought.com



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