class MultimediaParadise::GUI::Gtk::YoutubeChannels

Constants

ARRAY_ADD_THESE_CHANNELS
#

ARRAY_ADD_THESE_CHANNELS

#
HEIGHT
#

HEIGHT

#
NAMESPACE
#

NAMESPACE

#
TITLE
#

TITLE

#
USE_THIS_FONT
#

USE_THIS_FONT

#
WIDTH
#

WIDTH

#

Public Class Methods

new( commandline_arguments = ARGV, run_already = true ) click to toggle source
#

initialize

#
Calls superclass method
# 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
run( i = ARGV ) click to toggle source
#

MultimediaParadise::GUI::Gtk::YoutubeChannels.run

#
# 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

Public Instance Methods

apply_custom_CSS_rules() click to toggle source
#

apply_custom_CSS_rules

#
# 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?() click to toggle source
#

border_size?

#
# File lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb, line 125
def border_size?
  2
end
connect_skeleton() click to toggle source
#

connect_skeleton (connect tag)

#
# 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
    button = gtk_button(
      this_channel.to_s.tr('_',' ')
    )
    button.use_this_font = :dejavu_15
    button.on_clicked {
      Thread.new { do_open_this_channel_associated_URL(this_channel) }
    }
    button.make_bold
    button.bblack2
    @grid.left(text(" #{index} "))
    @grid.right(button)
    @grid.new_row
  }
  minimal(@grid, 28)
end
create_grid() click to toggle source
#

create_grid

#
# 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() click to toggle source
#

create_skeleton (create tag)

#
# 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 ) click to toggle source
#

do_open_this_channel_associated_URL

#
# 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?() click to toggle source
#

padding?

#
# File lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb, line 118
def padding?
  2
end
reset() click to toggle source
#

reset (reset tag)

#
# 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() click to toggle source
#

run (run tag)

#
# File lib/multimedia_paradise/gui/gtk3/youtube_channels/youtube_channels.rb, line 188
def run
  create_skeleton_then_connect_skeleton
end