0

I don't know How structure the GUI of my program...

I don't have big experience with GUI programming, i know all the widgets, the geometry managers, the "object-oriented" method in Tkinter, but i don't understand how combine all this things...

I want to create a program with an image in background where there is a button and if i press this button i switch in another page and the button disappears

Like this : https://moqups.com/iampirla@gmail.com/wyM7CyET/p:a80e8d902

How i can structure my code to do this?

iampirla
  • 35
  • 1
  • 1
  • 11
  • What's your question? – Kevin Nov 25 '15 at 14:55
  • edited... does it have any sense now? – iampirla Nov 25 '15 at 15:03
  • What have you tried so far? If you want your main window to open another one you should try using the Toplevel class (check for example this tutorial http://www.tutorialspoint.com/python/tk_toplevel.htm) – toti08 Nov 25 '15 at 15:26
  • Does the following answer help? It doesn't address the background image, but it addresses switching between "pages" http://stackoverflow.com/a/7557028/7432 – Bryan Oakley Nov 25 '15 at 15:45
  • thank you bryan!!! only one question... In the code which you have sent, in the line : " for F in (StartPage, PageOne, PageTwo): frame = F(container, self)" why in "frame=F(container,self)" container is the first argument and self the second? – iampirla Nov 25 '15 at 17:03
  • @iampirla: because `container` is the parent widget (Frame) into which the new page should go. `controller` is a reference to an object that can be used from any page to open any other page. – Bryan Oakley Nov 25 '15 at 17:56
  • yes i've seen... you are a genius!!! – iampirla Nov 25 '15 at 19:13
  • why you name self with controller? – iampirla Nov 25 '15 at 19:14

1 Answers1

0

You could use pack_forget() this removes the widget although allows you to use it later if you wish. You could do the first page and then use some code like below. To clear the page. This could then reference the next thing you wish to do using in this example question().

def answred():
    nameLabel.pack_forget()
    nameEntry.pack_forget()
    nameButton.pack_forget()
    classQuestion.pack_forget()
    button1.pack_forget()
    button2.pack_forget()
    button3.pack_forget()
    question()

You could this but not remove the background widgets

FenixZ
  • 3
  • 1
  • 6