Python - Kivy, Have I Structured this wrong? -
at moment have 1 floatlayout in sheditormain, inside class sheditormain i've declared bunch of widgets (buttons, popups, labels, etc..) , used self.add_widget add them.
now want create new window opens inside/over floatlayout , can't seem works. examples i've seen far regarding multiple windows either using app main class creation of widgets inside layouts. suggestions or have restructure code?
class sheditormain(floatlayout): def __init__(self, **kwargs): super(sheditormain, self).__init__(**kwargs)as self.add_widget(blabla) self.add_widget(blabla) self.add_widget(blabla) self.add_widget(blabla) self.dbconnection = dbconnection() #declare popups etc def functionevents(self, instance): yaddayadda def functionevents(self, instance): yaddayadda def functionevents(self, instance): yaddayadda class sheditor(app): def build(self): self.root = sheditormain() return self.root
please read this answer multiple "windows" , why may not desired. can recommend have kivy window maximized , using modalview pseudo-form can dragged , has button close it. more control on everything, cleaner code, beginner friendly. create custom widget inherits modalview , you.
you can place modals wherever want them - popup source code in repo how positions set. you'll end custom popup can control without crippling original widget.
another way may use screenmanager(or pagelayout, carousel, xyz other widgets) provide mobile-/presentation-like view. sooner kv language, sooner you'll have less troubles imagine stuff out of pocket e.g. see fancy app, can open kivy-designer or more control/less fancy go kivycatalog , type see that's how straightforward kvlang is.
example modals:(old attempt create windows-like... via kivy = floatlayout scatter(only drag enabled) "windows")
which leads me conclusion if think need multiple windows or another window nice whatever reason not sure if it'd work or - don't , overcomplicating things, steal attention important parts of code ui.
(ps, i'd edit answer mentioned @ top, in question user has little bit more complicated problem)
Comments
Post a Comment