Class: Bioroebe::GUI::Gtk::Snapgene

Inherits:
Gtk::Box
  • Object
show all
Includes:
Gtk::BaseModule
Defined in:
lib/bioroebe/gui/experimental/snapgene/snapgene.rb

Overview

Bioroebe::GUI::Gtk::Snapgene

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect
TITLE =
#

TITLE

#
'Snapgene'
WIDTH =
#

WIDTH

#
'45% 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) ⇒ Snapgene

#

initialize

#

51
52
53
54
55
56
57
58
59
60
61
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 51

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

#

Bioroebe::GUI::Gtk::Snapgene.run

#

131
132
133
134
135
136
137
138
139
140
141
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 131

def self.run(
    i = ARGV
  )
  require 'gtk_paradise/app/app.rb'
  _ = ::Bioroebe::GUI::Gtk::Snapgene.new(i)
  r = ::Gtk.run
  r << _
  r.automatic_size_then_automatic_title
  # r.enable_quick_exit
  r.top_left_then_run
end

Instance Method Details

#border_size?Boolean

#

border_size?

#

Returns:

  • (Boolean)

87
88
89
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 87

def border_size?
  2
end

#connect_skeletonObject

#

connect_skeleton (connect tag)

#

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 100

def connect_skeleton
  abort_on_exception
  left_pane  = gtk_vbox
  right_pane = gtk_vbox
  hbox1 = gtk_hbox
  hbox1.minimal(text('Lane 1: '))
  entry1 = gtk_entry
  entry1.width_height(220, 30)
  hbox1.minimal(entry1, 2)
  entry2 = gtk_entry('cut with')
  entry2.width_height(220, 30)
  hbox1.minimal(entry2, 2)
  right_pane.minimal(hbox1, 1)
  left_pane.minimal(gtk_image(
    'https://i.imgur.com/Ytw7PiC.jpg'
  ))
  minimal(
    draggable_via_left_and_right_movement(left_pane, right_pane)
  )
end

#create_skeletonObject

#

create_skeleton (create tag)

#

94
95
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 94

def create_skeleton
end

#padding?Boolean

#

padding?

#

Returns:

  • (Boolean)

80
81
82
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 80

def padding?
  4
end

#resetObject

#

reset (reset tag)

#

66
67
68
69
70
71
72
73
74
75
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 66

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)

#

124
125
126
# File 'lib/bioroebe/gui/experimental/snapgene/snapgene.rb', line 124

def run
  create_skeleton_then_connect_skeleton
end