I'm designing a security camera program. Right now, I am just trying to set up the GUI before receiving. I am using Kivy since, in the future, I plan on designing some programs for Android. I really like Python, and I figured I'd start learning Kivy.
My question is: am I building the GUI structure correctly?
The layout I have planned is for the core container to have a
BoxLayout that will hold three containers:
- The first container is on the left and will hold buttons to perform various commands.
- The second container will be in the center and will hold all the video feeds.
- The third container will be on the right and its purpose is still being considered.
import kivy from kivy.config import Config Config.set('graphics', 'fullscreen', 'auto') from kivy.app import App from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.anchorlayout import AnchorLayout class camMonitor(BoxLayout): def __init__(self, **kwargs): super(camMonitor, self).__init__(**kwargs) self.add_widget(controlInterface()) class controlInterface(BoxLayout): def __init__(self, **kwargs): super(controlInterface, self).__init__(**kwargs) button1 = Button(text='action 1', size =(50,30), size_hint=(None,None)) self.add_widget(button1) class camMonApp(App): def build(self): return camMonitor() if __name__ == '__main__': camMonApp().run()
For each container, I have created a separate class. Not every class will be a box layout; that's just what I have it set to at the moment.
Should I continue building the GUI the way it is now, or should everything be put into one class?