← スキル一覧に戻る

create-gui-component
by Row0902
⭐ 0🍴 0📅 2026年1月21日
SKILL.md
name: Create GUI Component description: Standards for creating decoupled wxPython components (Panels, Dialogs).
🖥️ GUI Component Creation Skill
Context
wxPython code must be clean, decoupled from logic, and use sizers for layout.
1. Standard Panel Structure
Always inherit from wx.Panel. never put business logic directly here. Use EventBus to talk to services.
import wx
from src.core.events import EventBus, EventType
class MyFeaturePanel(wx.Panel):
def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
self._init_ui()
self._bind_events()
def _init_ui(self):
# Master Sizer
main_sizer = wx.BoxSizer(wx.VERTICAL)
# Components
self.btn_action = wx.Button(self, label="Do Item")
# Layout
main_sizer.Add(self.btn_action, 0, wx.ALL | wx.EXPAND, 5)
self.SetSizer(main_sizer)
def _bind_events(self):
self.btn_action.Bind(wx.EVT_BUTTON, self._on_action)
def _on_action(self, event):
# Delegate to Event Bus - DO NOT call Service directly
EventBus().publish(EventType.USER_ACTION, {"action": "do_item"})
2. Dialog Standard
Use wx.Dialog with standard buttons.
class MyDialog(wx.Dialog):
def __init__(self, parent, title="My Dialog"):
super().__init__(parent, title=title)
self._init_ui()
def _init_ui(self):
sizer = wx.BoxSizer(wx.VERTICAL)
# Content
self.text_input = wx.TextCtrl(self)
sizer.Add(self.text_input, 0, wx.EXPAND | wx.ALL, 10)
# Buttons
btns = self.CreateButtonSizer(wx.OK | wx.CANCEL)
sizer.Add(btns, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(sizer)
3. Checklist
- No logic in
_on_eventmethods? (Publish events instead). - Used
BoxSizerorGridBagSizer? (No absolute positioning). - All user-visible strings in English?
スコア
総合スコア
35/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です