Coder Social home page Coder Social logo

lv_python's Introduction

lv_python

A Python library based on LVGL. I haven't worked on this project in several months, but I plan to return to it eventually.

Preview

from lvgl.widgets.app import App
from lvgl.widgets.button import Button
from lvgl.widgets.keyboard import Keyboard
from lvgl.widgets.text_area import TextArea
from lvgl.widgets.tabview import TabView


class Main(App):

    display_driver = 'gtkdrv'
    width = 1024
    height = 768
    title = 'Shaper'

    def build_auto_tab(self, tab):
        tab.layout = 'grid'
        with tab:
            TextArea(cursor_hidden=True)
            Button(label='start', align_type='in_bottom_left')

    def build_edit_tab(self, tab):
        tab.scrollbar_mode = 'off'
        with tab:
            editor = TextArea(align_type='in_top_left', width=int(tab.width * .8), height=tab.height // 2)
            load_button = Button(label='Load', align_to=editor, align_type='out_right_top', align_x=50)
            Button(label='Save', align_to=load_button, align_type='out_bottom_left')
            keyboard = Keyboard(textarea=editor)

    def build_jog_tab(self, tab):
        tab.layout = 'grid'
        with tab:
            Button(label='-', height=tab.height, width=tab.width // 3)
            Button(label='+', align_type='in_top_right', height=tab.height, width=tab.width // 3)

    def build(self):
        self.window.layout = 'grid'
        main = TabView(tabs=['Auto','Edit', 'Jog', 'Offset'])
        self.build_auto_tab(main.tabs['Auto'])
        self.build_edit_tab(main.tabs['Edit'])
        self.build_jog_tab(main.tabs['Jog'])

Main(input_device_path='/dev/input/event21', input_device_symbol='bullet').run()

lv_python's People

Contributors

leonwilly avatar gabewillen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.