Esempio n. 1
0
def deger():
    def highlight():
        text_box.bg = "lightblue"

    def lowlight():
        text_box.bg = "white"

    app = App()
    text_box = TextBox(app)

    # When the mouse enters the TextBox
    text_box.when_mouse_enters = highlight
    # When the mouse leaves the TextBox
    text_box.when_mouse_leaves = lowlight

    def do_this():
        print(text_box.value)

    text_box.when_key_pressed = do_this

    app.display()
Esempio n. 2
0
from guizero import App, TextBox, PushButton, Text, info

app = App()


def btn_go_clicked():
    info("Greetings",
         "Hello, " + txt_name.value + " - I hope you're having a nice day")


def highlight():
    txt_name.bg = "light blue"


def lowlight():
    txt_name.bg = None


lbl_name = Text(app, text="Hello. What's your name?")
txt_name = TextBox(app)

# when the mouse enters the button
txt_name.when_mouse_enters = highlight

# when the mouse leaves the button
txt_name.when_mouse_leaves = lowlight

btn_go = PushButton(app, command=btn_go_clicked, text="Done")

app.display()
Esempio n. 3
0

app = App()
text = Text(app, text="events")
slider = Slider(app)
text_box = TextBox(app)
check = CheckBox(app, "check")
waffle = Waffle(app)

# when clicked
text.when_clicked = intro

# when key pressed
text_box.when_key_pressed = key_pressed

# highlight widget when move over
check.when_mouse_enters = mouse_enters
check.when_mouse_leaves = mouse_leaves
slider.when_mouse_enters = mouse_enters
slider.when_mouse_leaves = mouse_leaves
text_box.when_mouse_enters = mouse_enters
text_box.when_mouse_leaves = mouse_leaves
waffle.when_mouse_enters = mouse_enters
waffle.when_mouse_leaves = mouse_leaves

# right button pressed and released
waffle.when_right_button_pressed = right_pressed
waffle.when_right_button_released = right_released

app.display()
Esempio n. 4
0
    txt_model_path = Text(app, text="Model_Path:", grid=[1, 6], align="left")
    txt_model_path.text_size = style.parameter_Size
    txt_model_path.text_color = style.parameter_Color
    tbx_model_path = TextBox(app, grid=[2, 6], align="left", width=30)
    txt_model_path.when_mouse_enters = tbx_model_path_ex
    txt_model_path.when_mouse_leaves = not_show__ex

    txt_raw_data_path = Text(app,
                             text="Raw_data_Path:",
                             grid=[1, 7],
                             align="left")
    txt_raw_data_path.text_size = style.parameter_Size
    txt_raw_data_path.text_color = style.parameter_Color
    tbx_raw_data_path = TextBox(app, grid=[2, 7], align="left", width=30)
    tbx_raw_data_path.when_mouse_enters = txt_raw_data_path_ex

    txt_filtered_data_path = Text(app,
                                  align="left",
                                  text="filtered_data_path:",
                                  grid=[1, 8])
    txt_filtered_data_path.text_size = style.parameter_Size
    txt_filtered_data_path.text_color = style.parameter_Color
    tbx_filtered_data_path = TextBox(app, align="left", grid=[2, 8], width=30)
    tbx_filtered_data_path.when_mouse_enters = txt_filtered_data_path_ex

    txt_from_raw_data = Text(app,
                             text="from_raw_data:",
                             align="left",
                             grid=[1, 9])
    txt_from_raw_data.text_size = style.parameter_Size
Esempio n. 5
0
                         align="right")

editor = TextBox(app, multiline=True, height="fill", width="fill")

preferences_controls = Box(app, align="bottom", width="fill", border=True)
font = Combo(preferences_controls,
             options=[
                 "courier", "times new roman", "verdana", "calibri",
                 "algerian", "arial", "broadway", "impact", "ravie",
                 "rockwell", "arial black", "monospace", ""
             ],
             align="left",
             command=change_font)
size = Slider(preferences_controls,
              align="left",
              start=11,
              end=150,
              command=change_text_size)
font_color = Combo(
    preferences_controls,
    options=['pink', 'red', 'orange', 'green', 'black', 'yellow'],
    align='left',
    command=change_color)
editor.when_mouse_enters = highlight

editor.when_mouse_leaves = lowlight

editor.color = font_color

app.display()
Esempio n. 6
0
from guizero import App, TextBox

def highlight():
    text_box.bg = "lightblue"

def lowlight():
    text_box.bg = "white"

app = App()
text_box = TextBox(app)

# When the mouse enters the TextBox
text_box.when_mouse_enters = highlight
# When the mouse leaves the TextBox
text_box.when_mouse_leaves = lowlight

app.display()