Class: GamesAndRpgParadise::GUI::Gtk::SearchForThisMagicCard

Inherits:
Gtk::Box
  • Object
show all
Includes:
Gtk::BaseModule
Defined in:
lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb

Overview

GamesAndRpgParadise::GUI::Gtk::SearchForThisMagicCard

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect
TITLE =
#

TITLE

#
'Search for this magic card'
WIDTH =
#

WIDTH

#
'25% or minimum 200px'
HEIGHT =
#

HEIGHT

#
'15% or minimum 100px'
USE_THIS_FONT =
#

USE_THIS_FONT

#
:dejavu_condensed_20

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commandline_arguments = ARGV, run_already = true) ⇒ SearchForThisMagicCard

#

initialize

#


53
54
55
56
57
58
59
60
61
62
63
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 53

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

#

GamesAndRpgParadise::GUI::Gtk::SearchForThisMagicCard.run

#


144
145
146
147
148
149
150
151
152
153
154
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 144

def self.run(
    i = ARGV
  )
  require 'gtk_paradise/run'
  _ = ::GamesAndRpgParadise::GUI::Gtk::SearchForThisMagicCard.new(i)
  r = ::Gtk.run
  r << _
  r.automatic_size_then_automatic_title
  r.show_all
  r.top_left_then_run
end

Instance Method Details

#border_size?Boolean

#

border_size?

#

Returns:

  • (Boolean)


89
90
91
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 89

def border_size?
  12
end

#connect_skeletonObject

#

connect_skeleton (connect tag)

#


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 111

def connect_skeleton
  abort_on_exception
  hbox = gtk_hbox
  @entry = gtk_entry
  @entry.bblack1
  @entry.very_light_yellowish_background
  @entry.width_height(500, 30)
  button = button('_Search for this card')
  button.clear_background
  button.bblack2
  button.on_hover(:whitesmoke)
  button.pad8px
  button.on_clicked {
    the_button_was_clicked
  }
  hbox.minimal(@entry, 5)
  hbox.minimal(button, 5)
  minimal(hbox)
  @entry.on_enter {
    the_button_was_clicked
  }
end

#create_skeletonObject

#

create_skeleton (create tag)

#


96
97
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 96

def create_skeleton
end

#padding?Boolean

#

padding?

#

Returns:

  • (Boolean)


82
83
84
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 82

def padding?
  18
end

#resetObject

#

reset (reset tag)

#


68
69
70
71
72
73
74
75
76
77
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 68

def reset
  reset_the_internal_variables
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, NAMESPACE]
  title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
  use_gtk_paradise_project_css_file 
  infer_the_size_automatically
end

#runObject

#

run (run tag)

#


137
138
139
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 137

def run
  super()
end

#the_button_was_clickedObject

#

the_button_was_clicked

#


102
103
104
105
106
# File 'lib/games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb', line 102

def the_button_was_clicked
  @entry.do_upcase_the_first_character # Looks visually nicer, IMO.
  _ = @entry.text?
  GamesAndRpgParadise::MagicTheGathering::SearchForThisMagicCard.new(_)
end