Class: MultimediaParadise::GUI::Gtk::YoutubeChannels
- Inherits:
-
Gtk::Box
- Object
- Gtk::Box
- MultimediaParadise::GUI::Gtk::YoutubeChannels
- Includes:
- Gtk::BaseModule
- Defined in:
- lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb
Constant Summary collapse
- NAMESPACE =
#
NAMESPACE
#
inspect
- TITLE =
#
TITLE
#
'Youtube Channels'
- WIDTH =
#
WIDTH
#
600
- HEIGHT =
#
HEIGHT
#
500
- USE_THIS_FONT =
#
USE_THIS_FONT
#
:dejavu_condensed_20
- ARRAY_ADD_THESE_CHANNELS =
#
ARRAY_ADD_THESE_CHANNELS
#
%i( daily_dose_of_internet ozzy_man wt3 chris_sumo devon_larrat monster_michael tods_workshop )
Class Method Summary collapse
-
.run(i = ARGV) ⇒ Object
# === MultimediaParadise::GUI::Gtk::YoutubeChannels.run ========================================================================= #.
Instance Method Summary collapse
-
#apply_custom_CSS_rules ⇒ Object
# === apply_custom_CSS_rules ========================================================================= #.
-
#border_size? ⇒ Boolean
# === border_size? ========================================================================= #.
-
#connect_skeleton ⇒ Object
# === connect_skeleton (connect tag) ========================================================================= #.
-
#create_grid ⇒ Object
# === create_grid ========================================================================= #.
-
#create_skeleton ⇒ Object
# === create_skeleton (create tag) ========================================================================= #.
-
#do_open_this_channel_associated_URL(i) ⇒ Object
# === do_open_this_channel_associated_URL ========================================================================= #.
-
#initialize(commandline_arguments = ARGV, run_already = true) ⇒ YoutubeChannels
constructor
# === initialize ========================================================================= #.
-
#padding? ⇒ Boolean
# === padding? ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#run ⇒ Object
# === run (run tag) ========================================================================= #.
Constructor Details
#initialize(commandline_arguments = ARGV, run_already = true) ⇒ YoutubeChannels
#
initialize
#
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 67 def initialize( commandline_arguments = ARGV, run_already = true ) super(:vertical) reset set_commandline_arguments( commandline_arguments ) run if run_already end |
Class Method Details
.run(i = ARGV) ⇒ Object
#
MultimediaParadise::GUI::Gtk::YoutubeChannels.run
#
195 196 197 198 199 200 201 202 203 204 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 195 def self.run( i = ARGV ) require 'gtk_paradise/run' _ = ::MultimediaParadise::GUI::Gtk::YoutubeChannels.new(i) r = ::Gtk.run r << _ r.automatic r.top_left_then_run end |
Instance Method Details
#apply_custom_CSS_rules ⇒ Object
#
apply_custom_CSS_rules
#
109 110 111 112 113 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 109 def apply_custom_CSS_rules more_CSS_then_apply_these_rules '.fancy_border { border: 2px dotted royalblue; }' end |
#border_size? ⇒ Boolean
#
border_size?
#
125 126 127 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 125 def border_size? 2 end |
#connect_skeleton ⇒ Object
#
connect_skeleton (connect tag)
#
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 152 def connect_skeleton abort_on_exception bold_header = gtk_left_aligned_label(' Show video channels ') bold_header.make_bold minimal(bold_header, 5) ARRAY_ADD_THESE_CHANNELS.each_with_index {|this_channel, index| index += 1 = ( this_channel.to_s.tr('_',' ') ) .use_this_font = :dejavu_15 .on_clicked { Thread.new { do_open_this_channel_associated_URL(this_channel) } } .make_bold .bblack2 @grid.left(text(" #{index} ")) @grid.right() @grid.new_row } minimal(@grid, 28) end |
#create_grid ⇒ Object
#
create_grid
#
139 140 141 142 143 144 145 146 147 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 139 def create_grid # ======================================================================= # # === @grid # ======================================================================= # @grid = return_default_grid @grid.css_class('pad8px') @grid.css_class('mar5px') @grid.css_class('fancy_border') end |
#create_skeleton ⇒ Object
#
create_skeleton (create tag)
#
132 133 134 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 132 def create_skeleton create_grid end |
#do_open_this_channel_associated_URL(i) ⇒ Object
#
do_open_this_channel_associated_URL
#
177 178 179 180 181 182 183 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 177 def do_open_this_channel_associated_URL( i ) remote_url = BeautifulUrl[i] e 'Now opening '+sfancy(remote_url)+'.' Open.in_browser(remote_url) end |
#padding? ⇒ Boolean
#
padding?
#
118 119 120 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 118 def padding? 2 end |
#reset ⇒ Object
#
reset (reset tag)
#
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 82 def reset reset_the_internal_variables # ======================================================================= # # === @configuration # ======================================================================= # @configuration = [true, __dir__, NAMESPACE] # ======================================================================= # # === @title # ======================================================================= # @title = TITLE # ======================================================================= # # === @width # ======================================================================= # set_width(WIDTH) # ======================================================================= # # === @height # ======================================================================= # set_height(HEIGHT) set_use_this_font(USE_THIS_FONT) use_gtk_paradise_project_css_file infer_the_size_automatically apply_custom_CSS_rules end |
#run ⇒ Object
#
run (run tag)
#
188 189 190 |
# File 'lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb', line 188 def run create_skeleton_then_connect_skeleton end |