Exemple #1
0
def test_append():
    a = App()
    c = Combo(a, ["foo", "bar"])

    assert c.options == ["foo", "bar"]
    c.append("car")
    assert c.options == ["foo", "bar", "car"]

    a.destroy()
Exemple #2
0
def test_no_options():
    a = App()
    c = Combo(a)

    assert c.value == ""
    assert len(c.options) == 0

    c.append("foo")
    assert c.value == "foo"

    a.destroy()
from guizero import App, Combo


def selected(value):
    print(value)


app = App()
combo = Combo(app, ["Nothing", "Something", "Everything"],
              command=selected,
              selected="Something")
combo.remove("Something")
combo2 = Combo(app)
combo2.append("hi")
combo2.append("bye")
app.display()
Exemple #4
0
from guizero import App, Combo

def selected(value):
    print(value)

app = App()
combo = Combo(app, ["Nothing", "Something"], command = selected, selected="Something")
combo.append("Everything")
combo2 = Combo(app, ["hi", "bye"])
app.display()