Skip to content

[Question] Column not scrollable within a Pane #5196

@gfcwfzkm

Description

@gfcwfzkm

Type of Issue: Question

Column not scrollable within a pane?

Operating System

Windows 11

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

Python version: 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)]

PySimpleGUI Version (sg.__version__)

PySimpleGUI version: 4.56.0

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

tkinter version: 8.6.12


Your Experience In Months or Years (optional)

Years Python programming experience
Close to 2 Months
Years Programming experience overall
11 years VB.NET, 7 years C
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
No
Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

I am trying to get the items within a column to expand in the x-Axis. Naturally I decided to add the Column within a Pane, only to notice that the scrollable feature of the column vanishes once it is inside the pane. Is there a way to force a scrollable column within a pane?

Code To Duplicate

import PySimpleGUI as sg	# pip install pysimplegui

right_list = [[sg.Button(f'Test Stuff {val}', expand_x=True)] for val in range(40)]

left_list = [[sg.Button(f'Test Stuff {val}', expand_x=True)] for val in range(40)]

layout = [[
	sg.Column(left_list, expand_x=True, justification='c', scrollable=True, vertical_scroll_only=True),
	sg.Pane([
		sg.Column(right_list, expand_x=True, justification='c', scrollable=True, vertical_scroll_only=True)],
	orientation='h', relief=sg.RELIEF_SUNKEN, key='-P-')
]]

window = sg.Window('Indexing Options', layout, border_depth=0, modal=True, finalize=True, size=(600, 600))
window['-P-'].expand(True, True, True)
	
while True:
	event, values = window.read()
	print(event, values)
	if event == sg.WIN_CLOSED:
		break

window.close()

Screenshot, Sketch, or Drawing

Screenshot 2022-02-14 141238

As you can see on the image, the left side is a plain column that is nicely scrollable, except with the Buttons within there not streching to the X-Axis.
Using the Column inside a Pane seems to allow the Buttons to strech to the X-Axis, but it also removes the scrolling feature of the column sadly.


Watcha Makin?

Hehe, same as the last time, working on a custom Image Converter for my little image file format for embedded systems. I'm tacking the custom indexed colors option, where I will need to be able to list up to 256 different colors, so a scrollable column seemed logical then to me.
tool_screenshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething's not rightPort - TKPySimpleGUI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions