How do I randomly add buttons to a typewriter GUI? I need to be able to make a button, then put it anywhere on the window, is it possible? I'm using Python 2.6 on Windows.
If you want a random button placement (or nothing grid, etc.), you can use Depending on the platform, the overlapping buttons can not behave as you expect, however, you can avoid them.
Here is a simple example: Random Random = TC () frame = frame (root, height = 200, width = 200) from random import to Tkinter import * from
For the category I (10): Button (frame, text = str (i)). Place (x = random () * 150, y = Random () * 180) frame.pack () root.manLoop ()
Comments
Post a Comment