Icee
Icee

Reputation: 85

Kivy TabbedPanel cutoff

I am learning how to create GUIs in Python using the Kivy library. Currently stuck with a sizing issue.

I created a tabbed panel. However, it seems it gets cut off by the Windows top menu bar.

Is there a proper fix for this?

enter image description here

Upvotes: 0

Views: 101

Answers (1)

ikolim
ikolim

Reputation: 16031

The only difference between my example and yours is the __init__ method. Please refer to the example below for details.

Example

main.py

from kivy.app import App
from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelHeader
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout


class designTab(TabbedPanel):

    def __init__(self, **kwargs):
        super(designTab, self).__init__(**kwargs)
        # self.tab_height = "40dp"
        # self.tab_width = "100dp"
        self.default_tab_text = "DESIGNS"
        self.do_default_tab = False
        self.content = BoxLayout()

    def addTab(self, design):
        newTab = TabbedPanelHeader(text=design)
        newTab.content = Label(text="Design Stuff")
        self.add_widget(newTab)


class TestApp(App):

    def build(self):
        tabObj = designTab()
        tabObj.addTab("design1")
        tabObj.addTab("design2")
        return tabObj


if __name__ == "__main__":
    TestApp().run()

Output

enter image description here

Upvotes: 1

Related Questions