2

Typical popup:

sg.Popup("This is a simple popup")

This will show an "Ok" button with my text which I don't want. How can I remove this button?

Yogesh Aggarwal
  • 1,071
  • 2
  • 12
  • 30

2 Answers2

2

You should be calling popup_no_buttons rather than changing the button_type parameter. The documentation states that it's not meant to be used by users.

import PySimpleGUI as sg

sg.popup_no_buttons('This is a popup without buttons')

If you do use it, it's recommended you use the "enum" values for that parameter so that if the numbering changes your code will continue to function. That value is sg.POPUP_BUTTONS_NO_BUTTONS

Mike from PSG
  • 5,312
  • 21
  • 39
1

Just provide the button_type argument like this:

sg.Popup("This is a simple popup", button_type=5)

In PySimpleGUI there are 5 types of button configurations:

Yes, No: 1
Cancel: 2
Error: 3
Ok, cancel: 4
No button: 5
Yogesh Aggarwal
  • 1,071
  • 2
  • 12
  • 30