Giter VIP home page Giter VIP logo

Comments (3)

lastrocer avatar lastrocer commented on May 29, 2024 2

Thank you very much. I am happy to see PysimpleGUI the company and the software keep getting stronger and better.

from pysimplegui.

jason990420 avatar jason990420 commented on May 29, 2024 1

There're lot of settings for a popup, but no default to "No" button.
Basically, you can build one by yourself if you need something special or different.

Example Code

import PySimpleGUI as sg

def popup_yes_no(text, title):
    layout = [
        [sg.Text(text)],
        [sg.Button("Yes"), sg.Button("No", bind_return_key=True)]
    ]
    window = sg.Window(title, layout, finalize=True)
    window["No"].set_focus()
    button, values = window.read(close=True)
    return button

popup_yes_no("Can you set the default button to No?",  title="YesNo")

image

from pysimplegui.

PySimpleGUI avatar PySimpleGUI commented on May 29, 2024 1

Thank you so very much for the encouragement @lastrocer .... we're trying ....

For your popup, I think Jason's got the right idea.

You can also use the custom_text parameter to popup and reverse the order to "No", "Yes". This will cause "No" to get focus... but there is a problem at the moment with focus in these popups so Jason's technique is the best.

from pysimplegui.

Related Issues (20)

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.