Bug with TableEditor

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

Bug with TableEditor

sylvain roy
Hello everyone,

I noticed a very mean bug. When a list is displayed using a TableEditor
and a list item is selected by a left click of the mouse, it sometimes
happens that
the cursor transforms in a little "dragging hand" with a plus sign beside.
It is then impossible to click any other button on the screen. The only
way to
escape this problem is to reboot the computer. I'm on Ubuntu 9.10,
Python 2.5.

I'm not up to date with Enthought version. If this bug has already been
fixed, let me know,
I will update to the latest version. If the bug wasn't reported before
and the description above is clear enough,
I can explain in more details with an example.

Regards,
Sylvain



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

Re: Bug with TableEditor

Robert Kern
On Thu, May 27, 2010 at 4:41 PM, Sylvain Roy <[hidden email]> wrote:

> Hello everyone,
>
> I noticed a very mean bug. When a list is displayed using a TableEditor
> and a list item is selected by a left click of the mouse, it sometimes
> happens that
> the cursor transforms in a little "dragging hand" with a plus sign beside.
> It is then impossible to click any other button on the screen. The only
> way to
> escape this problem is to reboot the computer. I'm on Ubuntu 9.10,
> Python 2.5.

Is this with the wx backend? At the very least, you should not have to
reboot. You should be able to simply kill the X server using
Ctrl-Alt-Backspace.

> I'm not up to date with Enthought version. If this bug has already been
> fixed, let me know,

I don't think we've ever encountered it.

> I will update to the latest version. If the bug wasn't reported before
> and the description above is clear enough,
> I can explain in more details with an example.

Yes, an example always helps.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Bug with TableEditor

sylvain roy
Robert Kern wrote:

> On Thu, May 27, 2010 at 4:41 PM, Sylvain Roy <[hidden email]> wrote:
>  
>> Hello everyone,
>>
>> I noticed a very mean bug. When a list is displayed using a TableEditor
>> and a list item is selected by a left click of the mouse, it sometimes
>> happens that
>> the cursor transforms in a little "dragging hand" with a plus sign beside.
>> It is then impossible to click any other button on the screen. The only
>> way to
>> escape this problem is to reboot the computer. I'm on Ubuntu 9.10,
>> Python 2.5.
>>    
>
> Is this with the wx backend? At the very least, you should not have to
> reboot. You should be able to simply kill the X server using
> Ctrl-Alt-Backspace.
>
>  
>> I'm not up to date with Enthought version. If this bug has already been
>> fixed, let me know,
>>    
>
> I don't think we've ever encountered it.
>
>  
>> I will update to the latest version. If the bug wasn't reported before
>> and the description above is clear enough,
>> I can explain in more details with an example.
>>    
>
> Yes, an example always helps.
>  
Here is the example. To reproduce the bug, click on the list entries
and drag the selected entry on the screen by a few millimeters.
It doesn't necessarily work on the first try. I had to click for about
30 sec
on the interface before it bugged.

from enthought.traits.api import HasTraits, List, Str, Instance
from enthought.traits.ui.api import View, Item, TableEditor
from enthought.traits.ui.table_column import ObjectColumn

editor = TableEditor(
    columns = [ ObjectColumn( name = 'client', label='Clients', width =
0.20, horizontal_alignment = 'center')],  
    sort_model  = True,  
    auto_size   = False,
    orientation = 'vertical'
    )

class Client(HasTraits):
    client = Str


class MyClass(HasTraits):
    clients = List(Instance(Client))
   
    traits_view = View(Item( 'clients',
                                      show_label = False,
                                      editor  = editor,
                                      style='readonly',
                            )
                        )
   
if __name__ == "__main__":
    clients = []
    for name in ['Bob', 'Peter', 'Joe']:
        clients.append(Client(client=name))
    my_object = MyClass(clients = clients)
    my_object.configure_traits()



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

Disable part of radio buttons

Boiteux, Benoit
Hello,

With Traits, is it possible to disable part of radio buttons group.
Let's say I have a 3 values Enum, I display it as radio button ('custom'), and for some configuration, I have to disable 1 of the 3 buttons.

Any trick ? (the only work around I found is to create 2 enums and hide/show them, but that's really dirty code)

Thanks,
Benoit
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

Re: Disable part of radio buttons

bryce hendrix-2
On 5/28/2010 4:26 AM, Boiteux, Benoit wrote:
> Hello,
>
> With Traits, is it possible to disable part of radio buttons group.
> Let's say I have a 3 values Enum, I display it as radio button ('custom'), and for some configuration, I have to disable 1 of the 3 buttons.
>
>    

No, I don't think there is...

> Any trick ? (the only work around I found is to create 2 enums and hide/show them, but that's really dirty code)
>    

Well, if you're unhappy with that hack, how about this one: draw a box
on top of the options you want to disable with the alpha channel set to
20%. It will look disabled at least. No, I'm not serious.

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

Re: Disable part of radio buttons

Boiteux, Benoit
He He, thanks for the transparency effect trick :)
I'm gonna use my work around.

I also noticed that when you use 'visible_when' option on an item (with items above and below), there is not clean refresh of the GUI (display problem). With wx backend only, works well with Qt backend. You already saw that ?

Benoit

-----Original Message-----
From: Bryce Hendrix [mailto:[hidden email]]
Sent: Friday, May 28, 2010 2:31 PM
To: [hidden email]
Cc: Boiteux, Benoit
Subject: Re: [Enthought-Dev] Disable part of radio buttons

On 5/28/2010 4:26 AM, Boiteux, Benoit wrote:
> Hello,
>
> With Traits, is it possible to disable part of radio buttons group.
> Let's say I have a 3 values Enum, I display it as radio button ('custom'), and for some configuration, I have to disable 1 of the 3 buttons.
>
>    

No, I don't think there is...

> Any trick ? (the only work around I found is to create 2 enums and hide/show them, but that's really dirty code)
>    

Well, if you're unhappy with that hack, how about this one: draw a box
on top of the options you want to disable with the alpha channel set to
20%. It will look disabled at least. No, I'm not serious.

Bryce
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

Re: Disable part of radio buttons

bryce hendrix-2
Quoting "Boiteux, Benoit" <[hidden email]>:

> He He, thanks for the transparency effect trick :)
> I'm gonna use my work around.

For the record, that is how the SVGButtonEditor displays disabled buttons.

>
> I also noticed that when you use 'visible_when' option on an item  
> (with items above and below), there is not clean refresh of the GUI  
> (display problem). With wx backend only, works well with Qt backend.  
>  You already saw that ?

I've seen it from time to time. If I remember correctly, it depends on  
where the items are nested in a view. Do you have an example which has  
the problem?


Bryce

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

Re: Disable part of radio buttons

Boiteux, Benoit
Hi Brice,

I quickly wrote this basic example where I can reproduce the problem:

------------------------
from enthought.traits.api import HasTraits, Bool, Str, Color
from enthought.traits.ui.api import Item, View

class DummyItem(HasTraits):
    enable = Bool(True)
   
    dummy_item1 = Str("")
    dummy_item2 = Str("")
    dummy_item3 = Str("")
    dummy_item4 = Bool(False)
    dummy_item5 = Color
   
    view = View(
                Item('enable', label = 'Show/Hide', style = 'custom'),
                Item('dummy_item1', label='Item1'),
                Item('dummy_item2', label='Item2', visible_when = 'enable == True'),
                Item('dummy_item3', label ='Item3'),
                Item('dummy_item4', label ='Long name Item4'),
                Item('dummy_item5', label ='Another name Item5'),
                title = 'Example',
                resizable = True
                )

example = DummyItem()

if __name__ == '__main__':
    example.configure_traits()
----------------------------------

By clicking on 'Show/Hide' check box, you'll notice labels of item 4 and 5 are mixed (with short labels, don't see the problem)

Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Friday, May 28, 2010 3:36 PM
To: Boiteux, Benoit
Cc: [hidden email]
Subject: RE: [Enthought-Dev] Disable part of radio buttons

Quoting "Boiteux, Benoit" <[hidden email]>:

> He He, thanks for the transparency effect trick :)
> I'm gonna use my work around.

For the record, that is how the SVGButtonEditor displays disabled buttons.

>
> I also noticed that when you use 'visible_when' option on an item  
> (with items above and below), there is not clean refresh of the GUI  
> (display problem). With wx backend only, works well with Qt backend.  
>  You already saw that ?

I've seen it from time to time. If I remember correctly, it depends on  
where the items are nested in a view. Do you have an example which has  
the problem?


Bryce

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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