robotools / vanilla

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

MacOS Ventura and vanilla.Tabs #172

Closed HugoJourdan closed 1 year ago

HugoJourdan commented 2 years ago

vanilla.Tabs are not working correctly on the latest mac OS Ventura. All tabs except the first one, are bugged. See with this example :

from vanilla import Window, Tabs, TextBox, Button

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.button = Button((50, 40, -50, 20), "A Button")
        tab2.text = TextBox((10, 10, -10, -10), "This is tab 2")
        self.w.open()

TabsDemo().
typesupply commented 1 year ago

I can confirm this and will work on it. Thanks for the great test case!

For my own reference when I pick this up: switch to a NSTabViewController model.

typesupply commented 1 year ago

This should be closed now. Thanks @HugoJourdan!

HugoJourdan commented 1 year ago

It seems to not be fixed. I forgot to mention that it happened when opening UI with :

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

Here is full code :

from vanilla import Window, Tabs, TextBox, Button

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.button = Button((50, 40, -50, 20), "A Button")
        tab2.text = TextBox((10, 10, -10, -10), "This is tab 2")
        self.w.open()

if __name__ == "__main__":
    from vanilla.test.testTools import executeVanillaTest
    executeVanillaTest(TabsDemo)
typemytype commented 1 year ago

what is your OS? I cannot reproduce this on ventura

HugoJourdan commented 1 year ago

Mac OS Ventura 13.1 (22C65)

HugoJourdan commented 1 year ago

I tried to update to last Ventura version 13.2.1 (22D68). But the issue persists.

Screenshot 2023-02-24 at 17 58 01

typemytype commented 1 year ago

that change is not yet available on the pip version.. there has not been a release since

try with pip install git+https://github.com/robotools/vanilla to get the latest from the main branch

HugoJourdan commented 1 year ago

Oh ! I didn't notice it. It's fixed, thanks.

schriftgestalt commented 7 months ago

I just updated the vanilla that ships for Glyphs and now I get problems with TabViews. I narrowed it down to 1498332 .

I suspect this line: https://github.com/robotools/vanilla/blob/0881768372fdf774210b2111b381e8ce240c8274/Lib/vanilla/vanillaTabs.py#L53