# -*- coding: utf-8 -*-from kivy.app import Appfrom kivymd.label import MDLabelfrom kivymd.toolbar import Toolbarfrom kivymd.theming import ThemeManagerfrom kivymd.button import MDRaisedButtonfrom kivy.uix.boxlayout import BoxLayoutfrom kivymd.navigationdrawer import NavigationLayoutfrom kivymd.navigationdrawer import MDNavigationDrawer
class RootWidget(NavigationLayout): pass
class MainApp(App): theme_cls = ThemeManager()
def build(self): return RootWidget() if '__main__' == __name__: MainApp().run()<RootWidget>: id:mdnl MDNavigationDrawer: id:mdnd NavigationDrawerToolbar: title: "Navigation Drawer" NavigationDrawerIconButton: icon: 'checkbox-blank-circle' text: " you" on_release: app.root.ids.lbl.text = self.text NavigationDrawerIconButton: icon: 'checkbox-blank-circle' text: " me" on_release: app.root.ids.lbl.text = self.text NavigationDrawerIconButton: icon: 'checkbox-blank-circle' text: " them" on_release: app.root.ids.lbl.text = self.text NavigationDrawerIconButton: icon: 'checkbox-blank-circle' text: " us" on_release: app.root.ids.lbl.text = self.text NavigationDrawerIconButton: icon: 'checkbox-blank-circle' text: "go to screen 2" on_press: app.root.ids.sm.current = 's2' NavigationDrawerIconButton: icon: 'checkbox-blank-circle' text: "go to screen 1" on_press: app.root.ids.sm.current = 's1' BoxLayout: orientation: 'vertical' Toolbar: id: toolbar size_hint: 1, .2 title: 'Welcome' left_action_items: [['menu', lambda x: app.root.toggle_nav_drawer()]] ScreenManager: id:sm size_hint: 1, .8 Screen: name: 's1' MDLabel: theme_text_color: 'Secondary' halign: 'center' text: ' screen 1' Screen: name: 's2' MDLabel: theme_text_color: 'Secondary' halign: 'left' text: ' screen 2' MDRaisedButton: text: 'open/close' elevation_normal: 2 opposite_colors: True size_hint: 1, .25 on_press: app.root.toggle_nav_drawer() MDLabel: halign: 'left' size_hint: 1, .25 id:lbl
Have you tried moving it so it's the last widget (in RootWidget )and not the first?
--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/-R9VICxF7pk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
from kivy.app import App
from kivymd.label import MDLabel
from kivymd.toolbar import Toolbar
from kivymd.theming import ThemeManager
from kivymd.button import MDRaisedButton
from kivy.uix.boxlayout import BoxLayout
from kivymd.navigationdrawer import NavigationLayout
from kivymd.navigationdrawer import MDNavigationDrawer
from kivy.lang import Builder
# class RootWidget(NavigationLayout):
# pass
class MainApp(App):
theme_cls = ThemeManager()
def build(self):
main_widget = Builder.load_file("MainApp.kv")
return main_widget
if '__main__' == __name__:
MainApp().run()NavigationLayout:Yes, but it didn't work. All I got was a white, blank, window.
On Sun, Dec 3, 2017 at 1:22 PM, ZenCODE <zenkey....@gmail.com> wrote:
Have you tried moving it so it's the last widget (in RootWidget )and not the first?
--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/-R9VICxF7pk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to kivy-users+unsubscribe@googlegroups.com.