Picon

How to set a Bool as readonly

Hi list,

I have this readonly view:

    agent_view = View(
        Item('id', label='ID', style='readonly'),
        Item('xcor', label='Xcor', style='readonly'),
        Item('ycor', label='Ycor', style='readonly'),
        Item('color', label='Color', style='readonly'),
        Item('happy', label='Happy', style='readonly'),
        Item('wants_similar', label='Wants Similar', style='readonly')
        )

where 'happy' is actually a Bool value. Everything is ok except from the fact that this is the final result:


is there a way to show a checked button in readonly style?

thanks,
simone
_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
Warren Weckesser | 2 Jan 17:06
Gravatar

Re: How to set a Bool as readonly


simone gabbriellini wrote:
> Hi list,
>
> I have this readonly view:
>
>     agent_view = View(
>         Item('id', label='ID', style='readonly'),
>         Item('xcor', label='Xcor', style='readonly'),
>         Item('ycor', label='Ycor', style='readonly'),
>         Item('color', label='Color', style='readonly'),
>         Item('happy', label='Happy', style='readonly'),
>         Item('wants_similar', label='Wants Similar', style='readonly')
>         )
>
> where 'happy' is actually a Bool value. Everything is ok except from the fact that this is the final result:
>
>   
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
>
>
> is there a way to show a checked button in readonly style?
>
>   

In most cases, including that of a Bool, the 'readonly' style is the 
(Continue reading)

Picon

Re: How to set a Bool as readonly

nice hint!

thank you very much,
simone

Il giorno 02/gen/2010, alle ore 17.06, Warren Weckesser ha scritto:

> 
> simone gabbriellini wrote:
>> Hi list,
>> 
>> I have this readonly view:
>> 
>>    agent_view = View(
>>        Item('id', label='ID', style='readonly'),
>>        Item('xcor', label='Xcor', style='readonly'),
>>        Item('ycor', label='Ycor', style='readonly'),
>>        Item('color', label='Color', style='readonly'),
>>        Item('happy', label='Happy', style='readonly'),
>>        Item('wants_similar', label='Wants Similar', style='readonly')
>>        )
>> 
>> where 'happy' is actually a Bool value. Everything is ok except from the fact that this is the final result:
>> 
>> 
>> 
>> ------------------------------------------------------------------------
>> 
>> ------------------------------------------------------------------------
>> 
(Continue reading)

Brennan Williams | 2 Jan 22:38
Gravatar

Re: How to set a Bool as readonly

Warren Weckesser wrote:
> simone gabbriellini wrote:
>   
>> Hi list,
>>
>> I have this readonly view:
>>
>>     agent_view = View(
>>         Item('id', label='ID', style='readonly'),
>>         Item('xcor', label='Xcor', style='readonly'),
>>         Item('ycor', label='Ycor', style='readonly'),
>>         Item('color', label='Color', style='readonly'),
>>         Item('happy', label='Happy', style='readonly'),
>>         Item('wants_similar', label='Wants Similar', style='readonly')
>>         )
>>
>> where 'happy' is actually a Bool value. Everything is ok except from the fact that this is the final result:
>>
>>   
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>> is there a way to show a checked button in readonly style?
>>
>>   
>>     
(Continue reading)

robert somerville | 4 Jan 19:58
Picon
Gravatar

re Easy_install on Ubuntu9.10 /python 2.6 problems

hi;
I am trying to run latest easy_install on the above system , but i get the error message below ...

sudo easy_install  ETS --prefix=/usr

Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2562, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 626, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 524, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: setuptools==0.6c11

is there a fix for this ? , or are we supposed to use python 2.5 still ? I was under the assumption if I rebuilt from egg files the python2.6 problems would disappear that existed in the Ubuntu packages ?? What is the correct procedure to build a working 2.6 python enthought distribution ???

thanks;
Bob Somerville

_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
Robert Kern | 4 Jan 20:32
Gravatar

Re: re Easy_install on Ubuntu9.10 /python 2.6 problems

On Mon, Jan 4, 2010 at 12:58, robert somerville
<rbrt.somerville <at> gmail.com> wrote:
> hi;
> I am trying to run latest easy_install on the above system , but i get the
> error message below ...
>
> sudo easy_install  ETS --prefix=/usr
>
> Traceback (most recent call last):
>   File "/usr/bin/easy_install", line 5, in <module>
>     from pkg_resources import load_entry_point
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2562, in
> <module>
>     working_set.require(__requires__)
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 626, in
> require
>     needed = self.resolve(parse_requirements(requirements))
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 524, in
> resolve
>     raise DistributionNotFound(req)  # XXX put more info here
> pkg_resources.DistributionNotFound: setuptools==0.6c11
>
> is there a fix for this ? , or are we supposed to use python 2.5 still ? I
> was under the assumption if I rebuilt from egg files the python2.6 problems
> would disappear that existed in the Ubuntu packages ?? What is the correct
> procedure to build a working 2.6 python enthought distribution ???

It looks like you have a mismatch between the easy_install script and
the setuptools package itself. Did you try to upgrade setuptools
itself outside of dpkg?

--

-- 
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
Enthought-Dev <at> enthought.com
https://mail.enthought.com/mailman/listinfo/enthought-dev
Dave Peterson | 4 Jan 20:38

Re: re Easy_install on Ubuntu9.10 /python 2.6 problems

Robert Kern wrote:
On Mon, Jan 4, 2010 at 12:58, robert somerville <rbrt.somerville-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
hi; I am trying to run latest easy_install on the above system , but i get the error message below ... sudo easy_install  ETS --prefix=/usr Traceback (most recent call last):   File "/usr/bin/easy_install", line 5, in <module>     from pkg_resources import load_entry_point   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2562, in <module>     working_set.require(__requires__)   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 626, in require     needed = self.resolve(parse_requirements(requirements))   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 524, in resolve     raise DistributionNotFound(req)  # XXX put more info here pkg_resources.DistributionNotFound: setuptools==0.6c11 is there a fix for this ? , or are we supposed to use python 2.5 still ? I was under the assumption if I rebuilt from egg files the python2.6 problems would disappear that existed in the Ubuntu packages ?? What is the correct procedure to build a working 2.6 python enthought distribution ???
It looks like you have a mismatch between the easy_install script and the setuptools package itself. Did you try to upgrade setuptools itself outside of dpkg?

One hint I've frequently used to track issues like this down is to do "cat `which easy_install`".  The contents of the script frequently help in locating the expected location of the setuptools install in question.

-- Dave
_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
Stephen Waterbury | 4 Jan 20:56
Picon
Favicon

Re: re Easy_install on Ubuntu9.10 /python 2.6 problems

Dave Peterson wrote:
> One hint I've frequently used to track issues like this down is to do 
> "cat `which easy_install`".  The contents of the script frequently help 
> in locating the expected location of the setuptools install in question.

'which -a easy_install' or 'type -a easy_install' can also be useful --
they will output the paths of all 'easy_install' executables in your
path.  ('type' is a bash built-in command.)

Steve
fred | 5 Jan 16:43
Picon

[traits] File trait with a default dir...

Hi all,

Is it possible to open a file with File trait in a default dir?

I looked at the code, but unsuccessful :-(

PS: I don't want to use FileDialog, it does not fit my needs for my app.

TIA.

Cheers,

--

-- 
Fred
Boiteux, Benoit | 5 Jan 16:52
Picon
Favicon

GUI update

Hello,

 

As a new user on Enthought python module, I would like to do the following:

I create a use interface with a basic class like this:

class MainWindow(ApplicationWindow):

 

I implemented _create_contents method to fill the content of the window.

Ex (partial cut and paste):

# Create parent window

        window  = DockWindow( parent ).control

        self.window = window

       

        # Channel preferences view

        projconfview = self.proj.edit_traits(parent=self.window,view='traits_conf_view',kind='panel',scrollable=True)

        self.projconfview_control = DockControl( name      = 'Proj',

                                                 closeable = False,

                                                 control   = projconfview.control,

                                                 style     = 'horizontal' ))

       # Create Sizer

        sizer   = DockSizer( contents = [ self.projmeasview_control,])

        self.sizer = sizer

        self.window.SetSizer( sizer )

        self.window.SetAutoLayout( True )

        # return window content

        return window

 

proj is an instance of a class where I defined a view (traits_conf_view).

 

This code is working well, and the GUI is well displayed (Please note I have several DockControl in the sizer, I just copy one to reduce the mail)

 

Now, I want to update one control. I have a new instance of proj.

 

I did :

projconfview = self.proj.edit_traits(parent=self.window,view='traits_conf_view',kind='panel',scrollable=True)

                new = DockControl( name      = 'Proj',

                                                 closeable = False,

                                                 control   = projconfview.control,

                                                 style     = 'horizontal' )

                self.sizer.GetContents().replace_control(self.projconfview_control, new)

                self.projconfview_control = new

 

But it doesn’t work. I have display issues, like if the previous control was still there.

 

So my question (to summarize):

I create an instance of a class (that inherits from HasTraits), I create a view with edit_traits (mainly text boxes),

I add it in a sizer in a window. That works well.

I have a new instance of this class, I create a new view with edit_traits, how do we update the GUI ??

 

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
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane