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.