Python Forum
How add button to certain TAB using TAB-index
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How add button to certain TAB using TAB-index
#4
Thanks Deanhystad and Menator01.

It was just an example to put out 5 buttons on each tabs. In the end, I do not know how many buttons I will have on each TABS. I have a button array that I loop out the buttons from and info from the array so I want to be able to control which TAB it should end up on.

Deanhystad, that's how I wanted it to work. Just added tabControl.add (frame, text = name) :)

When I could have the TABS in an array i probably had solved it with % instead. Have not tested, but something like this to avoid a lot of IF and ELIF.
for i in range(1, 21):
    if (i % 5 == 0):
        t += 1
    buttons[i] = Button(tabs[ t ], text = "Button " + i ).place(x=i*100, y=i*100)
Thanks agin both. :)
Reply


Messages In This Thread
RE: How add button to certain TAB using TAB-index - by MacTommu - Sep-23-2021, 05:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,120 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020