Skip to content

Commit 3bc0822

Browse files
committed
feat(template): add simple application with wxpython
1 parent bb80c87 commit 3bc0822

File tree

12 files changed

+461
-2
lines changed

12 files changed

+461
-2
lines changed

template/images/app-icon.icns

70.8 KB
Binary file not shown.

template/images/app-icon.ico

176 KB
Binary file not shown.

template/images/app-icon.png

4.29 KB
Loading

template/pyproject.toml.jinja

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ classifiers = [
1414
"Programming Language :: Python :: 3",{% for i in python_version | version_list(['3.10', '3.11', '3.12', '3.13']) %}
1515
"Programming Language :: Python :: {{ i }}",{% endfor %}
1616
]
17-
dependencies = []
17+
dependencies = [
18+
"wxpython>=4.2.2",
19+
]
1820

1921
[project.urls]
2022
homepage = "https://github.com/{{ vcs_github_path }}"
@@ -35,4 +37,4 @@ dev = [
3537

3638
[build-system]
3739
requires = ["hatchling"]
38-
build-backend = "hatchling.build"
40+
build-backend = "hatchling.build"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from {{ project_package }}.app import App
2+
3+
4+
def main():
5+
app = App()
6+
app.run()
7+
8+
9+
if __name__ == '__main__':
10+
main()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import wx
2+
3+
from .forms.main_form import MainForm
4+
5+
6+
class App(wx.App):
7+
main_form: MainForm
8+
9+
def __init__(self):
10+
super().__init__(useBestVisual=True)
11+
12+
self.main_form = MainForm(None)
13+
14+
def run(self):
15+
self.main_form.Show(True)
16+
self.main_form.Centre()
17+
18+
self.MainLoop()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
templates.py

template/src/{{project_package}}/forms/__init__.py

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from .templates import MainFormTemplate
2+
from ..res.images import app_icon
3+
4+
5+
class MainForm(MainFormTemplate):
6+
def __init__(self, parent):
7+
super().__init__(parent)
8+
9+
self.SetIcon(app_icon.GetIcon())

template/src/{{project_package}}/res/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)