Closed PySimpleGUI closed 1 year ago
I just pushed a commit with both of your suggestions. Also added two text-to-code models (code-davinci-002 and code-cushman-001) able to generate JS snippets.
Thank you for your input, nice touch.
What I meant previously, by two buttons to one key. Is to have "Answer" in OpenAI tab and "Create image" in Dall-E, bind to the Return keyboard key but execute different functions respectively inside the tabs.
[sg.Button("Answer", bind_return_key=True)
[sg.Button("Create image", bind_return_key=True)
Working in Tkinter:
active_tab = ["OpenAI", "Dall-E"]
def handle_return(event):
global active_tab
if active_tab == 'OpenAI':
Answer.invoke()
elif active_tab == 'Dall-E':
Create_image.invoke()
root.bind('<Return>', handle_return)
I would look for which element has focus when the return key was pressed. That's the important part. Rather than bothering with binding return key in the button, just bind to the window and see who has focus when it's pressed.
I saw this comment:
Which makes me think maybe you made a custom icon.
Here's a base64 encoded version of OpenAI's logo:
If added to the window creation:
Then the program's titlebar looks like this on my PC:![image](https://user-images.githubusercontent.com/46163555/214711958-badd4f2d-7d0d-42fd-b883-8bb1a678fa9f.png)
And it looks like this in the taskbar:
You can use the program psgresizer to convert from any format into a Base64 encoded PNG file that can then be pasted into your PySimpleGUI code directly like the line of code above.