class MultimediaParadise::GUI::Libui::YoutubeChannels

Constants

ARRAY_ADD_THESE_CHANNELS
#

ARRAY_ADD_THESE_CHANNELS

#

Public Class Methods

new() click to toggle source
#

initialize

#
# File lib/multimedia_paradise/gui/libui/youtube_channels/youtube_channels.rb, line 41
def initialize
  reset
  create_skeleton
  @main_window = ui_main_window(
    'YoutubeChannels', 300, 300, 0
  )
  outer_vbox = ui_vbox
  outer_vbox.is_padded
  outer_vbox.minimal(
    ui_text('Show video channels')
  )

  ARRAY_ADD_THESE_CHANNELS.each_with_index {|this_channel, index|
    use_this_button = ui_button(
      this_channel.
      to_s.tr('_',' ').
      center(65)
    )
    use_this_button.on_clicked {
      Thread.new {
        do_open_this_channel_associated_URL(this_channel)
      }
    }
    @grid.ui_grid_append(
      ui_text(" #{index+1} "),
      0, 0+index, 1, 1, 1, 1, 1, 1
    )
    @grid.ui_grid_append(
      use_this_button,
      1, 0+index, 2, 1, 1, 1, 1, 1
    )
  }
  outer_vbox.maximal(@grid)
  @main_window.child = outer_vbox
  @main_window.intelligent_exit
end

Public Instance Methods

create_skeleton() click to toggle source
#

create_skeleton

#
# File lib/multimedia_paradise/gui/libui/youtube_channels/youtube_channels.rb, line 98
def create_skeleton
  create_the_grid
end
create_the_grid() click to toggle source
#

create_the_grid

#
# File lib/multimedia_paradise/gui/libui/youtube_channels/youtube_channels.rb, line 105
def create_the_grid
  # ======================================================================= #
  # === @grid
  # ======================================================================= #
  @grid = ui_grid
end
do_open_this_channel_associated_URL( i ) click to toggle source
#

do_open_this_channel_associated_URL

#
# File lib/multimedia_paradise/gui/libui/youtube_channels/youtube_channels.rb, line 81
def do_open_this_channel_associated_URL(
    i
  )
  remote_url = BeautifulUrl[i]
  e 'Now opening '+::Colours.sfancy(remote_url)+'.'
  Open.in_browser(remote_url)
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/multimedia_paradise/gui/libui/youtube_channels/youtube_channels.rb, line 92
def reset
end