Skip to content

Commit c2f5fba

Browse files
committed
Added a README
1 parent 9a3deaf commit c2f5fba

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ __pycache__
33

44
*.egg-info
55
env
6+
.aider*

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
GUI_Builder
2+
=======================
3+
4+
The GUI_builder library is a powerful tool for creating graphical user interfaces (GUIs) in Python with a declarative and clean syntax. It is built on top of wxPython, a cross-platform GUI toolkit for the Python language. GUI_builder simplifies the process of designing and implementing complex user interfaces by allowing developers to define the structure and behavior of a GUI in a high-level, readable format.
5+
6+
Features
7+
--------
8+
- Declarative syntax: Define your GUI layout and behavior in a structured and readable way.
9+
- Reusable components: Create custom reusable GUI components for consistent and maintainable code.
10+
- Event handling: Easily bind events to widget actions with clear callback definitions.
11+
- Data binding: Synchronize your GUI with your application's data model seamlessly.
12+
13+
Installation
14+
------------
15+
To install the library, you can use pip:
16+
17+
```bash
18+
pip install gui_builder
19+
```
20+
21+
Getting Started
22+
---------------
23+
Here's a simple example of how to create a basic window with a button:
24+
25+
```python
26+
import wx
27+
from gui_builder import fields, forms
28+
29+
class MyFrame(forms.Frame):
30+
output = fields.Text(multiline=True, readonly=True, min_size=(300, 100))
31+
button = fields.Button(label="Click Me!")
32+
33+
@button
34+
def click_me(self, event):
35+
self.output.append("Button clicked!\n")
36+
37+
app = wx.App()
38+
frame = MyFrame()
39+
frame.display()
40+
app.MainLoop()
41+
```
42+
43+
In the example above, we define a frame with a single button. When the button is clicked, it prints a message to the console. This is just a glimpse of what you can do with GUI_builder. The library supports a wide range of widgets and allows for complex layouts and interactions.
44+
45+
Documentation
46+
-------------
47+
For more detailed documentation, including a full list of available widgets and their properties, please refer to the `docs` directory in this repository.
48+
49+
License
50+
-------
51+
This library is released under the MIT License. See the `LICENSE.txt` file for more details.

examples/test_nested.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66

77
class CheckBoxes(forms.Panel):
8-
def do_something_fun(self):
9-
# put some code here to be called when the checkbox is checked
10-
pass
8+
@fields.CheckBox(label="Frob!", default_value=True)
9+
def frob(self, event):
10+
# Code to be called when the checkbox is checked
11+
print("Frob checkbox is now:", event.IsChecked())
1112

12-
frob = fields.CheckBox(label="Frob!", default_value=True, callback=do_something_fun)
1313
tob = fields.CheckBox(
1414
label="Tob!", default_value=True
1515
) # this checkbox doesn't do anything special when it's clicked.

0 commit comments

Comments
 (0)