class RBT::GUI::Gtk::UrlAction

Constants

HEIGHT
#

HEIGHT

#
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/rbt/gui/gtk/url_action/url_action.rb, line 52
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
#

RBT::GUI::Gtk::UrlAction.run

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 188
def self.run(
    i = ARGV
  )
  require 'gtk_paradise/app/app.rb'
  _ = ::RBT::GUI::Gtk::UrlAction.new(i)
  r = ::Gtk.run
  r << _
  r.automatic_size_then_automatic_title
  r.enable_quick_exit
  r.top_left_then_run
end

Public Instance Methods

border_size?() click to toggle source
#

border_size?

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 114
def border_size?
  2
end
connect_skeleton() click to toggle source
#

connect_skeleton (connect tag)

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 169
def connect_skeleton
  abort_on_exception
  hbox = gtk_hbox
  hbox.maximal @entry, 4
  hbox.maximal @button,4
  add hbox
  add @source_view # @scrolled_window
end
create_buttons() click to toggle source
#

create_buttons (buttons tag)

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 89
def create_buttons
  # ======================================================================= #
  # === @button
  # ======================================================================= #
  @button = coloured_button('_Send Message_cyan')
  @button.on_clicked { send_message_to_url_action(@entry.text) }  
end
create_entries() click to toggle source
#

create_entries

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 130
def create_entries
  # ========================================================================== #
  # === @entry
  # ========================================================================== #
  @entry = gtk_entry
  @entry.set_max_length 50
  # @entry.set_activates_default(true)
  @entry.signal_connect(:key_press_event) { |widget, event|
    key_pressed = Gdk::Keyval.to_name(event.keyval)
    case key_pressed
    when 'Return','KP_Enter'
      @entry.set_focus true
      @button.signal_emit :clicked
    else # debug info
      # pp key_pressed
    end
  }
end
create_scrolled_windows() click to toggle source
#

create_scrolled_windows

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 152
def create_scrolled_windows
  @source_buffer = ::Gtk::SourceBuffer.new
  @source_view   = ::Gtk::SourceView.new(@source_buffer) 
end
create_skeleton() click to toggle source
#

create_skeleton (create tag, skeleton tag)

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 160
def create_skeleton
  create_scrolled_windows
  create_buttons
  create_entries
end
padding?() click to toggle source
#

padding?

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 107
def padding?
  4
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 67
def reset
  reset_the_internal_variables
  infer_the_namespace
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, namespace?]
  # ======================================================================= #
  # === Set the title, width, height and the font in use.
  # ======================================================================= #
  title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
  use_gtk_paradise_project_css_file 
  infer_the_size_automatically
  # ======================================================================= #
  # === @url_action
  # ======================================================================= #
  @url_action = ::RBT::UrlAction.new('', :do_not_run_yet)
end
run() click to toggle source
#

run (run tag)

#
Calls superclass method
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 181
def run
  super()
end
send_message_to_url_action(this_action = 'query/wget') click to toggle source
#

send_message_to_url_action

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 121
def send_message_to_url_action(this_action = 'query/wget')
  @url_action.set_action(this_action)
  @url_action.run
  set_buffer_text(@url_action.result)
end
set_buffer_text(i) click to toggle source
#

set_buffer_text

#
# File lib/rbt/gui/gtk/url_action/url_action.rb, line 100
def set_buffer_text(i)
  @source_buffer.text = i
end