glimmer-dsl-swt 4.17.10.4 → 4.18.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +83 -56
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +51 -30
- data/lib/glimmer-dsl-swt.rb +1 -0
- data/lib/glimmer/swt/image_proxy.rb +11 -10
- data/lib/glimmer/swt/layout_proxy.rb +7 -3
- data/lib/glimmer/swt/menu_proxy.rb +9 -5
- data/lib/glimmer/swt/sash_form_proxy.rb +1 -1
- data/lib/glimmer/swt/style_constantizable.rb +8 -4
- data/lib/glimmer/swt/widget_proxy.rb +69 -23
- data/samples/elaborate/login.rb +10 -13
- data/samples/elaborate/meta_sample.rb +77 -19
- data/samples/hello/hello_browser.rb +2 -0
- data/samples/hello/hello_button.rb +46 -0
- data/samples/hello/hello_computed.rb +9 -3
- data/samples/hello/hello_link.rb +80 -0
- data/samples/hello/hello_list_multi_selection.rb +22 -17
- data/samples/hello/hello_list_single_selection.rb +5 -5
- data/samples/hello/hello_menu_bar.rb +184 -28
- data/samples/hello/hello_message_box.rb +9 -8
- data/samples/hello/hello_pop_up_context_menu.rb +33 -6
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
- metadata +54 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50e5a8d642ce0d66a1451ab28c2029388aa1b38f2e930b01259ac5a09fa528a6
|
4
|
+
data.tar.gz: 280f7949f24aa626a97658fd0eaff2715bdc5538d4ab2220b08375050653adf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95a750f50e8564ba0adbfe955234323b329f3760c72c8853dadb9b160444428794e91d78484c182efd4615fe806e2de711d21fbf81824c72cc1a9625d93a5bbe
|
7
|
+
data.tar.gz: '069fda16d1b6d399b35f11c7d32e68f3b3749e3cab7d79aef9a52b4583e885ebf55a53beeb68c66bcc47b27ce31f7d325189f8b24c8189d1da0e5fc2a2321903'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.18.0.0
|
4
|
+
|
5
|
+
- Upgrade to SWT v4.18
|
6
|
+
- Upgrade to JRuby v9.2.14.0
|
7
|
+
- Apply all WidgetProxy property converters upon normal setting of properties too (not just in DSL) (like `some_widget.background = color_symbol`)
|
8
|
+
- Update Hello, Menu Bar! sample to show accelerators on menu items
|
9
|
+
- Have the `swt` keyword (SWTProxy) support accepting a string character (to build an accelerator style)
|
10
|
+
- Make accelerator property accept symbols and character directly (without swt)
|
11
|
+
- Write meta-sample changes to user directory to avoid permission issues
|
12
|
+
- Zero margin_left, margin_right, margin_top, margin_bottom in layouts given that margin_width and margin_height are set by default
|
13
|
+
- Prevent editing/launching meta-sample from Glimmer Meta-Sample
|
14
|
+
- Fix enablement on `menu` (as opposed to menu_item, where it works)
|
15
|
+
- Fix issue relating to background image scaling on resize of widget
|
16
|
+
|
17
|
+
### 4.17.10.8
|
18
|
+
|
19
|
+
- Support editing sample code in the Glimmer Meta-Sample to enable experimentation and learning
|
20
|
+
- Add a "Reset" button to the Glimmer Meta-Sample to allow resetting sample code changes
|
21
|
+
- Refactor/revise hello_message_box.rb and hello_pop_up_context_menu.rb samples
|
22
|
+
- Upgrade to glimmer 1.0.6
|
23
|
+
|
24
|
+
### 4.17.10.7
|
25
|
+
|
26
|
+
- Loosened dependencies on most Glimmer author-owned gems
|
27
|
+
- Refactored/Simplified/Fixed Hello, Link! Sample
|
28
|
+
|
29
|
+
### 4.17.10.6
|
30
|
+
|
31
|
+
- Hello, Link! Sample
|
32
|
+
- Refactor hello list samples
|
33
|
+
|
34
|
+
### 4.17.10.5
|
35
|
+
|
36
|
+
- Hello, Button! Sample
|
37
|
+
|
3
38
|
### 4.17.10.4
|
4
39
|
|
5
40
|
- Do not select first row in a table by default (keep unselected)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.18.0.0
|
2
2
|
|
3
3
|
## JRuby Desktop Development GUI Framework
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT.
|
19
19
|
|
20
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) versions 4.
|
20
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) versions 4.18.x.y come with [SWT 4.18](https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/), which was released on December 2, 2020.
|
21
21
|
|
22
22
|
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
23
23
|
Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do)
|
@@ -33,7 +33,7 @@ Glimmer DSL gems:
|
|
33
33
|
|
34
34
|
### Hello, World!
|
35
35
|
|
36
|
-
Glimmer code (from [samples/hello/hello_world.rb](
|
36
|
+
Glimmer code (from [samples/hello/hello_world.rb](samples/hello/hello_world.rb)):
|
37
37
|
```ruby
|
38
38
|
include Glimmer
|
39
39
|
|
@@ -57,12 +57,10 @@ Glimmer app:
|
|
57
57
|
|
58
58
|
### Tic Tac Toe
|
59
59
|
|
60
|
-
Glimmer code (from [samples/elaborate/tic_tac_toe.rb](
|
60
|
+
Glimmer code (from [samples/elaborate/tic_tac_toe.rb](samples/elaborate/tic_tac_toe.rb)):
|
61
61
|
|
62
62
|
```ruby
|
63
63
|
# ...
|
64
|
-
@tic_tac_toe_board = Board.new
|
65
|
-
|
66
64
|
@shell = shell {
|
67
65
|
text "Tic-Tac-Toe"
|
68
66
|
minimum_size 150, 178
|
@@ -83,11 +81,6 @@ Glimmer code (from [samples/elaborate/tic_tac_toe.rb](https://github.com/AndyObt
|
|
83
81
|
}
|
84
82
|
}
|
85
83
|
}
|
86
|
-
|
87
|
-
observe(@tic_tac_toe_board, :game_status) { |game_status|
|
88
|
-
display_win_message if game_status == Board::WIN
|
89
|
-
display_draw_message if game_status == Board::DRAW
|
90
|
-
}
|
91
84
|
# ...
|
92
85
|
```
|
93
86
|
|
@@ -103,7 +96,7 @@ Glimmer app:
|
|
103
96
|
|
104
97
|
### Contact Manager
|
105
98
|
|
106
|
-
Glimmer code (from [samples/elaborate/contact_manager.rb](
|
99
|
+
Glimmer code (from [samples/elaborate/contact_manager.rb](samples/elaborate/contact_manager.rb)):
|
107
100
|
|
108
101
|
```ruby
|
109
102
|
# ...
|
@@ -361,6 +354,8 @@ Glimmer App:
|
|
361
354
|
- [Hello, Date Time!](#hello-date-time)
|
362
355
|
- [Hello, Spinner!](#hello-spinner)
|
363
356
|
- [Hello, Table!](#hello-table)
|
357
|
+
- [Hello, Button!](#hello-button)
|
358
|
+
- [Hello, Link!](#hello-link)
|
364
359
|
- [Elaborate Samples](#elaborate-samples)
|
365
360
|
- [User Profile](#user-profile)
|
366
361
|
- [Login](#login)
|
@@ -421,13 +416,13 @@ https://www.eclipse.org/swt/faq.php
|
|
421
416
|
## Pre-requisites
|
422
417
|
|
423
418
|
- JDK 8u241 (1.8.0_241) (find at https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html)
|
424
|
-
- JRuby 9.2.
|
425
|
-
- SWT 4.
|
419
|
+
- JRuby 9.2.14.0 (supporting Ruby 2.5.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux or find at [https://www.jruby.org/download](https://www.jruby.org/download) for Windows)
|
420
|
+
- SWT 4.18 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem)
|
426
421
|
|
427
422
|
To obtain JRuby through [RVM](http://rvm.io), you may run:
|
428
423
|
|
429
424
|
```bash
|
430
|
-
rvm install jruby-9.2.
|
425
|
+
rvm install jruby-9.2.14.0
|
431
426
|
```
|
432
427
|
|
433
428
|
Glimmer might still work on other versions of Java, JRuby and SWT, but there are no guarantees, so it is best to stick to the pre-requisites outlined above.
|
@@ -454,7 +449,7 @@ jgem install glimmer-dsl-swt
|
|
454
449
|
|
455
450
|
Or this command if you want a specific version:
|
456
451
|
```
|
457
|
-
jgem install glimmer-dsl-swt -v 4.
|
452
|
+
jgem install glimmer-dsl-swt -v 4.18.0.0
|
458
453
|
|
459
454
|
```
|
460
455
|
|
@@ -473,7 +468,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
473
468
|
|
474
469
|
Add the following to `Gemfile`:
|
475
470
|
```
|
476
|
-
gem 'glimmer-dsl-swt', '~> 4.
|
471
|
+
gem 'glimmer-dsl-swt', '~> 4.18.0.0'
|
477
472
|
```
|
478
473
|
|
479
474
|
And, then run:
|
@@ -531,7 +526,7 @@ bin/glimmer samples
|
|
531
526
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
532
527
|
|
533
528
|
```
|
534
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.
|
529
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.0.0
|
535
530
|
|
536
531
|
|
537
532
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
@@ -709,7 +704,7 @@ glimmer bin/greeter
|
|
709
704
|
|
710
705
|
#### Desktopify
|
711
706
|
|
712
|
-
|
707
|
+
Desktopify basically turns a website into a desktop application by wrapping the website within a [Browser Widget](#browser-widget).
|
713
708
|
|
714
709
|
The desktopify app is similar to the standard scaffolded app. It can be extended and the [browser may even be instrumented](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html).
|
715
710
|
|
@@ -1008,8 +1003,8 @@ Output:
|
|
1008
1003
|
Name Gem Version Author Description
|
1009
1004
|
|
1010
1005
|
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1011
|
-
Opal glimmer-dsl-opal 0.
|
1012
|
-
Swt glimmer-dsl-swt 4.
|
1006
|
+
Opal glimmer-dsl-opal 0.8.0 AndyMaleh Glimmer DSL for Opal
|
1007
|
+
Swt glimmer-dsl-swt 4.18.0.0
|
1013
1008
|
AndyMaleh Glimmer DSL for SWT
|
1014
1009
|
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1015
1010
|
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
@@ -3291,10 +3286,8 @@ Glimmer Meta-Sample Code Example:
|
|
3291
3286
|
|
3292
3287
|
```ruby
|
3293
3288
|
# ...
|
3294
|
-
code_text {
|
3295
|
-
text bind(SampleDirectory, 'selected_sample.content')
|
3296
|
-
editable false
|
3297
|
-
caret nil
|
3289
|
+
@code_text = code_text {
|
3290
|
+
text bind(SampleDirectory, 'selected_sample.content', read_only: true)
|
3298
3291
|
}
|
3299
3292
|
# ...
|
3300
3293
|
```
|
@@ -3630,7 +3623,7 @@ https://www.eclipse.org/nebula/
|
|
3630
3623
|
|
3631
3624
|
## Samples
|
3632
3625
|
|
3633
|
-
Check the [samples](samples) directory in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer` gem first and then use the `glimmer` command to run it (alternatively, you may clone the repo, follow [CONTRIBUTING.md](CONTRIBUTING.md) instructions, and run samples locally with development glimmer command: `bin/glimmer`).
|
3626
|
+
Check the [samples](samples) directory in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer` gem first and then use the `glimmer samples` command to run it (alternatively, you may clone the repo, follow [CONTRIBUTING.md](CONTRIBUTING.md) instructions, and run samples locally with development glimmer command: `bin/glimmer`).
|
3634
3627
|
|
3635
3628
|
You may run any sample via this command:
|
3636
3629
|
|
@@ -3642,6 +3635,8 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](samples/elabora
|
|
3642
3635
|
|
3643
3636
|
![Glimmer Meta-Sample](images/glimmer-meta-sample.png)
|
3644
3637
|
|
3638
|
+
You may edit the code of any sample before launching it by clicking on the "Launch" button. This helps you learn by experimenting with Glimmer GUI DSL syntax. To go back to original code, simply hit the "Reset" button.
|
3639
|
+
|
3645
3640
|
### Hello Samples
|
3646
3641
|
|
3647
3642
|
For hello-type simple samples, check the following.
|
@@ -3650,7 +3645,7 @@ For hello-type simple samples, check the following.
|
|
3650
3645
|
|
3651
3646
|
Code:
|
3652
3647
|
|
3653
|
-
[samples/hello/hello_world.rb](
|
3648
|
+
[samples/hello/hello_world.rb](samples/hello/hello_world.rb)
|
3654
3649
|
|
3655
3650
|
![Hello World](images/glimmer-hello-world.png)
|
3656
3651
|
|
@@ -3658,7 +3653,7 @@ Code:
|
|
3658
3653
|
|
3659
3654
|
Code:
|
3660
3655
|
|
3661
|
-
[samples/hello/hello_tab.rb](
|
3656
|
+
[samples/hello/hello_tab.rb](samples/hello/hello_tab.rb)
|
3662
3657
|
|
3663
3658
|
![Hello Tab English](images/glimmer-hello-tab-english.png)
|
3664
3659
|
![Hello Tab French](images/glimmer-hello-tab-french.png)
|
@@ -3669,7 +3664,7 @@ This sample demonstrates combo data-binding.
|
|
3669
3664
|
|
3670
3665
|
Code:
|
3671
3666
|
|
3672
|
-
[samples/hello/hello_combo.rb](
|
3667
|
+
[samples/hello/hello_combo.rb](samples/hello/hello_combo.rb)
|
3673
3668
|
|
3674
3669
|
![Hello Combo](images/glimmer-hello-combo.png)
|
3675
3670
|
![Hello Combo Expanded](images/glimmer-hello-combo-expanded.png)
|
@@ -3680,7 +3675,7 @@ This sample demonstrates list single-selection data-binding.
|
|
3680
3675
|
|
3681
3676
|
Code:
|
3682
3677
|
|
3683
|
-
[samples/hello/hello_list_single_selection.rb](
|
3678
|
+
[samples/hello/hello_list_single_selection.rb](samples/hello/hello_list_single_selection.rb)
|
3684
3679
|
|
3685
3680
|
![Hello List Single Selection](images/glimmer-hello-list-single-selection.png)
|
3686
3681
|
|
@@ -3690,7 +3685,7 @@ This sample demonstrates list multi-selection data-binding.
|
|
3690
3685
|
|
3691
3686
|
Code:
|
3692
3687
|
|
3693
|
-
[samples/hello/hello_list_multi_selection.rb](
|
3688
|
+
[samples/hello/hello_list_multi_selection.rb](samples/hello/hello_list_multi_selection.rb)
|
3694
3689
|
|
3695
3690
|
![Hello List Multi Selection](images/glimmer-hello-list-multi-selection.png)
|
3696
3691
|
|
@@ -3700,7 +3695,7 @@ This sample demonstrates computed data-binding.
|
|
3700
3695
|
|
3701
3696
|
Code:
|
3702
3697
|
|
3703
|
-
[samples/hello/hello_computed.rb](
|
3698
|
+
[samples/hello/hello_computed.rb](samples/hello/hello_computed.rb)
|
3704
3699
|
|
3705
3700
|
![Hello Browser](images/glimmer-hello-computed.png)
|
3706
3701
|
|
@@ -3710,7 +3705,7 @@ This sample demonstrates a `message_box` dialog.
|
|
3710
3705
|
|
3711
3706
|
Code:
|
3712
3707
|
|
3713
|
-
[samples/hello/hello_message_box.rb](
|
3708
|
+
[samples/hello/hello_message_box.rb](samples/hello/hello_message_box.rb)
|
3714
3709
|
|
3715
3710
|
![Hello Message Box](images/glimmer-hello-message-box.png)
|
3716
3711
|
![Hello Message Box Dialog](images/glimmer-hello-message-box-dialog.png)
|
@@ -3721,7 +3716,7 @@ This sample demonstrates the `browser` widget.
|
|
3721
3716
|
|
3722
3717
|
Code:
|
3723
3718
|
|
3724
|
-
[samples/hello/hello_browser.rb](
|
3719
|
+
[samples/hello/hello_browser.rb](samples/hello/hello_browser.rb)
|
3725
3720
|
|
3726
3721
|
![Hello Browser](images/glimmer-hello-browser.png)
|
3727
3722
|
|
@@ -3731,7 +3726,7 @@ This sample demonstrates drag and drop in Glimmer.
|
|
3731
3726
|
|
3732
3727
|
Code:
|
3733
3728
|
|
3734
|
-
[samples/hello/hello_drag_and_drop.rb](
|
3729
|
+
[samples/hello/hello_drag_and_drop.rb](samples/hello/hello_drag_and_drop.rb)
|
3735
3730
|
|
3736
3731
|
![Hello Drag and Drop](images/glimmer-hello-drag-and-drop.gif)
|
3737
3732
|
|
@@ -3741,7 +3736,7 @@ This sample demonstrates menus in Glimmer.
|
|
3741
3736
|
|
3742
3737
|
Code:
|
3743
3738
|
|
3744
|
-
[samples/hello/hello_menu_bar.rb](
|
3739
|
+
[samples/hello/hello_menu_bar.rb](samples/hello/hello_menu_bar.rb)
|
3745
3740
|
|
3746
3741
|
![Hello Menu Bar](images/glimmer-hello-menu-bar.png)
|
3747
3742
|
![Hello Menu Bar File Menu](images/glimmer-hello-menu-bar-file-menu.png)
|
@@ -3753,7 +3748,7 @@ This sample demonstrates pop up context menus in Glimmer.
|
|
3753
3748
|
|
3754
3749
|
Code:
|
3755
3750
|
|
3756
|
-
[samples/hello/hello_pop_up_context_menu.rb](
|
3751
|
+
[samples/hello/hello_pop_up_context_menu.rb](samples/hello/hello_pop_up_context_menu.rb)
|
3757
3752
|
|
3758
3753
|
![Hello Pop Up Context Menu](images/glimmer-hello-pop-up-context-menu.png)
|
3759
3754
|
![Hello Pop Up Context Menu Popped Up](images/glimmer-hello-pop-up-context-menu-popped-up.png)
|
@@ -3764,7 +3759,7 @@ This sample demonstrates the use of a custom widget in Glimmer.
|
|
3764
3759
|
|
3765
3760
|
Code:
|
3766
3761
|
|
3767
|
-
[samples/hello/hello_custom_widget.rb](
|
3762
|
+
[samples/hello/hello_custom_widget.rb](samples/hello/hello_custom_widget.rb)
|
3768
3763
|
|
3769
3764
|
![Hello Custom Widget](images/glimmer-hello-custom-widget.gif)
|
3770
3765
|
|
@@ -3774,7 +3769,7 @@ This sample demonstrates the use of a custom shell (aka custom window) in Glimme
|
|
3774
3769
|
|
3775
3770
|
Code:
|
3776
3771
|
|
3777
|
-
[samples/hello/hello_custom_shell.rb](
|
3772
|
+
[samples/hello/hello_custom_shell.rb](samples/hello/hello_custom_shell.rb)
|
3778
3773
|
|
3779
3774
|
![Hello Custom Shell](images/glimmer-hello-custom-shell.png)
|
3780
3775
|
![Hello Custom Shell Email1](images/glimmer-hello-custom-shell-email1.png)
|
@@ -3787,7 +3782,7 @@ This sample demonstrates the use of a `sash_form` in Glimmer.
|
|
3787
3782
|
|
3788
3783
|
Code:
|
3789
3784
|
|
3790
|
-
[samples/hello/hello_sash_form.rb](
|
3785
|
+
[samples/hello/hello_sash_form.rb](samples/hello/hello_sash_form.rb)
|
3791
3786
|
|
3792
3787
|
Hello, Sash Form! Horizontal Orientation
|
3793
3788
|
|
@@ -3819,7 +3814,7 @@ This sample demonstrates the use of a `styled_text` in Glimmer.
|
|
3819
3814
|
|
3820
3815
|
Code:
|
3821
3816
|
|
3822
|
-
[samples/hello/hello_styled_text.rb](
|
3817
|
+
[samples/hello/hello_styled_text.rb](samples/hello/hello_styled_text.rb)
|
3823
3818
|
|
3824
3819
|
Hello, Styled Text!
|
3825
3820
|
|
@@ -3831,7 +3826,7 @@ This sample demonstrates the use of a `expand_bar` and `expand_item` in Glimmer.
|
|
3831
3826
|
|
3832
3827
|
Code:
|
3833
3828
|
|
3834
|
-
[samples/hello/hello_expand_bar.rb](
|
3829
|
+
[samples/hello/hello_expand_bar.rb](samples/hello/hello_expand_bar.rb)
|
3835
3830
|
|
3836
3831
|
Hello, Expand Bar! All Expanded
|
3837
3832
|
|
@@ -3855,7 +3850,7 @@ This sample demonstrates the use of a `radio` (aka `button(:radio)`) in Glimmer.
|
|
3855
3850
|
|
3856
3851
|
Code:
|
3857
3852
|
|
3858
|
-
[samples/hello/hello_radio.rb](
|
3853
|
+
[samples/hello/hello_radio.rb](samples/hello/hello_radio.rb)
|
3859
3854
|
|
3860
3855
|
Hello, Radio!
|
3861
3856
|
|
@@ -3867,7 +3862,7 @@ This sample demonstrates the use of a `radio_group` in Glimmer, which provides t
|
|
3867
3862
|
|
3868
3863
|
Code:
|
3869
3864
|
|
3870
|
-
[samples/hello/hello_radio_group.rb](
|
3865
|
+
[samples/hello/hello_radio_group.rb](samples/hello/hello_radio_group.rb)
|
3871
3866
|
|
3872
3867
|
Hello, Radio Group!
|
3873
3868
|
|
@@ -3879,7 +3874,7 @@ This sample demonstrates the use of a `group` in Glimmer (not to be confused wit
|
|
3879
3874
|
|
3880
3875
|
Code:
|
3881
3876
|
|
3882
|
-
[samples/hello/hello_group.rb](
|
3877
|
+
[samples/hello/hello_group.rb](samples/hello/hello_group.rb)
|
3883
3878
|
|
3884
3879
|
Hello, Group!
|
3885
3880
|
|
@@ -3891,7 +3886,7 @@ This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)
|
|
3891
3886
|
|
3892
3887
|
Code:
|
3893
3888
|
|
3894
|
-
[samples/hello/hello_checkbox.rb](
|
3889
|
+
[samples/hello/hello_checkbox.rb](samples/hello/hello_checkbox.rb)
|
3895
3890
|
|
3896
3891
|
Hello, Checkbox!
|
3897
3892
|
|
@@ -3903,7 +3898,7 @@ This sample demonstrates the use of a `checkbox_group` (aka `check_group`) in Gl
|
|
3903
3898
|
|
3904
3899
|
Code:
|
3905
3900
|
|
3906
|
-
[samples/hello/hello_checkbox_group.rb](
|
3901
|
+
[samples/hello/hello_checkbox_group.rb](samples/hello/hello_checkbox_group.rb)
|
3907
3902
|
|
3908
3903
|
Hello, Checkbox Group!
|
3909
3904
|
|
@@ -3915,7 +3910,7 @@ This sample demonstrates the use of a `directory_dialog` in Glimmer.
|
|
3915
3910
|
|
3916
3911
|
Code:
|
3917
3912
|
|
3918
|
-
[samples/hello/hello_directory_dialog.rb](
|
3913
|
+
[samples/hello/hello_directory_dialog.rb](samples/hello/hello_directory_dialog.rb)
|
3919
3914
|
|
3920
3915
|
Hello, Directory Dialog!
|
3921
3916
|
|
@@ -3935,7 +3930,7 @@ This sample demonstrates the use of a `file_dialog` in Glimmer.
|
|
3935
3930
|
|
3936
3931
|
Code:
|
3937
3932
|
|
3938
|
-
[samples/hello/hello_file_dialog.rb](
|
3933
|
+
[samples/hello/hello_file_dialog.rb](samples/hello/hello_file_dialog.rb)
|
3939
3934
|
|
3940
3935
|
Hello, File Dialog!
|
3941
3936
|
|
@@ -3955,7 +3950,7 @@ This sample demonstrates the use of [date_time](#datetime) widget keywords in Gl
|
|
3955
3950
|
|
3956
3951
|
Code:
|
3957
3952
|
|
3958
|
-
[samples/hello/hello_date_time.rb](
|
3953
|
+
[samples/hello/hello_date_time.rb](samples/hello/hello_date_time.rb)
|
3959
3954
|
|
3960
3955
|
Hello, Date Time!
|
3961
3956
|
|
@@ -3967,7 +3962,7 @@ This sample demonstrates the use of `spinner` widget in Glimmer
|
|
3967
3962
|
|
3968
3963
|
Code:
|
3969
3964
|
|
3970
|
-
[samples/hello/hello_spinner.rb](
|
3965
|
+
[samples/hello/hello_spinner.rb](samples/hello/hello_spinner.rb)
|
3971
3966
|
|
3972
3967
|
Hello, Spinner!
|
3973
3968
|
|
@@ -3979,7 +3974,7 @@ This sample demonstrates the use of [table](#table) widget in Glimmer, including
|
|
3979
3974
|
|
3980
3975
|
Code:
|
3981
3976
|
|
3982
|
-
[samples/hello/hello_table.rb](
|
3977
|
+
[samples/hello/hello_table.rb](samples/hello/hello_table.rb)
|
3983
3978
|
|
3984
3979
|
Hello, Table!
|
3985
3980
|
|
@@ -4021,6 +4016,38 @@ Hello, Table! Context Menu
|
|
4021
4016
|
|
4022
4017
|
![Hello Table](images/glimmer-hello-table-context-menu.png)
|
4023
4018
|
|
4019
|
+
#### Hello, Button!
|
4020
|
+
|
4021
|
+
This sample demonstrates the use of the `button` widget in Glimmer, including data-binding and click event triggering via `on_widget_selected`.
|
4022
|
+
|
4023
|
+
Code:
|
4024
|
+
|
4025
|
+
[samples/hello/hello_button.rb](samples/hello/hello_button.rb)
|
4026
|
+
|
4027
|
+
Hello, Button!
|
4028
|
+
|
4029
|
+
![Hello Button](images/glimmer-hello-button.png)
|
4030
|
+
|
4031
|
+
Hello, Button! Incremented 7 times!
|
4032
|
+
|
4033
|
+
![Hello Button Incremented](images/glimmer-hello-button-incremented.png)
|
4034
|
+
|
4035
|
+
#### Hello, Link!
|
4036
|
+
|
4037
|
+
This sample demonstrates the use of the `link` widget in Glimmer, including identifying which link was clicked and performing an action (displaying help) based on its location.
|
4038
|
+
|
4039
|
+
Code:
|
4040
|
+
|
4041
|
+
[samples/hello/hello_link.rb](samples/hello/hello_link.rb)
|
4042
|
+
|
4043
|
+
Hello, Link!
|
4044
|
+
|
4045
|
+
![Hello Link](images/glimmer-hello-link.png)
|
4046
|
+
|
4047
|
+
Hello, Link! Clicked
|
4048
|
+
|
4049
|
+
![Hello Link Clicked](images/glimmer-hello-link-clicked.png)
|
4050
|
+
|
4024
4051
|
### Elaborate Samples
|
4025
4052
|
|
4026
4053
|
For more elaborate samples, check the following:
|
@@ -4033,7 +4060,7 @@ Please note that the code has changed since that article was written (the GUI DS
|
|
4033
4060
|
|
4034
4061
|
Code:
|
4035
4062
|
|
4036
|
-
[samples/elaborate/user_profile.rb](
|
4063
|
+
[samples/elaborate/user_profile.rb](samples/elaborate/user_profile.rb)
|
4037
4064
|
|
4038
4065
|
![User Profile](images/glimmer-user-profile.png)
|
4039
4066
|
|
@@ -4043,7 +4070,7 @@ This sample demonstrates basic data-binding, password and text fields, and field
|
|
4043
4070
|
|
4044
4071
|
Code:
|
4045
4072
|
|
4046
|
-
[samples/elaborate/login.rb](
|
4073
|
+
[samples/elaborate/login.rb](samples/elaborate/login.rb)
|
4047
4074
|
|
4048
4075
|
![Login](images/glimmer-login.png)
|
4049
4076
|
![Login Filled In](images/glimmer-login-filled-in.png)
|
@@ -4057,7 +4084,7 @@ Code:
|
|
4057
4084
|
|
4058
4085
|
(Please note that on some Linux instances where the display x-axis is set to double-scale, you need to set the `shell` `minimum_size` to `300, 178` instead of `150, 178`)
|
4059
4086
|
|
4060
|
-
[samples/elaborate/tic_tac_toe.rb](
|
4087
|
+
[samples/elaborate/tic_tac_toe.rb](samples/elaborate/tic_tac_toe.rb)
|
4061
4088
|
|
4062
4089
|
![Tic Tac Toe](images/glimmer-tic-tac-toe.png)
|
4063
4090
|
![Tic Tac Toe In Progress](images/glimmer-tic-tac-toe-in-progress.png)
|
@@ -4069,7 +4096,7 @@ This sample demonstrates table data-binding, sorting, filtering, GUI layout, MVP
|
|
4069
4096
|
|
4070
4097
|
Code:
|
4071
4098
|
|
4072
|
-
[samples/elaborate/contact_manager.rb](
|
4099
|
+
[samples/elaborate/contact_manager.rb](samples/elaborate/contact_manager.rb)
|
4073
4100
|
|
4074
4101
|
Contact Manager
|
4075
4102
|
|