Coder Social home page Coder Social logo

micropython-mgui's Introduction

micropython-mgui

Easy to port micropython micro gui library, based on micropython framebufmodule

Prepare

Make sure you are using python3.8 and higher

pip install -r .\requirements.txt

If your micropython version is not match with mpy_cross version, you may need to build your own mpy-cross tools. Follow the offical guide to build it. Then, modify .mpypack.conf and config your mpy-cross path.

For details about mpypack, see mpypack: A simple tool to pack up MicroPython code

Build

Modify .mpypack.conf, Then run build.py

Install

Using Script

Modify .mpypack.conf, Then run

build.py flash

Manually Install

Copy ./dist/mgui/ folder to one of your import path. You can check your import path using: print(sys.path).

e.g. import path are ['', '/lib']:
>root
|--->lib
|   |--->mgui     <--- put it there
|       |---:__init__.mpy
|       |---...
|---:boot.py
|---:main.py
|---...

Useage

The Class

  • MGuiView is the base class. Any view extends this class.
    • examples in mgui_component.py
  • MGuiLayout is layout base class. Any view that has children should extends this class.
    • examples in mgui_layout.py
  • MGuiRoot is the MGUI root class. This class handle the loop, context, and start passing an event.
  • MGuiScreen is the abstract screen class. Used by MGuiRoot to refresh screen.

Event System

The event passed from parent to children. if any children return True, then the event stop passing.

micropython-mgui's People

Contributors

dreagonmon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

watrt

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.