PySimpleGUI icon indicating copy to clipboard operation
PySimpleGUI copied to clipboard

[Question] Column not scrollable within a Pane

Open gfcwfzkm opened this issue 4 years ago • 1 comments

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]

  • [x] Searched main docs for your problem www.PySimpleGUI.org
  • [x] 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)
  • [x] Run your program outside of your debugger (from a command line)
  • [x] Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • [x] 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

gfcwfzkm avatar Feb 14 '22 13:02 gfcwfzkm

I didn't use the sg.Pane in any of my GUI, so not sure what it for, also anything wrong.

Line 14200 in source code of PySimpleGUI 4.57.0, it is clear that no TkScrollableFrame or TkFixedFrame used, or it replace original settings for sg.Column.

                for pane in element.PaneList:
                    pane.Widget = pane.TKColFrame = tk.Frame(element.PanedWindow)

It looks like some of options in sg.Column not work under sg.Pane, like

  • scrollable
  • vertical_scroll_only
  • size
  • right_click_menu
  • maybe more options, not confirmed.

jason990420 avatar Feb 15 '22 10:02 jason990420