Class: DebugWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/gui/debug_window.rb

Overview

debug window class

Instance Method Summary collapse

Constructor Details

#initializeDebugWindow

Returns a new instance of DebugWindow.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/gui/debug_window.rb', line 7

def initialize()
  if $debug_console_win != nil
    return
  end
  $debug_console_win = Gtk::Window.new
  $debug_console_win.set_size_request(350,200)
  $debug_console_win.set_title "Debug console"
  $debug_console_win.resizable=false
  $debug_console_win.window_position=Gtk::Window::POS_CENTER
  icon_name="#{PIXMAP_PATH}/logo_icon.png"
  Gtk::Window.set_default_icon(icon_name)

  $debug_console_win.signal_connect("destroy") {
    $debug_console_win.destroy
    $debug_console_win = nil
  }
  $debug_console_win.signal_connect("key_press_event") {|w,e|
      if e.keyval == 65307  #Esc key press
        $debug_console_win.destroy
        $debug_console_win = nil
    end
  }

  vboxb = Gtk::VBox.new
  cpt = 0
  $thread_list.each_key {|thread_name|
    tn_label = Gtk::Label.new("#{thread_name} thread is running")
    vboxb.add tn_label
    cpt+=1
  }

  if cpt == 0
    tn_label = Gtk::Label.new("No thread is running")
    vboxb.add tn_label   
  end
  $debug_console_win.add vboxb
  $debug_console_win.show_all

end