0

I'd like to know how to open a new window after clicking a button on current window.

I tried creating a list of objects of gtk.Window()

It gave me indexing error.

1
  • Create a new gtk.Window and make sure you store the reference somewhere in order to prevent its deletion by the garbage collector. For the specific problem with your list, please post your code. Commented Mar 17, 2015 at 17:05

1 Answer 1

2

Well, I'm just at the beginning of working in pygtk too.

But, if you have other gtk.Window() in other file you have to do is like this:

btn.connect("clicked", self.onbtn1_clicked) #this is to connect to a function

Then you create a function like:

def onbtn1_clicked(self, widget):
       from yourscritp import classgtkwindow
       var1 = classgtkwindow()
       var1.show()

PS: Sorry for my bad English

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.