Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature request] Grid / Table layout helper or function

オープン
#99 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
desktop

調査の方向性

Start by reviewing the existing nested-list layout behavior and the sg.Column API described in the issue, then compare them with the supplied GridLayout helper. Define how empty cells and consistent dimensions should work, and confirm that the proposed integration has clear tests or examples showing the resulting grid layout.

索引モデルが issue の本文から書いたものです。

説明

I'd love something like sg.GridLayout(layout) or sg.TableLayout(layout) analogous to sg.Column(layout). An easy way to arrange elements in a grid.

This is already sort of the default when creating a layout as a nested list of rows where members are placed horizontally in each row, however currently there is no common delineation between those points in the default layout. This should definitely stay that way as it's a sensible way to handle things. Often though we might want elements to stack neatly on top of each with the same dimensions for a clean and readable layout.

This is the default look when layouting with the nested list:
Image

This is the resulting look when wrapping the elements in a grid layout helper:
Image

I'd love to discuss the possibilities for this. I've written a small helper function that can achieve this by itself, but any integration into the codebase will necessarily have to look different. If it would be useful to have though, I'll include that helper here:

def GridLayout(layout):
    column_layout = []
    columns_num = len(max(layout, key=len))
    for i in range(columns_num):
        column_list = []
        for row_list in layout:
            if i < len(row_list):
                value = row_list[i]
                if value == None: # This allows empty cells.
                    column_list.append([sg.Text("")])
                else:
                    column_list.append([value])
            else:
                column_list.append([sg.Text("")])
        column_layout.append(sg.Column(column_list))
    return column_layout

Using None is the option I went with to allow leaving cells in the grid structure empty. As I'm pretty new with FreeSimpleGUI, I made empty cells happen with empty text elements, but a proper integration could surely do better.

I've been very pleased with FreeSimpleGUI so far, so if there's interest in this and I could get some guidance on how to best integrate something like this, I'd be happy to give it a shot myself when I find time. Any thoughts would be appreciated.

主要言語
Python
スター
867
フォーク
106
平均マージ
1分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spyoungtech/FreeSimpleGUI のほかの issue

spyoungtech/FreeSimpleGUI の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。