Kivy Screen Changing -


OK guys, I have a problem, I want to click on a button on the popup and then click on the popup It should transcise another screen .... here my code just wants to get a new fresh screen when I click on the popup button kivy.app Import from app popup from kivy .uix.gridlayout Import from kivy.uix.label import from kivy.uix.textinput Import label by kivy.uix.button Import button from TextInput ki vy.uix.boxlayout import box from # kivy.uix.stacklayout from stackLayout kivy from import.in screenmanager import screenmanager, screen class login screen (grid layout, screen): def __init __ (self, sm, ** kwargs): Super (login screen, self) .__ init__ (** kwargs) self.sm = sm self.cols = 2 self.row = 2 self.add_widget (label (text = 'user name', font_size = '20sp') ) self.username = TextInput (multiline = False) self.add_widget (self.username) self.add_widget (label (text = 'password')) self.password = TextIn (password = true, multiline = folose) self.ad_visit ( Self. Password) Self.add_widget (self.hello) def save (self). Hello = Button (text = "hello", onpress@lambdaA: self defense (), size = (100, 100), size_hint = (0.3, 0.3) ): Print ("s") id_name = self.username._get_text () id_num = self.password._get_text () if id_name == "Hendricko" and id_num == "stokkies123": content = button (text = "press here Popup = popup (title = "you may proceed", content = content, size = (50, 50), size_hent = (0.3, 0.3), size = (100, 100) , Auto_discism = false) content.bind (on_press = lambda b: self.check_menu_press) popup.open () def check_man _press (self, button, * args): if buttons.txt == 'normal': self.sm.current = "secondscreen" class seconds (grid layout, screen): def __init __ (self, sm, ** kwargs) : Super (secondscreen, self) .__ init __ (** kwargs) self.row = 2 self.cols = 2 self.add_widget (label (text = "hello", font_size = "20sp")) self.sm = sm def on_touch_down (auto, touch): self.sm. Current = "login screen" class My AP (creation of DEF): Def (self): SM = ScreenManager () sm.add_widget (login screen (SM, name = "secondscrin")) sm.add_widget (seconds screen (SI, name = "Login screen")) Return to ST if __name__ == '__main__': MyApp () Run ()

content .bind (on_press = lambda b: self. check_menu_press)

This lambda function does nothing. You probably mean content.bind (on_press = lambda b: self.check_menu_press (b)) . I think it would be neater to use functools.partial , however, if you want to work in this way.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -