Change Window content

Asked by Kalsan

I'm a beginner in advanced programming, new to quickly and I only have basic programming skills, for example with SDL, but no GTK etc. So far, I learned how to add dialogue boxes to a quickly application. Now, I'd like to completely switch the window contents. E.G. when the user clicks a button, the vbox with 12 buttons, a label and a picture disappears and another one with a selector list and a text entry appears. This is not a dialogue box, as it is displayed in the main window. Is there a command like quickly add screen or do I have to proceed differently? Thanks for any idea how to get to my goal.

Question information

Language:
English Edit question
Status:
Answered
For:
Quickly Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Rick Spencer (rick-rickspencer3) said :
#1

Hi Kaslan,

The way I would solve this problem, is that I would derive a class for Gtk.VBox that implements the GUI that you want. Then I would have the window remove (or hide) it's current children, and pack (or show) a instance of the class I created.

For example, MediaPlayerBox is a subclass of VBox:
http://bazaar.launchpad.net/~quickly-committers/quidgets/trunk/view/head:/quickly/widgets/media_player_box.py

You could imagine in your window saying:

        self.ui.vbox1.hide():
            self.mpb = MediaPlayerBox()
            self.mpb.show()
            self.add(mpb)

This is a simple example, I think it's more likely that you'll be keeping vbox1 around and hiding/removing, and packing/showing within it.

HTH

Cheers, Rick

Can you help with this problem?

Provide an answer of your own, or ask Kalsan for more information if necessary.

To post a message you must log in.