DavinE
Nov 01, 2020 - 17:48
Hello Guys,
I have a Question..
Is it Possible to remove an set_menu Setting form Button ?
and after that to use the Button.action Function
heres an example Code:
import ui, console
from anchors import dock, attach, size_to_fit
from ui3.menu import set_menu, Action
root = ui.View(bg_color='#3664a8')
def button3(sender):
console.hud_alert('Working', 'success', 1.0)
def newButton3(sender, action):
console.hud_alert('not Working', 'error', 1.0)
def clearbutton3(sender):
newButton3.removed = True
button3 = size_to_fit(ui.Button(
title='Button 3',
background_color='white',
tint_color='black',
action=button3,
))
button4 = size_to_fit(ui.Button(
title='clear Button 3',
background_color='white',
tint_color='black',
action=clearbutton3,
))
dock(button3).top_center(root)
attach(button4).below(button3)
newButton3 = Action(
'Settings etc...', newButton3
)
set_menu(button3, [
newButton3,
])
root.present('fullscreen')
Thanks for Reply