gtk3app 5.3.210919 → 5.4.230109

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: 4e50cd215059b6ac181c79bfefb5da19a22eb80a886779be41711ac91c292296
4
- data.tar.gz: f11fb69cd896ff2435f8c894bd9c5e31019b05ded921cf1d7bd2f9579f007f51
3
+ metadata.gz: 26d8800694d7bc36b8b9d6837977d6c7bc46305dc8b97cb4e61ef1d3f4a23bbc
4
+ data.tar.gz: 41876d443e177b2f1acaaaa556449b4da9bcdfd95d18d5be14683e3500584fc9
5
5
  SHA512:
6
- metadata.gz: ba23a03eb79edd5cfa6f4746f3826715a4c777a69030e92421925e1e88a8db29edd76c3529b9bb91bd3639309f54ee66fb69ff17a978687c98bfa5b077642ff0
7
- data.tar.gz: c087515b10feaa0d0a4c593b78f2a1733b5b37b72fdd876a34033f8560dac0e559069ceec6a8ae12ed3e301cf131eadafac556b4f50070d04a3b6532936a2062
6
+ metadata.gz: ab08539c5e7996d90455703e763c83f801e3898bd573d691eb40153646e78e212468818d114701d31b35681216dcd675fa22cb955a6073ee153668b117d3f69b
7
+ data.tar.gz: 3dcaf677d90c7bdacf81895cbc24a7465f03617ed63f28a682880f03339ed6056310f398d3f186881975e21ad52f1bb149c74c604be919aa3d28776c41efee6e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gtk3App
2
2
 
3
- * [VERSION 5.3.210919](https://github.com/carlosjhr64/gtk3app/releases)
3
+ * [VERSION 5.4.230109](https://github.com/carlosjhr64/gtk3app/releases)
4
4
  * [github](https://www.github.com/carlosjhr64/gtk3app)
5
5
  * [rubygems](https://rubygems.org/gems/gtk3app)
6
6
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  ## DESCRIPTION:
10
10
 
11
- Gtk3App provides a
11
+ `Gtk3App` provides a
12
12
  [Ruby Gnome Gtk3](https://rubygems.org/gems/gtk3)
13
13
  application stub.
14
14
 
@@ -17,13 +17,10 @@ One for a horizontal toolbar.
17
17
  The other for your main stage area.
18
18
 
19
19
  ## INSTALL:
20
-
21
20
  ```console
22
21
  $ sudo gem install gtk3app
23
22
  ```
24
-
25
23
  ## SYNOPSIS:
26
-
27
24
  ```ruby
28
25
  require 'gtk3app'
29
26
  # Expander = Such::Expander < Gtk::Expander
@@ -32,10 +29,9 @@ Gtk3App.run do |stage, toolbar, options|
32
29
  # add stuff to stage and toolbar
33
30
  end
34
31
  ```
35
-
36
32
  That's enough to get you going.
37
33
  The three examples in the [./examples](https://github.com/carlosjhr64/gtk3app/tree/master/examples)
38
- directory fully explains the rest of what Gtk3App can do for you.
34
+ directory fully explains the rest of what `Gtk3App` can do for you.
39
35
 
40
36
  ## FEATURES:
41
37
 
@@ -56,7 +52,7 @@ directory fully explains the rest of what Gtk3App can do for you.
56
52
 
57
53
  * The MIT License
58
54
 
59
- Copyright (c) 2021 CarlosJHR64
55
+ Copyright (c) 2023 CarlosJHR64
60
56
 
61
57
  Permission is hereby granted, free of charge, to any person obtaining
62
58
  a copy of this software and associated documentation files (the
@@ -11,10 +11,10 @@ module Gtk3App
11
11
  --notdecorated\tDont decorate window
12
12
  HELP
13
13
 
14
- # CONFIG follows the following conventions:
14
+ # See Such::Convention. Summary:
15
15
  # * Strings and numbers are mixed case.
16
- # * Arrays are all upper case (may except for arrays of length 1, see Such).
17
- # * Hashes are all lower case.
16
+ # * Arrays are upper case.
17
+ # * Hashes are lower case.
18
18
  # * Lower case bang! keys have special meaning in Such.
19
19
  # * Note that method keys may have mixed case as the method itself.
20
20
  @@CONFIG = {
@@ -29,7 +29,7 @@ module Gtk3App
29
29
  # Main window configuration
30
30
  MAIN: a0, # Window.new's parameters
31
31
  main: h0, # window settings
32
- main!: [:MAIN,:main],
32
+ main!: [:MAIN,:main,'key-press-event','delete-event'],
33
33
 
34
34
  # Expander stage configuration
35
35
  STAGE: a0,
@@ -56,7 +56,7 @@ module Gtk3App
56
56
  about_dialog: {
57
57
  set_program_name: 'Gtk3App',
58
58
  set_version: VERSION.semantic(0..1),
59
- set_copyright: '(c) 2021 CarlosJHR64',
59
+ set_copyright: '(c) 2023 CarlosJHR64',
60
60
  set_comments: 'A Gtk3 Application Stub',
61
61
  set_website: 'https://github.com/carlosjhr64/gtk3app',
62
62
  set_website_label: 'See it at GitHub!',
@@ -103,6 +103,8 @@ module Gtk3App
103
103
  },
104
104
  # s0 tells AppMenu not to connect to any signal, otherwise it assumes "clicked".
105
105
  app_menu!: [:APP_MENU, :app_menu, s0],
106
+ # AppMenu key-binding(ie F1=65470)
107
+ AppMenu: 65470,
106
108
  }
107
109
  CONFIG = lambda{|k| @@CONFIG[k]}
108
110
  def CONFIG.to_h = @@CONFIG
@@ -1,23 +1,36 @@
1
1
  module Gtk3App
2
2
  class << self
3
- # Gtk3App.run(version:String?, help:String?, klass:(Class | Module)?), appdir:String?, appname:String?, config:Hash?)
3
+ # Gtk3App.run(version:String?, help:String?,
4
+ # klass:(Class | Module)?), appdir:String?, appname:String?,
5
+ # config:Hash?)
4
6
  def run(**kw)
7
+ # :appdir must be evaluated here, else breaks UserSpace's heuristics
5
8
  kw[:appdir] ||= UserSpace.appdir
6
9
  ensure_keywords(kw)
7
10
  @options = HelpParser[kw[:version], kw[:help]]
8
11
  install(kw)
9
12
 
10
13
  Such::Thing.configure @@CONFIG
11
- @main = Such::Window.new :main!, 'delete-event' do quit! end
14
+ @main = Such::Window.new :main! do |*_,e,signal|
15
+ case signal
16
+ when 'key-press-event'
17
+ if e.keyval==@@CONFIG[:AppMenu]
18
+ @appmenu.popup_at_widget @logo,
19
+ Gdk::Gravity::NORTH_WEST,Gdk::Gravity::NORTH_WEST
20
+ end
21
+ when 'delete-event'
22
+ quit!
23
+ end
24
+ end
12
25
  @main.set_decorated false if @options.notdecorated
13
26
 
14
- vbox = Such::Box.new @main, [:vertical]
15
- hbox = Such::Box.new vbox, [:horizontal]
27
+ vbox = Such::Box.new @main, [:vertical]
28
+ hbox = Such::Box.new vbox, [:horizontal]
16
29
 
17
- size = @@CONFIG[:LogoSize]
18
- @pixbuf = GdkPixbuf::Pixbuf.new(file: @@CONFIG[:Logo]).scale(size,size)
19
- logo = Gtk3App::EventImage.new hbox, [pixbuf:@pixbuf]
20
- Gtk3App::AppMenu.new(logo, :app_menu!) do |widget,*e,signal|
30
+ size = @@CONFIG[:LogoSize]
31
+ @pixbuf = GdkPixbuf::Pixbuf.new(file: @@CONFIG[:Logo]).scale(size,size)
32
+ @logo = Gtk3App::EventImage.new hbox, [pixbuf:@pixbuf]
33
+ @appmenu = Gtk3App::AppMenu.new(@logo, :app_menu!) do |widget,*e,signal|
21
34
  case signal
22
35
  when 'activate'
23
36
  send widget.key
@@ -41,39 +54,25 @@ class << self
41
54
  end
42
55
 
43
56
  def raise_argument_error(kw)
44
- $stderr.puts 'Expected Signature:'
45
- $stderr.puts ' Gtk3App.run(version:String?, help:String?, :klass:Class?, appdir:String?, :appname:String? config:Hash?)'
57
+ $stderr.puts <<~SIGNATURE
58
+ Expected Signature:
59
+ Gtk3App.run(version:String?, help:String?,
60
+ klass:Class?, appdir:String?, :appname:String?
61
+ config:Hash?)
62
+ SIGNATURE
46
63
  raise ArgumentError, kw.inspect
47
64
  end
48
65
 
49
66
  def ensure_keywords(kw)
50
- keys = [:version, :help, :klass, :appdir, :appname, :config]
51
- raise_argument_error(kw) if kw.keys.any?{not keys.include?_1}
67
+ raise_argument_error(kw) if
68
+ kw.keys.any?{![:version,:help,:klass,:appdir,:appname,:config].include?_1}
52
69
  klass = kw[:klass]
53
-
54
- unless kw[:version]
55
- if klass and defined? klass::VERSION
56
- kw[:version] = klass::VERSION
57
- else
58
- kw[:version] = (defined? ::VERSION)? ::VERSION : VERSION
59
- end
60
- end
61
-
62
- unless kw[:help]
63
- if klass and defined? klass::HELP
64
- kw[:help] = klass::HELP
65
- else
66
- kw[:help] = (defined? ::HELP)? ::HELP : HELP
67
- end
68
- end
69
-
70
+ kw[:version] ||= (klass and defined? klass::VERSION)?
71
+ klass::VERSION : (defined? ::VERSION)? ::VERSION : VERSION
72
+ kw[:help] ||= (klass and defined? klass::HELP)?
73
+ klass::HELP : (defined? ::HELP)? ::HELP : HELP
70
74
  kw[:appname] ||= klass&.name&.downcase || File.basename($0)
71
-
72
- unless kw[:config]
73
- if klass and defined? klass::CONFIG
74
- kw[:config] = klass::CONFIG
75
- end
76
- end
75
+ kw[:config] ||= klass::CONFIG if klass and defined? klass::CONFIG
77
76
  end
78
77
 
79
78
  def transient(window)
@@ -12,10 +12,10 @@ module Gtk3App
12
12
  end
13
13
 
14
14
  class AppMenu < Menu
15
- def initialize(window, *par, &block)
15
+ def initialize(logo, *par, &block)
16
16
  @block = block
17
- window.add_events(Gdk::EventMask::BUTTON_PRESS_MASK)
18
- window.signal_connect('button_press_event') do |w,e|
17
+ logo.add_events(Gdk::EventMask::BUTTON_PRESS_MASK)
18
+ logo.signal_connect('button_press_event') do |w,e|
19
19
  if e.button == 3
20
20
  #self.popup(nil, nil, 3, e.time)
21
21
  self.popup_at_pointer #(nil, nil, 3, e.time)
data/lib/gtk3app.rb CHANGED
@@ -11,7 +11,7 @@ Such::Things.in Gtk::Widget
11
11
 
12
12
  # This Gem
13
13
  module Gtk3App
14
- VERSION = '5.3.210919'
14
+ VERSION = '5.4.230109'
15
15
 
16
16
  require 'gtk3app/config'
17
17
  require 'gtk3app/widgets'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk3app
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.210919
4
+ version: 5.4.230109
5
5
  platform: ruby
6
6
  authors:
7
7
  - CarlosJHR64
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-19 00:00:00.000000000 Z
11
+ date: 2023-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: help_parser
@@ -16,60 +16,60 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '8.0'
19
+ version: '8.1'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 8.0.210917
22
+ version: 8.1.221206
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '8.0'
29
+ version: '8.1'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 8.0.210917
32
+ version: 8.1.221206
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: user_space
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '5.1'
39
+ version: '5.2'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 5.1.210201
42
+ version: 5.2.230101
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '5.1'
49
+ version: '5.2'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 5.1.210201
52
+ version: 5.2.230101
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rafini
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '3.0'
59
+ version: '3.2'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 3.0.210112
62
+ version: 3.2.221213
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '3.0'
69
+ version: '3.2'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 3.0.210112
72
+ version: 3.2.221213
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: rbon
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: '0.2'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.2.210125
82
+ version: 0.2.221217
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,49 +89,49 @@ dependencies:
89
89
  version: '0.2'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 0.2.210125
92
+ version: 0.2.221217
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: gtk3
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '3.4'
99
+ version: '4.0'
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 3.4.9
102
+ version: 4.0.5
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '3.4'
109
+ version: '4.0'
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 3.4.9
112
+ version: 4.0.5
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: such
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '2.0'
119
+ version: '2.1'
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
- version: 2.0.210201
122
+ version: 2.1.230106
123
123
  type: :runtime
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '2.0'
129
+ version: '2.1'
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: 2.0.210201
132
+ version: 2.1.230106
133
133
  description: |
134
- Gtk3App provides a
134
+ `Gtk3App` provides a
135
135
  [Ruby Gnome Gtk3](https://rubygems.org/gems/gtk3)
136
136
  application stub.
137
137
 
@@ -153,7 +153,7 @@ homepage: https://github.com/carlosjhr64/gtk3app
153
153
  licenses:
154
154
  - MIT
155
155
  metadata: {}
156
- post_install_message:
156
+ post_install_message:
157
157
  rdoc_options: []
158
158
  require_paths:
159
159
  - lib
@@ -168,10 +168,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements:
171
- - 'ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]'
172
- rubygems_version: 3.2.22
173
- signing_key:
171
+ - 'ruby: ruby 3.2.0 (2022-12-25 revision a528908271) [aarch64-linux]'
172
+ rubygems_version: 3.4.2
173
+ signing_key:
174
174
  specification_version: 4
175
- summary: Gtk3App provides a [Ruby Gnome Gtk3](https://rubygems.org/gems/gtk3) application
176
- stub.
175
+ summary: "`Gtk3App` provides a [Ruby Gnome Gtk3](https://rubygems.org/gems/gtk3) application
176
+ stub."
177
177
  test_files: []