robotools / vanilla

A Pythonic wrapper around Cocoa.
MIT License
78 stars 28 forks source link

Tab inside another tab is glitched #183

Closed HugoJourdan closed 11 months ago

HugoJourdan commented 1 year ago

I'm back with another issue related to this one #172 The same problem happen when I use a tab inside another tab. First tab work as expected but the others are glitched exactly like in the previous issue.

typesupply commented 1 year ago

Can you make a demo?

HugoJourdan commented 1 year ago
from vanilla import *

class TabsDemo:

    def __init__(self):
        self.w = Window((250, 200))
        self.w.tabs = Tabs((10, 10, -10, -10), ["Tab One", "Tab Two"])
        tab1 = self.w.tabs[0]
        tab1.button = Button((50, 40, -50, 20), "A Button")
        tab1.text = TextBox((10, 10, -10, -10), "This is tab 1")
        tab2 = self.w.tabs[1]
        tab2.tab = Tabs((10, 10, -10, -10), ["SubTab One", "SubTab Two"])
        subtab2 = tab2.tab[0]
        subtab2.button = Button((50, 40, -50, 20), "A Button")
        subtab2 = tab2.tab[1]
        subtab2.button = Button((50, 40, -50, 20), "A Button")
        self.w.open()

TabsDemo()

if __name__ == "__main__":
    from vanilla.test.testTools import executeVanillaTest
    executeVanillaTest(TabsDemo)