hiding a window

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

hiding a window

Brad Buran
Is it possible to hide a GUI window temporarily?  For example, if I wanted to implement the following mockup:

class MainHandler(Handler):

    def do_edit_signal(self, info):
        dlg = SignalEditDialog(signal=info.object.signal)
        # insert code to "hide" the UI so only the popup is shown
        if dlg.edit_traits().result:
            # code to process result from dialog
        # code to make the main UI visible again

The specific use case we need this for is an experiment "launcher".  We present a master window showing the list of subjects and the possible experiments that can be run on each subject.  The user selects a subject and clicks on the button/action pertaining to the appropriate experiment.  This button fires an action that creates a window to run the appropriate experiment.  We would like to hide the master window during the time the experiment is running in the new window to minimize the clutter on the screen.  Is hiding the main window possible?  Is there a better approach I'm not thinking of?

Thanks
Brad

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

Re: hiding a window

bryce hendrix-2
Brad Buran wrote:
Is it possible to hide a GUI window temporarily?  For example, if I wanted to implement the following mockup:

class MainHandler(Handler):

    def do_edit_signal(self, info):
        dlg = SignalEditDialog(signal=info.object.signal)
        # insert code to "hide" the UI so only the popup is shown
        if dlg.edit_traits().result:
            # code to process result from dialog
        # code to make the main UI visible again

The specific use case we need this for is an experiment "launcher".  We present a master window showing the list of subjects and the possible experiments that can be run on each subject.  The user selects a subject and clicks on the button/action pertaining to the appropriate experiment.  This button fires an action that creates a window to run the appropriate experiment.  We would like to hide the master window during the time the experiment is running in the new window to minimize the clutter on the screen.  Is hiding the main window possible?  Is there a better approach I'm not thinking of?

Try toggling visibility of info.ui.control. To do this in wx call info.ui.control.Show(True) or info.ui.control.Show(False). As for alternatives, depending on the UI's event loop, it might make sense to open the new window in a separate process, but how you're doing it now is probably fine.

Bryce

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

Re: hiding a window

Brad Buran
Or in the case of Qt, it turns out to be info.ui.control.setVisible(False)... just an FYI if others come across this thread.

Thanks!
Brad

On Fri, Mar 19, 2010 at 12:10 PM, bryce hendrix <[hidden email]> wrote:
Brad Buran wrote:
Is it possible to hide a GUI window temporarily?  For example, if I wanted to implement the following mockup:

class MainHandler(Handler):

    def do_edit_signal(self, info):
        dlg = SignalEditDialog(signal=info.object.signal)
        # insert code to "hide" the UI so only the popup is shown
        if dlg.edit_traits().result:
            # code to process result from dialog
        # code to make the main UI visible again

The specific use case we need this for is an experiment "launcher".  We present a master window showing the list of subjects and the possible experiments that can be run on each subject.  The user selects a subject and clicks on the button/action pertaining to the appropriate experiment.  This button fires an action that creates a window to run the appropriate experiment.  We would like to hide the master window during the time the experiment is running in the new window to minimize the clutter on the screen.  Is hiding the main window possible?  Is there a better approach I'm not thinking of?

Try toggling visibility of info.ui.control. To do this in wx call info.ui.control.Show(True) or info.ui.control.Show(False). As for alternatives, depending on the UI's event loop, it might make sense to open the new window in a separate process, but how you're doing it now is probably fine.

Bryce

_______________________________________________
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