Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pisaiah/ui
My UI Widget library for V
https://github.com/pisaiah/ui
cross-platform-gui gui linux mac ui ui-library v vlang vlang-library wasm widget widget-toolkit windows
Last synced: 29 days ago
JSON representation
My UI Widget library for V
- Host: GitHub
- URL: https://github.com/pisaiah/ui
- Owner: pisaiah
- License: mit
- Created: 2021-12-09T15:10:01.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-30T05:36:11.000Z (about 1 month ago)
- Last Synced: 2024-10-30T08:37:46.855Z (about 1 month ago)
- Topics: cross-platform-gui, gui, linux, mac, ui, ui-library, v, vlang, vlang-library, wasm, widget, widget-toolkit, windows
- Language: V
- Homepage: https://discord.gg/NruVtYBf5g
- Size: 5.61 MB
- Stars: 97
- Watchers: 7
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-electron-alternatives - ui - platform GUI library for V. Inspired by the syntax of Java's Swing. (👓 Alternatives to the [Electron.js](https://electronjs.org) ⚛ / V)
README
#
![0.0.20](https://img.shields.io/badge/version-0.0.20-white?style=flat)
![GitHub](https://img.shields.io/badge/license-MIT-blue?style=flat)
![vlang](http://img.shields.io/badge/V-0.4.2-%236d8fc5?style=flat)Isaiah's cross-platform GUI library for V. Inspired by the syntax of Java's Swing.
Example: *([examples/demo/](examples/demo/demo.v))*
## Example
```v
fn main() {
mut window := ui.Window.new(
title: 'My App'
width: 640
height: 480
)// Create Button
mut btn := ui.Button.new(text: 'My Button')
btn.subscribe_event('mouse_up', on_click_event)// Add Button to Window & Run
window.add_child(btn)
window.gg.run()
}fn on_click_event(mut e ui.MouseEvent) {
println('Button clicked!')
}
```## Install
Install via VPM:```
v install https://github.com/pisaiah/ui
```
then
```v
import iui as ui
```## Components, Containers, & Layouts
| Components | Containers | Panel Layouts |
| ----------- | ---------- | ------------- |
| Button | Window | Flow Layout |
| Label | Panel | Border Layout |
| Panel | Tabbox | Box Layout |
| Textbox | HBox | Grid Layout |
| TextField | VBox | |
| Menubar | Modal | |
| MenuItem | Page | |
| Checkbox | ButtonGroup | |
| Selectbox | ScrollView | |
| Treeview | Splitview | |
| ProgressBar | TitleGroup | |
| Hyperlink | Popup | |
| Image | | |
| Slider | | |
| Switch | | |- Components are the elements of the UI (buttons, inputs, etc).
- Containers are components that can hold other components (known as children).
- Layouts define how the panel positions it's children.More details about Layout: [A Visual Guide to Layout Managers - docs.oracle.com](https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html)
## Themes
Light:
- Default, Minty, Ocean, Seven.
Dark:
- Dark, Black (with White, Red, & Green accent colors), Seven Dark.## Included Examples
NotepadCalculatorBorderLayout DemoClockInternal Frames
See: Notepad
Calculator
Border Layout Demo
Clock
Internal Frames
Mines(Tic Tac Toe)^2Snake
1-Minesweeper
2-Tic-Tac-Toe-Squared
3-Snake
## Used in
- [Vide](https://github.com/pisaiah/vide)
- [Verminal](https://github.com/pisaiah/verminal)
- [vPaint](https://github.com/pisaiah/vpaint) - Demo: [https://vpaint.app](https://vpaint.app)![image](https://user-images.githubusercontent.com/16439221/200155263-493d09e2-46d7-4319-b230-679dc1386326.png)
## License
This project is licensed under MIT OR Boost.
Veasel *(v mascot)* on a Swing