TabbedPanel.switch_to() does not appear to work
See original GitHub issueHi,
first of all I would like to congratulate on the great work that kivy is, keep it up!! I really hope that it will grow further and become the natural choise for python and gui’s.
Using the code below, when the code has run, “tab1” is not selected. I’m running windows portable installation Kivy-1.9.0-py3.4-win32-x64 and have w8.1 It works fine to select the tab manually. Maybe .switch_to is not meant to make the tab active, but at least I would assume that this is what it does. I also made some smaller attempts to see if I could make it selected/active with some of the other methods in TabbedPanel, but could not get it to work.
I decided to skip the “default_tab” (which by the way is preselected also on my computer), since I did not want different ways to assign the tabs.
Is this a bug, or can I get the tab selected another way (not using default tab)?
from kivy.app import App
from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelHeader
class mainw(TabbedPanel):
def __init__(self, **kwargs):
super(mainw, self).__init__(**kwargs)
self.do_default_tab = False
self.tab_width = 150
# create the tabs
tab1 = TabbedPanelHeader(text='tab1')
self.add_widget(tab1)
tab2 = TabbedPanelHeader(text='tab2')
self.add_widget(tab2)
self.switch_to(tab1) # does not work and also does not throw error...
class tbpApp(App):
def build(self):
return mainw()
if __name__ == '__main__':
tbpApp().run()
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
How would we know this by reading the documentation? And why close this? It’s still broken for some indeterminate time after you’ve initialized it, and there’s no way to tell when it’s “not broken”.
@ahed87 this is one way:
If you have further questions, visit our support channels: https://github.com/kivy/kivy#support.