Module: Bioroebe::GUI::LibUI::ShowCodonTable

Includes:
ShowCodonTableModule, LibuiParadise::Extensions
Defined in:
lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb

Overview

Bioroebe::GUI::LibUI::ShowCodonTable

Constant Summary collapse

TITLE =
#

TITLE

#
'Show Codon Table'

Constants included from ShowCodonTableModule

ShowCodonTableModule::HEIGHT, ShowCodonTableModule::WIDTH

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ShowCodonTableModule

#active_text?, #border_size?, #padding?, #reset_the_shared_module

Class Method Details

.runObject

#

Bioroebe::GUI::LibUI::ShowCodonTable.run

#

122
123
124
125
126
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 122

def self.run
  object = Object.new
  object.extend(ShowCodonTable)
  object.reset_then_run
end

Instance Method Details

#create_skeletonObject

#

create_skeleton (create tag)

#

55
56
57
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 55

def create_skeleton
  create_the_combo_box
end

#create_the_combo_boxObject

#

create_the_combo_box

#

62
63
64
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 62

def create_the_combo_box
  @combo_box_containing_the_registered_codon_tables = ui_combobox
end

#initializeObject

#

initialize

#

33
34
35
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 33

def initialize
  reset
end

#resetObject

#

reset

#

48
49
50
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 48

def reset
  reset_the_shared_module
end

#reset_then_runObject

#

reset_then_run

#

40
41
42
43
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 40

def reset_then_run
  reset
  run
end

#runObject

#

run

#

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/bioroebe/gui/libui/show_codon_table/show_codon_table.rb', line 69

def run
  create_skeleton
  hash = ::Bioroebe.hash_codon_tables?
  values = hash.values
  main_window = margined_window(TITLE, 1200, 200, 0)
  @toplabel = text(values.first.to_s)

  # combobox_selected_callback = proc { |pointer_to_index|
  #   index = UI.combobox_selected(pointer_to_index)
  #  selected_text = values[index].to_s
  #   main_hash?[
  #     @toplabel.object_id
  #   ].first..set_text(selected_text)
  # }

  outer_vbox    = padded_vbox
  toplevel_hbox = padded_hbox

  toplevel_hbox.maximal(@toplabel)
  outer_vbox << toplevel_hbox
  @text_buffer = text_view
  outer_vbox << @text_buffer
  hbox = padded_hbox
  _ = text('Select the codon table (default: eukaryotes) → ')
  hbox.minimal(_)
  create_the_combo_box

  combobox_selected_callback = proc {|pointer|
    e 'The active text was: '+active_text?
  }
  UI.combobox_on_selected(
    @combo_box_containing_the_registered_codon_tables,
    combobox_selected_callback,
    nil
  )
  @combo_box_containing_the_registered_codon_tables.append_this_array(hash.values)
  hbox.maximal(
    @combo_box_containing_the_registered_codon_tables
  )
  outer_vbox << hbox
  @button_do_analyse = button('Do Analyse')
  @button_do_analyse.on_clicked {
e 'clicked'
  }

  outer_vbox << @button_do_analyse
  main_window.child = outer_vbox
  main_window.complex_finalizer
end