glimmer 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34181d1d8318f14c036ebfdd848818600e16db5cc38ffcab6d5bb4be066d71af
4
- data.tar.gz: 280f6bb988e28a5c22a691df979616b20036e6d918a68595c1a7e5236ff8e7ac
3
+ metadata.gz: d35080737c8d31d9ede07328113372b4a79100d5ce2269f027e389923fbf93b5
4
+ data.tar.gz: c3d8e4852e4f36cb3de1adcb2552d4562c6460e68f49c33598de5c2e36c1e486
5
5
  SHA512:
6
- metadata.gz: 5c65e1dcdd54e3c9a98b5cc16bc422c5a1ee38f4b0f85a9f9c761dce93ab3b0682b4ee708b7e5212dc24e875a1b7bcf37578f75cd975f5a6093312e0caf2c8f7
7
- data.tar.gz: e7ea759b31719d58f05bef4ef0b1fd4a5301fa9240412c3eac75c98d961a0515b02703a84e86f0f06e32effffea168e7f7c9e38ed00b116b69bcb61dfa90d69e
6
+ metadata.gz: 7a46acf87df92892d34477af6a0e69b8ec0fe3bfdbee4c45dd94f08a0eb6098724e785d2f2109c73663c278f7a1a5141d0b45ff26f5bfa6fd07f99653d1fc419
7
+ data.tar.gz: af7430e47c5d5875bf1314bbb77055be6927baffaf4435ee25241cda4955bb1bf9c5dab29d7c07a5dde158c09ad39c2bb55b46dba9fcdbe7bd86f3c4c293cf79
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- # Glimmer 0.5.7 Beta (JRuby Desktop UI DSL + Data-Binding)
1
+ # Glimmer 0.5.8 Beta (JRuby Desktop UI DSL + Data-Binding)
2
2
  [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer?branch=master)
3
3
 
4
4
  Glimmer is a native-UI cross-platform desktop development library written in Ruby. Glimmer's main innovation is a JRuby DSL that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust platform-native Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support to greatly facilitate synchronizing the UI with domain models. As a result, that achieves true decoupling of object oriented components, enabling developers to solve business problems without worrying about UI concerns, or alternatively drive development UI-first, and then write clean business components test-first afterwards.
@@ -67,6 +67,58 @@ Glimmer app:
67
67
 
68
68
  NOTE: Glimmer is in beta mode. Please help make better by adopting for small or low risk projects and providing feedback.
69
69
 
70
+ ## Table of Contents
71
+
72
+ <!-- TOC START min:1 max:3 link:true asterisk:false update:true -->
73
+ - [Glimmer 0.5.8 Beta (JRuby Desktop UI DSL + Data-Binding)](#glimmer-058-beta-jruby-desktop-ui-dsl--data-binding)
74
+ - [Examples](#examples)
75
+ - [Hello World](#hello-world)
76
+ - [Tic Tac Toe](#tic-tac-toe)
77
+ - [Table of Contents](#table-of-contents)
78
+ - [Background](#background)
79
+ - [Platform Support](#platform-support)
80
+ - [Pre-requisites](#pre-requisites)
81
+ - [Setup](#setup)
82
+ - [Option 1: Direct Install](#option-1-direct-install)
83
+ - [Option 2: Bundler](#option-2-bundler)
84
+ - [Glimmer Command](#glimmer-command)
85
+ - [Basic Usage](#basic-usage)
86
+ - [Advanced Usage](#advanced-usage)
87
+ - [Girb (Glimmer irb) Command](#girb-glimmer-irb-command)
88
+ - [Glimmer DSL Syntax](#glimmer-dsl-syntax)
89
+ - [Widgets](#widgets)
90
+ - [Widget Styles](#widget-styles)
91
+ - [Widget Properties](#widget-properties)
92
+ - [Layouts](#layouts)
93
+ - [Layout Data](#layout-data)
94
+ - [Data-Binding](#data-binding)
95
+ - [Observer](#observer)
96
+ - [Custom Widgets](#custom-widgets)
97
+ - [Custom Shells](#custom-shells)
98
+ - [Miscellaneous](#miscellaneous)
99
+ - [Glimmer Style Guide](#glimmer-style-guide)
100
+ - [Samples](#samples)
101
+ - [SWT Reference](#swt-reference)
102
+ - [SWT Packages](#swt-packages)
103
+ - [Logging](#logging)
104
+ - [Raw JRuby Command](#raw-jruby-command)
105
+ - [Mac Support](#mac-support)
106
+ - [Packaging & Distribution](#packaging--distribution)
107
+ - [Defaults](#defaults)
108
+ - [javapackager Extra Arguments](#javapackager-extra-arguments)
109
+ - [Mac Application Distribution](#mac-application-distribution)
110
+ - [Self Signed Certificate](#self-signed-certificate)
111
+ - [Gotchas](#gotchas)
112
+ - [Resources](#resources)
113
+ - [Feature Suggestions](#feature-suggestions)
114
+ - [Change Log](#change-log)
115
+ - [Contributing](#contributing)
116
+ - [Contributors](#contributors)
117
+ - [License](#license)
118
+ <!-- TOC END -->
119
+
120
+
121
+
70
122
  ## Background
71
123
 
72
124
  Ruby is a dynamically-typed object-oriented language, which provides great productivity gains due to its powerful expressive syntax and dynamic nature. While it is proven by the Ruby on Rails framework for web development, it currently lacks a robust platform-independent framework for building desktop applications. Given that Java libraries can now be utilized in Ruby code through JRuby, Eclipse technologies, such as SWT, JFace, and RCP can help fill the gap of desktop application development with Ruby.
@@ -111,14 +163,14 @@ Please follow these instructions to make the `glimmer` command available on your
111
163
 
112
164
  Run this command to install directly:
113
165
  ```
114
- jgem install glimmer -v 0.5.7
166
+ jgem install glimmer -v 0.5.8
115
167
  ```
116
168
 
117
169
  ### Option 2: Bundler
118
170
 
119
171
  Add the following to `Gemfile`:
120
172
  ```
121
- gem 'glimmer', '~> 0.5.7'
173
+ gem 'glimmer', '~> 0.5.8'
122
174
  ```
123
175
 
124
176
  And, then run:
@@ -186,6 +238,8 @@ If you cloned this project locally, you may run `bin/girb` instead.
186
238
  bin/girb
187
239
  ```
188
240
 
241
+ Watch out for hands-on examples in this README indicated by "you may copy/paste in [`girb`](#girb-glimmer-irb-command)"
242
+
189
243
  ## Glimmer DSL Syntax
190
244
 
191
245
  Glimmer DSL syntax consists of static keywords and dynamic keywords to build and bind user-interface objects.
@@ -230,7 +284,7 @@ In Glimmer DSL, widgets are declared with lowercase underscored names mirroring
230
284
  - `list` instantiates `org.eclipse.swt.widgets.List`
231
285
 
232
286
  Every **widget** is sufficiently declared by name, but may optionally be accompanied with:
233
- - SWT **style** ***argument*** wrapped by parenthesis according to [Glimmer coding style](#glimmer-coding-style) (see [next section](#widget-styles) for details).
287
+ - SWT **style** ***argument*** wrapped by parenthesis according to [Glimmer Style Guide](#glimmer-coding-style) (see [next section](#widget-styles) for details).
234
288
  - Ruby block containing **properties** (widget attributes) and **content** (nested widgets)
235
289
 
236
290
  For example, if we were to revisit `samples/hello_world.rb` above (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
@@ -257,11 +311,21 @@ Note that `shell` instantiates the outer shell **widget**, in other words, the w
257
311
  # ...
258
312
  ```
259
313
 
260
- The first line declares a **property** called `text`, which sets the title of the shell (window) to `"Glimmer"`. **Properties** always have ***arguments*** (not wrapped by parenthesis according to [Glimmer coding style](#glimmer-coding-style)), such as the text `"Glimmer"` in this case, and do **NOT** have a ***block*** (this distinguishes them from **widget** declarations).
314
+ The first line declares a **property** called `text`, which sets the title of the shell (window) to `"Glimmer"`. **Properties** always have ***arguments*** (not wrapped by parenthesis according to [Glimmer Style Guide](#glimmer-coding-style)), such as the text `"Glimmer"` in this case, and do **NOT** have a ***block*** (this distinguishes them from **widget** declarations).
261
315
 
262
316
  The second line declares the `label` **widget**, which is followed by a Ruby **content** ***block*** that contains its `text` **property** with value `"Hello, World!"`
263
317
 
264
- Note that The `shell` widget is always the outermost widget containing all others in a Glimmer desktop windowed application.
318
+ The **widget** ***block*** may optionally receive an argument representing the widget proxy object that the block content is for. This is useful in rare cases when the content code needs to refer to parent widget during declaration. You may leave that argument out most of the time and only add when absolutely needed.
319
+
320
+ Example:
321
+
322
+ ```ruby
323
+ shell {|shell_proxy|
324
+ #...
325
+ }
326
+ ```
327
+
328
+ Remember that The `shell` widget is always the outermost widget containing all others in a Glimmer desktop windowed application.
265
329
 
266
330
  After it is declared, a `shell` must be opened with the `#open` method, which can be called on the block directly as in the example above, or by capturing `shell` in a `@shell` variable (shown in example below), and calling `#open` on it independently (recommended in actual apps)
267
331
 
@@ -315,6 +379,8 @@ Underneath both types, there can be a 3rd menu type called Drop Down.
315
379
 
316
380
  Glimmer provides special support for Drop Down menus as it automatically instantiates associated Cascade menu items and wires together with proper parenting, swt styles, and calling setMenu.
317
381
 
382
+ The ampersand symbol indicates the keyboard shortcut key for the menu item (e.g. '&Help' can be triggered on Windows by hitting ALT+H)
383
+
318
384
  Example [Menu Bar] (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
319
385
 
320
386
  ```ruby
@@ -462,7 +528,7 @@ SWT widgets receive `SWT` styles in their constructor as per this guide:
462
528
 
463
529
  https://wiki.eclipse.org/SWT_Widget_Style_Bits
464
530
 
465
- Glimmer DSL facilitates that by passing symbols representing `SWT` constants as widget method arguments (i.e. inside widget `()` parentheses according to [Glimmer coding style](#glimmer-coding-style). See example below) in lower case version (e.g. `SWT::MULTI` becomes `:multi`).
531
+ Glimmer DSL facilitates that by passing symbols representing `SWT` constants as widget method arguments (i.e. inside widget `()` parentheses according to [Glimmer Style Guide](#glimmer-coding-style). See example below) in lower case version (e.g. `SWT::MULTI` becomes `:multi`).
466
532
 
467
533
  These styles customize widget look, feel, and behavior.
468
534
 
@@ -527,23 +593,6 @@ shell(:no_resize) {
527
593
  }
528
594
  ```
529
595
 
530
- #### Shell extra attributes
531
-
532
- Shell widget can receive a hash of extra attributes as the last argument (or alone):
533
- - app_name: name to show for app (especially on the Mac)
534
- - app_version: version to have OS recognize app by
535
-
536
- Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
537
-
538
- ```ruby
539
- shell(:no_resize, app_name: 'Glimmer Demo', app_version: '1.0') {
540
- text "Glimmer"
541
- label {
542
- text "Hello, World!"
543
- }
544
- }.open
545
- ```
546
-
547
596
  ### Widget Properties
548
597
 
549
598
  Widget properties such as text value, enablement, visibility, and layout details are set within the widget block using methods matching SWT widget property names in lower snakecase. You may refer to SWT widget guide for details on available widget properties:
@@ -1011,10 +1060,12 @@ Glimmer comes with `Observer` module, which is used internally for data-binding,
1011
1060
 
1012
1061
  #### Observing Widgets
1013
1062
 
1014
- Glimmer supports observing widgets with two types of syntax:
1015
- 1. `on_{swt-listener-method-name}`: where {swt-listener-method-name} is replaced with the lowercase underscored method name on an SWT listener class (e.g. `on_verify_text` for `org.eclipse.swt.events.VerifyListener#verifyText`).
1063
+ Glimmer supports observing widgets with two main types of events:
1064
+ 1. `on_{swt-listener-method-name}`: where {swt-listener-method-name} is replaced with the lowercase underscored event method name on an SWT listener class (e.g. `on_verify_text` for `org.eclipse.swt.events.VerifyListener#verifyText`).
1016
1065
  2. `on_event_{swt-event-constant}`: where {swt-event-constant} is replaced with an `org.eclipse.swt.SWT` event constant (e.g. `on_event_show` for `SWT.Show` to observe when widget becomes visible)
1017
1066
 
1067
+ Additionally, the `shell` widget supports a 3rd type on the Mac, application menu item observers (`on_about` and `on_preferences`), which you can read about under [Miscellaneous](#miscellaneous).
1068
+
1018
1069
  Number 1 is more commonly used in SWT applications, so make it your starting point. Number 2 covers events not found in number 1, so look into it if you don't find an SWT listener you need in number 1.
1019
1070
 
1020
1071
  **Regarding number 1**, to figure out what the available events for an SWT widget are, check out all of its `add***Listener` API methods, and then open the listener class argument to check its "event methods".
@@ -1390,6 +1441,77 @@ shell { |app_shell|
1390
1441
 
1391
1442
  ### Miscellaneous
1392
1443
 
1444
+ #### Application Menu Items (About/Preferences)
1445
+
1446
+ Mac applications always have About and Preferences menu items. Glimmer provides widget observer hooks for them on the `shell` widget:
1447
+ - `on_about`: executes code when user selects App Name -> About
1448
+ - `on_preferences`: executes code when user selects App Name -> Preferences or hits 'CMD+,' on the Mac
1449
+
1450
+ Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
1451
+
1452
+ ```ruby
1453
+ shell { |shell_proxy|
1454
+ text 'Application Menu Items'
1455
+ fill_layout {
1456
+ margin_width 15
1457
+ margin_height 15
1458
+ }
1459
+ label {
1460
+ text 'Application Menu Items'
1461
+ font height: 30
1462
+ }
1463
+ on_about {
1464
+ message_box = MessageBox.new(shell_proxy.swt_widget)
1465
+ message_box.setText("About")
1466
+ message_box.setMessage("About Application")
1467
+ message_box.open
1468
+ }
1469
+ on_preferences {
1470
+ preferences_dialog = shell(:dialog_trim, :application_modal) {
1471
+ text 'Preferences'
1472
+ row_layout {
1473
+ type :vertical
1474
+ margin_left 15
1475
+ margin_top 15
1476
+ margin_right 15
1477
+ margin_bottom 15
1478
+ }
1479
+ label {
1480
+ text 'Check one of these options:'
1481
+ }
1482
+ button(:radio) {
1483
+ text 'Option 1'
1484
+ }
1485
+ button(:radio) {
1486
+ text 'Option 2'
1487
+ }
1488
+ }
1489
+ preferences_dialog.open
1490
+ }
1491
+ }.open
1492
+ ```
1493
+
1494
+ #### App Name and Version
1495
+
1496
+ Application name (shows up on the Mac in top menu bar) and version may be specified upon [packaging](#packaging--distribution) by specifying "-Bmac.CFBundleName" and "-Bmac.CFBundleVersion" options.
1497
+
1498
+ Still, if you would like proper application name to show up on the Mac top menu bar during development, you may do so by invoking the SWT Display.setAppName method before any Display object has been instantiated (i.e. before any Glimmer widget like shell has been declared).
1499
+
1500
+ Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
1501
+
1502
+ ```ruby
1503
+ Display.setAppName('Glimmer Demo')
1504
+
1505
+ shell(:no_resize) {
1506
+ text "Glimmer"
1507
+ label {
1508
+ text "Hello, World!"
1509
+ }
1510
+ }.open
1511
+ ```
1512
+
1513
+ Also, you may invoke `Display.setAppVersion('1.0.0')` if needed for OS app version identification reasons during development, replacing `'1.0.0'` with your application version.
1514
+
1393
1515
  #### Video Widget
1394
1516
 
1395
1517
  ![Video Widget](images/glimmer-video-widget.png)
@@ -1510,7 +1632,7 @@ shell {
1510
1632
  }.open
1511
1633
  ```
1512
1634
 
1513
- ## Glimmer Coding Style
1635
+ ## Glimmer Style Guide
1514
1636
 
1515
1637
  - Widgets are declared with underscored lowercase versions of their SWT names minus the SWT package name.
1516
1638
  - Widget declarations may optionally have arguments and be followed by a block (to contain properties and content)
@@ -1656,7 +1778,7 @@ Example:
1656
1778
  jruby -J-XstartOnFirstThread -J-classpath "path_to/swt.jar" -r glimmer -S application.rb
1657
1779
  ```
1658
1780
 
1659
- ## Packaging
1781
+ ## Packaging & Distribution
1660
1782
 
1661
1783
  Glimmer apps may be packaged and distributed on the Mac, Windows, and Linux via these tools:
1662
1784
  - Warbler (https://github.com/jruby/warbler): Enables bundling a Glimmer app into a JAR file
@@ -1681,7 +1803,13 @@ rake glimmer:package
1681
1803
 
1682
1804
  This will generate a JAR file under `./dist` directory, which is then used to generate a DMG file (and pkg/app) under `./packages/bundles`. Both will match your application local directory name (e.g. `MathBowling.jar` and `MathBowling-1.0.dmg` for `~/code/MathBowling`)
1683
1805
 
1684
- By default, the package only includes these directories: app, config, db, lib, script, bin, images, sounds, videos
1806
+ ### Defaults
1807
+
1808
+ Glimmer employs smart defaults in packaging.
1809
+
1810
+ The package application name (shows up in top menu bar on the Mac) will be a human form of the app root directory name (e.g. "Math Bowling" for "MathBowling" or "math_bowling" app root directory name). However, application name and version may be specified explicitly via "-Bmac.CFBundleName" and "-Bmac.CFBundleVersion" options.
1811
+
1812
+ Also, the package will only include these directories: app, config, db, lib, script, bin, images, sounds, videos
1685
1813
 
1686
1814
  After running once, you will find a `config/warble.rb` file. It has the JAR packaging configuration. You may adjust included directories in it if needed, and then rerun `rake glimmer:package` and it will pick up your custom configuration. Alternatively, if you'd like to customize the included directories to begin with, don't run `rake glimmer:package` right away. Run this command first:
1687
1815
 
@@ -1691,13 +1819,17 @@ rake glimmer:package:config
1691
1819
 
1692
1820
  This will generate `config/warble.rb`, which you may configure and then run `rake glimmer:package` afterwards.
1693
1821
 
1694
- In any case, in order to pass extra options to configure Mac package and sign your Mac app to distribute on the App Store, you can read more advanced instructions for `javapackager` here:
1822
+ ### javapackager Extra Arguments
1823
+
1824
+ In order to explicitly configure javapackager, Mac package attributes, or sign your Mac app to distribute on the App Store, you can follow more advanced instructions for `javapackager` here:
1695
1825
  - https://docs.oracle.com/javase/9/tools/javapackager.htm#JSWOR719
1696
1826
  - https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html
1697
1827
  - https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html#BCGICFDB
1698
1828
  - https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html
1699
1829
 
1700
- Glimmer rake task allows passing extra options to javapackager via `Glimmer::Packager.javapackager_extra_args` in your application Rakefile or environment variable `JAVAPACKAGER_EXTRA_ARGS`
1830
+ The Glimmer rake task allows passing extra options to javapackager via:
1831
+ - `Glimmer::Packager.javapackager_extra_args="..."` in your application Rakefile
1832
+ - Environment variable: `JAVAPACKAGER_EXTRA_ARGS`
1701
1833
 
1702
1834
  Example (Rakefile):
1703
1835
 
@@ -1717,6 +1849,24 @@ That overrides the default application display name.
1717
1849
 
1718
1850
  Recent macOS versions (starting with Catalina) have very stringent security requirements requiring all applications to be signed before running (unless the user goes to System Preferences -> Privacy -> General tab and clicks "Open Anyway" after failing to open application the first time they run it). So, to release a desktop application on the Mac, it is recommended to enroll in the [Apple Developer Program](https://developer.apple.com/programs/) to distribute on the [Mac App Store](https://developer.apple.com/distribute/) or otherwise request [app notarization from Apple](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution) to distribute independently.
1719
1851
 
1852
+ Afterwards, you may add developer-id/signing-key arguments to `javapackager` via `Glimmer::Package.javapackager_extra_args` or `JAVAPACKAGER_EXTRA_ARGS` according to this webpage: https://docs.oracle.com/javase/9/tools/javapackager.htm#JSWOR719
1853
+
1854
+ DMG signing key argument:
1855
+ ```
1856
+ -Bmac.signing-key-developer-id-app="..."
1857
+ ```
1858
+
1859
+ PKG signing key argument:
1860
+ ```
1861
+ -Bmac.signing-key-developer-id-installer="..."
1862
+ ```
1863
+
1864
+ Mac App Store signing key arguments:
1865
+ ```
1866
+ -Bmac.signing-key-app="..."
1867
+ -Bmac.signing-key-pkg="..."
1868
+ ```
1869
+
1720
1870
  ### Self Signed Certificate
1721
1871
 
1722
1872
  You may still release a signed DMG file without enrolling into the Apple Developer Program with the caveat that users will always fail in opening the app the first time, and have to go to System Preferences -> Privacy -> General tab to "Open Anyway".
@@ -1,6 +1,7 @@
1
1
  require 'glimmer/swt/swt_proxy'
2
2
  require 'glimmer/swt/widget_proxy'
3
3
  require 'glimmer/swt/display_proxy'
4
+ require 'glimmer/swt/swt_proxy'
4
5
  require 'glimmer/dsl/shell_expression'
5
6
 
6
7
  module Glimmer
@@ -14,6 +15,7 @@ module Glimmer
14
15
 
15
16
  WIDTH_MIN = 130
16
17
  HEIGHT_MIN = 0
18
+ OBSERVED_MENU_ITEMS = ['about', 'preferences']
17
19
 
18
20
  attr_reader :opened_before
19
21
  alias opened_before? opened_before
@@ -23,11 +25,17 @@ module Glimmer
23
25
  if args.first.is_a?(ShellProxy)
24
26
  args[0] = args[0].swt_widget
25
27
  end
28
+ style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
29
+ if style_args.any?
30
+ style_arg_start_index = args.index(style_args.first)
31
+ style_arg_last_index = args.index(style_args.last)
32
+ args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
33
+ end
26
34
  if args.first.nil? || (!args.first.is_a?(Display) && !args.first.is_a?(Shell))
27
35
  @display = DisplayProxy.instance.swt_display
28
36
  args = [@display] + args
29
37
  end
30
- args = SWTProxy.constantify_args(args).compact
38
+ args = args.compact
31
39
  @swt_widget = Shell.new(*args)
32
40
  @display ||= @swt_widget.getDisplay
33
41
  @swt_widget.setLayout(FillLayout.new)
@@ -92,9 +100,31 @@ module Glimmer
92
100
  end
93
101
  end
94
102
 
103
+ def can_handle_observation_request?(observation_request)
104
+ result = false
105
+ if observation_request.start_with?('on_')
106
+ event_name = observation_request.sub(/^on_/, '')
107
+ result = OBSERVED_MENU_ITEMS.include?(event_name)
108
+ end
109
+ result || super
110
+ end
111
+
112
+ def handle_observation_request(observation_request, &block)
113
+ if observation_request.start_with?('on_')
114
+ event_name = observation_request.sub(/^on_/, '')
115
+ if OBSERVED_MENU_ITEMS.include?(event_name)
116
+ system_menu = DisplayProxy.instance.swt_display.getSystemMenu
117
+ menu_item = system_menu.getItems.find {|menu_item| menu_item.getID == SWTProxy["ID_#{event_name.upcase}"]}
118
+ menu_item.addListener(SWTProxy[:Selection], &block)
119
+ else
120
+ super
121
+ end
122
+ end
123
+ end
124
+
95
125
  def add_observer(observer, property_name)
96
126
  case property_name.to_s
97
- when 'visible?'
127
+ when 'visible?' #TODO see if you must handle non-? version and/or move elsewhere
98
128
  visibility_notifier = proc do
99
129
  observer.call(visible?)
100
130
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-18 00:00:00.000000000 Z
11
+ date: 2020-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement