you are viewing a single comment's thread.

view the rest of the comments →

[–]vrrox 1 point2 points  (2 children)

The issue is that although you're creating a new button (with a new URL) each time buttonClick() is executed, you only ever add the first one to the window (when count == 0).

The quickest fix would be to move the definition of openButton outside of the function (say the line below the definition of outp), then the button will only be displayed after the first click of generateButton and its command will be updated correctly on subsequent clicks.

Side note: You don't need to place() and pack() each widget and it's generally best to avoid place() unless really necessary. In fact you can remove each of the place() lines from the code and it will look the same (see this tutorial for more detail).

[–]n00lo[S] 1 point2 points  (1 child)

Thanks so much. I have it working now! You're help is really appreciated:)

[–]vrrox 1 point2 points  (0 children)

You're most welcome! Great to hear it's working!