module HardwareInformation::GUI::Gtk::ShowInputDevicesModule

Constants

FONT_TO_USE_FOR_THE_SCROLLED_WINDOWS
#

FONT_TO_USE_FOR_THE_SCROLLED_WINDOWS

#
HEIGHT
#

HEIGHT

#
NAMESPACE
#

NAMESPACE

#
TITLE
#

TITLE

#
WIDTH
#

WIDTH

#

Public Class Methods

new( optional_file = nil, run_already = true ) click to toggle source
#

initialize

#
Calls superclass method
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 55
def initialize(
    optional_file = nil,
    run_already   = true
  )
  super(:vertical)
  reset
  run if run_already
end
run( i = ARGV ) click to toggle source
#

HardwareInformation::GUI::Gtk::ShowInputDevicesModule.run

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 175
def self.run(
    i = ARGV
  )
  require 'gtk_paradise/run'
  _ = ::HardwareInformation::GUI::Gtk::ShowInputDevices.new(i)
  r = ::Gtk.run
  r << _
  r.determine_the_title_from_the_child_widget
  r.set_size_request(_.width?, _.height?)
  r.top_left_then_run
end

Public Instance Methods

border_size?() click to toggle source
#

border_size?

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 100
def border_size?
  2
end
connect_skeleton() click to toggle source
#

connect_skeleton (connect tag)

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 113
def connect_skeleton
  Thread.abort_on_exception = true
  result = `xinput --list --short`.to_s.strip
  @text_buffer = gtk_text_buffer
  text_view = gtk_text_view(@text_buffer)
  text_view.set_text(result.to_s)
  scrolled_window = gtk_scrolled_window(text_view) { :always }
  scrolled_window.set_size_request(1200, 400)
  scrolled_window.set_font(FONT_TO_USE_FOR_THE_SCROLLED_WINDOWS)
  frame = gtk_frame(scrolled_window)
  frame.set_text('Show input devices')
  frame.set_border_width(10)
  frame.set_font :hack_24
  frame.make_bold
  maximal(frame, 20)
  add(gtk_separator)
  mini_hbox = gtk_hbox
  entry_for_listing_props = gtk_entry(
    'xinput --list-props "Logitech USB Optical Mouse"'
  )
  button_activate_the_entry_for_listing_props = gtk_button('run')
  button_activate_the_entry_for_listing_props.fancy_tooltips = 
    'This will run the content on the left side.'
  button_activate_the_entry_for_listing_props.set_size_request(100, 30)
  button_activate_the_entry_for_listing_props.css_class('bblack2')
  button_activate_the_entry_for_listing_props.on_clicked {
    do_fill_up_text_buffer2_with_this_content_from_that_entry(
      entry_for_listing_props
    )
  }
  mini_hbox.maximal(entry_for_listing_props, 2)
  mini_hbox.minimal(button_activate_the_entry_for_listing_props, 2)
  add(mini_hbox)
  @text_buffer2 = gtk_text_buffer
  text_view2 = gtk_text_view(@text_buffer2)
  scrolled_window2 = gtk_scrolled_window(text_view2) { :always }
  scrolled_window2.set_size_request(1200, 300)
  scrolled_window2.set_font(FONT_TO_USE_FOR_THE_SCROLLED_WINDOWS)
  add(scrolled_window2)
end
create_skeleton() click to toggle source
#

create_skeleton (create tag)

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 107
def create_skeleton
end
do_fill_up_text_buffer2_with_this_content_from_that_entry( entry_to_use ) click to toggle source
#

do_fill_up_text_buffer2_with_this_content_from_that_entry

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 157
def do_fill_up_text_buffer2_with_this_content_from_that_entry(
    entry_to_use
  )
  _ = entry_to_use.text?
  result = `#{_}`.to_s.strip
  @text_buffer2.set_text(result)
end
padding?() click to toggle source
#

padding?

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 93
def padding?
  2
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 67
def reset
  reset_the_internal_variables
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, NAMESPACE]
  # ======================================================================= #
  # === @title
  # ======================================================================= #
  @title  = TITLE
  # ======================================================================= #
  # === @width
  # ======================================================================= #
  @width  = WIDTH
  # ======================================================================= #
  # === @height
  # ======================================================================= #
  @height = HEIGHT
  set_use_this_font(:dejavu_condensed_21)
  use_gtk_paradise_project_css_file
  infer_the_size_automatically
end
run() click to toggle source
#

run (run tag)

#
# File lib/hardware_information/gui/shared_code/show_input_devices/show_input_devices_module.rb, line 168
def run
  create_skeleton_then_connect_skeleton
end