Python Forum
PysimpleGUI - listbox with list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PysimpleGUI - listbox with list
#1
Hello everyone,

I'm after a listbox which will display the contents of a list - eg

id = [1,2,3,4,5]

the listbox would look like:

_______
1
2
3
4
5_____

Thanks,
James
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply
#2
import PySimpleGUI as psg

nums = range(1, 11)

layout = [
[psg.Listbox(values=nums, size=(30, 10))]
]

win = psg.Window('Some Text', layout,).read()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#3
You are an absolute legend.

Thank you so much.

Cheers,
Jamie
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] listbox constantly being added to the list. speedev 4 2,419 Jun-08-2021, 08:16 PM
Last Post: speedev
  [Tkinter] list box select event triggers when selecting another listbox Roshan 1 4,368 May-09-2021, 08:27 AM
Last Post: Yoriz
  [PySimpleGUI]How to insert values that were gotten from FilesBrowse into ListBox? trigchen 0 2,876 Dec-30-2019, 06:58 AM
Last Post: trigchen
  [PySimpleGUI] update listbox not working zappfinger 2 12,088 Nov-12-2018, 08:33 PM
Last Post: zappfinger
  How to format a list when displaying in a tkinter Listbox nortski 3 9,603 Apr-03-2018, 02:31 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020