Hello I am trying to use the .place() Tkinter method on a guizero pushbutton object. With Tkinter the code would look like
vidbutton = tk.Button(w, text="Video", command = connectgp)
vidbutton.place(relheight=0.176, relwidth=0.176, relx=0.02, rely=0.02)
shutterbutton = tk.Button(w, text="Shutter", command = connectgp)
shutterbutton.place(relheight=0.176, relwidth=0.176, relx=0.196, rely=0.02)
When executed the above code will show two buttons placed next to each other with the correct ratio of spacing, I am trying to implement this using guizero instead with the following code
connectbutton = PushButton(app, text="Connect Gopros", command=connect)
connectbutton.tk.place(relheight=0.176, relwidth=0.176, relx=0.02, rely=0.02)
videobutton = PushButton(app, text="Video", command=video)
videobutton.tk.place(relheight=0.176, relwidth=0.176, relx=0.196, rely=0.02)
For the guizero code only the last button made will display with the correct placement and the .place()
is completely ignored for the previous guizero objects.
Very confused and advice would help.
You need to put the Buttons Widget inside a Box Widget as its parent, you can get more details by following up with guizero layout guidance here: https://lawsie.github.io/guizero/layout/#boxes especially the alignment and location.
Based on what I tried, your code can give the same result of the standard tk if you made this adjustment:
The Layout will be like this based on your OS: