gtk_paradise 0.5.440 → 0.5.441
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gtk_paradise might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb389dd782195567342693c7599060db20cc34441abd56ad5940c2b2644cbb9
|
4
|
+
data.tar.gz: a7c976eddf4fa94202098512517d42360232d1fc0e6e947b23651788277d5df5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3644ca318f516b30cb0827546c6a18e03405a783f5f862935082420935abfde01e759a996e51b7dba7e3e001fd66b7937887da68e2abad7e9beb1fee82fda3ea
|
7
|
+
data.tar.gz: c5cf35902c51e09aa9b77504cd9b025689478d5623bb0852c2745ec742785a149421786fa2228daddaf33e7227840ef99433f7f4229637d90256ef1342543b0c
|
@@ -9,7 +9,7 @@ module Gtk
|
|
9
9
|
# ========================================================================= #
|
10
10
|
# === VERSION_OF_THE_GTK_PARADISE_PROJECT
|
11
11
|
# ========================================================================= #
|
12
|
-
VERSION_OF_THE_GTK_PARADISE_PROJECT = '0.5.
|
12
|
+
VERSION_OF_THE_GTK_PARADISE_PROJECT = '0.5.441'
|
13
13
|
|
14
14
|
# ========================================================================= #
|
15
15
|
# === LAST_UPDATE
|
@@ -115,13 +115,21 @@ class NumberedLines < ::Gtk::Box
|
|
115
115
|
# ======================================================================= #
|
116
116
|
# === @up_to_n_times
|
117
117
|
#
|
118
|
-
# How many lines to display.
|
118
|
+
# How many lines to display. This also specifies the maximum number
|
119
|
+
# of lines the widget can hold. You can modify this from within
|
120
|
+
# initialize() via :upper_range.
|
119
121
|
# ======================================================================= #
|
120
122
|
@up_to_n_times = 60
|
121
123
|
# ======================================================================= #
|
122
124
|
# === @use_a_scrolled_window
|
125
|
+
#
|
126
|
+
# This can be used to create a scrolled-window as-is.
|
123
127
|
# ======================================================================= #
|
124
128
|
@use_a_scrolled_window = false
|
129
|
+
# ======================================================================= #
|
130
|
+
# === @array_event_boxes
|
131
|
+
# ======================================================================= #
|
132
|
+
@array_event_boxes = []
|
125
133
|
set_use_this_font(USE_THIS_FONT)
|
126
134
|
use_project_css_file # or use use_gtk_paradise_project_css_file
|
127
135
|
infer_the_size_automatically
|
@@ -168,6 +176,12 @@ class NumberedLines < ::Gtk::Box
|
|
168
176
|
@use_a_scrolled_window = true
|
169
177
|
end
|
170
178
|
|
179
|
+
# ========================================================================= #
|
180
|
+
# === n_entries?
|
181
|
+
# ========================================================================= #
|
182
|
+
def n_entries?
|
183
|
+
@up_to_n_times
|
184
|
+
end
|
171
185
|
|
172
186
|
# ========================================================================= #
|
173
187
|
# === connect_skeleton (connect tag)
|
@@ -184,6 +198,7 @@ class NumberedLines < ::Gtk::Box
|
|
184
198
|
index.to_s.ljust(2,' ')
|
185
199
|
)
|
186
200
|
event_box = gtk_eventbox(label)
|
201
|
+
@array_event_boxes << event_box
|
187
202
|
event_box.signal_connect(:event) {|widget, event|
|
188
203
|
if event.is_a?(Gdk::EventButton) and
|
189
204
|
(event.event_type.name == 'GDK_BUTTON_PRESS')
|
@@ -220,6 +235,37 @@ class NumberedLines < ::Gtk::Box
|
|
220
235
|
end
|
221
236
|
end
|
222
237
|
|
238
|
+
# ========================================================================= #
|
239
|
+
# === remove_the_last_n_lines
|
240
|
+
#
|
241
|
+
# This method can be specifically used to remove the last n-lines of
|
242
|
+
# the widget.
|
243
|
+
# ========================================================================= #
|
244
|
+
def remove_the_last_n_lines(
|
245
|
+
n_lines_to_remove = 10
|
246
|
+
)
|
247
|
+
inverted_array = @array_event_boxes.reverse
|
248
|
+
n_lines_to_remove.times {|index|
|
249
|
+
@main_vbox.remove(
|
250
|
+
inverted_array[index]
|
251
|
+
)
|
252
|
+
}
|
253
|
+
end
|
254
|
+
|
255
|
+
# ========================================================================= #
|
256
|
+
# === hide_the_last_n_lines
|
257
|
+
#
|
258
|
+
# This variant does not seem to work.
|
259
|
+
# ========================================================================= #
|
260
|
+
def hide_the_last_n_lines(
|
261
|
+
n_lines_to_remove = 10
|
262
|
+
)
|
263
|
+
inverted_array = @array_event_boxes.reverse
|
264
|
+
n_lines_to_remove.times {|index|
|
265
|
+
inverted_array[index].set_visible(false)
|
266
|
+
}
|
267
|
+
end
|
268
|
+
|
223
269
|
# ========================================================================= #
|
224
270
|
# === Gtk::NumberedLines.run
|
225
271
|
# ========================================================================= #
|
@@ -228,13 +274,16 @@ class NumberedLines < ::Gtk::Box
|
|
228
274
|
)
|
229
275
|
require 'gtk_paradise/run'
|
230
276
|
_ = ::Gtk::NumberedLines.new(i)
|
231
|
-
|
232
|
-
#
|
277
|
+
# _.hide_the_last_n_lines(10)
|
278
|
+
#_.remove_the_last_n_lines(10)
|
279
|
+
# ======================================================================= #
|
280
|
+
# Let's add it to a scrolled window, for simpler navigation.
|
281
|
+
# ======================================================================= #
|
233
282
|
scrolled_window = ::Gtk::ScrolledWindow.new
|
234
283
|
scrolled_window.add(_)
|
235
284
|
r = ::Gtk.run
|
236
285
|
r << scrolled_window
|
237
|
-
r.automatic_size_and_automatic_title
|
286
|
+
r.automatic_size_and_automatic_title(_)
|
238
287
|
r.top_left_then_run
|
239
288
|
end
|
240
289
|
|