pisaiah / ui

My UI Widget library for V
https://discord.gg/NruVtYBf5g
MIT License
97 stars 8 forks source link
cross-platform-gui gui linux mac ui ui-library v vlang vlang-library wasm widget widget-toolkit windows

Isaiah's UI

0.0.20 GitHub vlang

Isaiah's cross-platform GUI library for V. Inspired by the syntax of Java's Swing.

Example: (examples/demo/)

Example

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

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

More details about Layout: A Visual Guide to Layout Managers - docs.oracle.com

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

image

License

This project is licensed under MIT OR Boost.


Veasel (v mascot) on a Swing