kopia lustrzana https://github.com/peterhinch/micropython-micro-gui
README changes to Menu section.
rodzic
b7df9c99fe
commit
a9b0e90968
11
README.md
11
README.md
|
@ -2107,6 +2107,8 @@ value changes. This enables dynamic color change.
|
||||||
|
|
||||||
# 22 Menu class
|
# 22 Menu class
|
||||||
|
|
||||||
|
The `Menu` class is under development. API may change.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from gui.widgets.menu import Menu
|
from gui.widgets.menu import Menu
|
||||||
```
|
```
|
||||||
|
@ -2122,10 +2124,10 @@ Constructor mandatory positional arg:
|
||||||
|
|
||||||
Keyword only args:
|
Keyword only args:
|
||||||
* `height=25` Height of top level menu buttons.
|
* `height=25` Height of top level menu buttons.
|
||||||
* `bgcolor=None`
|
* `bgcolor=None` Background color of buttons and dropdown.
|
||||||
* `fgcolor=None`
|
* `fgcolor=None` Foreground color.
|
||||||
* `textcolor=None`
|
* `textcolor=None` Text color.
|
||||||
* `select_color=DARKBLUE`
|
* `select_color=DARKBLUE` Background color of selected item on dropdown list.
|
||||||
* `args` This should be a tuple containing a tuple of args for each entry in
|
* `args` This should be a tuple containing a tuple of args for each entry in
|
||||||
the top level menu. Each tuple should be of one of two forms:
|
the top level menu. Each tuple should be of one of two forms:
|
||||||
1. `(text, cb, (args,))` A single-level entry: the top level `Button` with
|
1. `(text, cb, (args,))` A single-level entry: the top level `Button` with
|
||||||
|
@ -2145,6 +2147,7 @@ uses the passed arg to determine which menu it was called from.
|
||||||
mnu = (('Gas', cb_sm, (0,), ('Helium','Neon','Argon','Krypton','Xenon','Radon')),
|
mnu = (('Gas', cb_sm, (0,), ('Helium','Neon','Argon','Krypton','Xenon','Radon')),
|
||||||
('Metal', cb_sm, (1,), ('Lithium', 'Sodium', 'Potassium','Rubidium','Caesium')),
|
('Metal', cb_sm, (1,), ('Lithium', 'Sodium', 'Potassium','Rubidium','Caesium')),
|
||||||
('View', cb, (2,)))
|
('View', cb, (2,)))
|
||||||
|
Menu(wri, bgcolor=BLUE, textcolor=WHITE, args = mnu)
|
||||||
```
|
```
|
||||||
|
|
||||||
###### [Contents](./README.md#0-contents)
|
###### [Contents](./README.md#0-contents)
|
||||||
|
|
|
@ -51,4 +51,4 @@ sel = Pin(16, Pin.IN, Pin.PULL_UP) # Operate current control
|
||||||
prev = Pin(18, Pin.IN, Pin.PULL_UP) # Move to previous control
|
prev = Pin(18, Pin.IN, Pin.PULL_UP) # Move to previous control
|
||||||
increase = Pin(20, Pin.IN, Pin.PULL_UP) # Increase control's value
|
increase = Pin(20, Pin.IN, Pin.PULL_UP) # Increase control's value
|
||||||
decrease = Pin(17, Pin.IN, Pin.PULL_UP) # Decrease control's value
|
decrease = Pin(17, Pin.IN, Pin.PULL_UP) # Decrease control's value
|
||||||
display = Display(ssd, nxt, sel, prev, increase, decrease) #, 5)
|
display = Display(ssd, nxt, sel, prev, increase, decrease) #, 5)
|
||||||
|
|
Ładowanie…
Reference in New Issue