https://github.com/lpogic/white_gold
TGUI based Ruby gem for quick native application developing
https://github.com/lpogic/white_gold
dsl gui ruby
Last synced: over 1 year ago
JSON representation
TGUI based Ruby gem for quick native application developing
- Host: GitHub
- URL: https://github.com/lpogic/white_gold
- Owner: lpogic
- Created: 2023-08-03T14:37:03.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-30T20:47:56.000Z (about 2 years ago)
- Last Synced: 2025-03-04T23:06:15.652Z (over 1 year ago)
- Topics: dsl, gui, ruby
- Language: Ruby
- Homepage:
- Size: 28.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
white_gold - TGUI based Ruby gem for quick native application developing
===
Ruby gem for building pure ruby graphical user interface.
Uses [TGUI](https://tgui.eu/) & [SFML](https://www.sfml-dev.org/) as a backend.
Dedicated to creating simple applications and learning programming.
### 1. Taste
```RUBY
require 'white_gold'
title! "Greeting app"
text_size! 30
label! text: "Enter your name:", position: [100, 150], size: [340, 44]
@name = editbox! position: [375, 146], size: [280, 44]
button! text: "Then press the button", position: [200, 250] do
on_press! do
text = @name.text
text = "world" if text.strip.empty?
gui.messagebox! text: "Hello #{text}!", position: :center do
button! text: "Close", on_press: proc{ window.close }
end
end
end
```
### Output:

Check out [sample](https://github.com/lpogic/white_gold/tree/master/sample) for more.
Requirements
---
- Ruby >= 3.2.2
- Fiddle >= 1.1.1
Binaries for Windows and Linux are bundled with the gem.
Installation
---
1) From official
```
gem install white_gold
```
2) From source
```
git clone https://github.com/lpogic/white_gold
cd white_gold
gem build white_gold.gemspec
gem install white_gold-0.1.0.gem
```
### 2. Basic usage
```RUBY
require 'white_gold'
button! text: "Exit", position: :center, on_press: proc.exit
def exit
window.close
end
```
### 3. Advanced usage
```RUBY
require 'white_gold/master'
class FirstPage < Page
def build
button! text: "Second Page", position: :center, on_press: proc{ go SecondPage }
end
end
class SecondPage < Page
def build
button! text: "Exit", position: :center, on_press: proc.exit
end
def exit
window.close
end
end
WhiteGold.new.run FirstPage
```
Check out [documentation](https://github.com/lpogic/white_gold/tree/master/doc/wiki) for more info.
Status
---
A hobby project.
Authors
---
- Łukasz Pomietło (oficjalnyadreslukasza@gmail.com)