visualruby 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/bin/editor/VR_Document.rb +219 -0
- data/bin/editor/VR_TabSearch.rb +50 -0
- data/bin/editor/VR_Tabs.rb +99 -0
- data/bin/editor/VR_TextShell.rb +83 -0
- data/bin/editor/VR_TextViewCommon.rb +65 -0
- data/bin/editor/glade/VR_Document.glade +160 -0
- data/bin/main/GemTree.rb +23 -0
- data/bin/main/NewProjectGUI.rb +28 -0
- data/bin/main/ProjectChooserGUI.rb +41 -0
- data/bin/main/ProjectChooserView.rb +39 -0
- data/bin/main/RubygemsAPI.rb +93 -0
- data/bin/main/Splash.rb +22 -0
- data/bin/main/VR_ENV.rb +61 -0
- data/bin/main/VR_ENV_GLOBAL.rb +64 -0
- data/bin/main/VR_File_Tree.rb +120 -0
- data/bin/main/VR_Local_Gem_Tree.rb +80 -0
- data/bin/main/VR_Main.rb +313 -0
- data/bin/main/VR_Remote_Gem_Tree.rb +70 -0
- data/bin/main/glade/NewProjectGUI.glade +141 -0
- data/bin/main/glade/ProjectChooserGUI.glade +140 -0
- data/bin/main/glade/RubygemsAPI.glade +130 -0
- data/bin/main/glade/Splash.glade +18 -0
- data/bin/main/glade/VR_ENV.glade +168 -0
- data/bin/main/glade/VR_ENV_GLOBAL.glade +268 -0
- data/bin/main/glade/VR_File_Tree.glade +65 -0
- data/bin/main/glade/VR_Local_Gem_Tree.glade +45 -0
- data/bin/main/glade/VR_Main.glade +707 -0
- data/bin/main/glade/VR_Remote_Gem_Tree.glade +76 -0
- data/bin/tools/VR_Tools.rb +120 -0
- data/img/close.png +0 -0
- data/img/folder.png +0 -0
- data/img/glade.png +0 -0
- data/img/gtk-edit.png +0 -0
- data/img/obj.png +0 -0
- data/img/png.png +0 -0
- data/img/rb.png +0 -0
- data/img/ruby.png +0 -0
- data/img/splash.png +0 -0
- data/img/unknown.png +0 -0
- data/skeleton/document/New.glade +13 -0
- data/skeleton/document/NewWindow.rb +15 -0
- data/skeleton/project/bin/MyClass.rb +15 -0
- data/skeleton/project/bin/glade/MyClass.glade +45 -0
- data/skeleton/project/main.rb +14 -0
- data/visualruby_examples/active_record/.vr_settings.yaml +47 -0
- data/visualruby_examples/active_record/active_record.rb +52 -0
- data/visualruby_examples/active_record/bin/ChoosePerson.rb +17 -0
- data/visualruby_examples/active_record/bin/Person.rb +13 -0
- data/visualruby_examples/active_record/bin/glade/ChoosePerson.glade +61 -0
- data/visualruby_examples/active_record/bin/glade/Person.glade +148 -0
- data/visualruby_examples/active_record/db/development.sqlite3 +0 -0
- data/visualruby_examples/active_record2/.vr_settings.yaml +48 -0
- data/visualruby_examples/active_record2/active_record2.rb +142 -0
- data/visualruby_examples/active_record2/bin/CompanyGUI.rb +54 -0
- data/visualruby_examples/active_record2/bin/Employee.rb +20 -0
- data/visualruby_examples/active_record2/bin/Employer.rb +11 -0
- data/visualruby_examples/active_record2/bin/Paycheck.rb +11 -0
- data/visualruby_examples/active_record2/bin/glade/CompanyGUI.glade +167 -0
- data/visualruby_examples/active_record2/bin/glade/Employee.glade +123 -0
- data/visualruby_examples/active_record2/bin/glade/Employer.glade +147 -0
- data/visualruby_examples/active_record2/bin/glade/Paycheck.glade +145 -0
- data/visualruby_examples/active_record2/db/development.sqlite3 +0 -0
- data/visualruby_examples/all_widgets/.vr_settings.yaml +20 -0
- data/visualruby_examples/all_widgets/all_widgets.rb +13 -0
- data/visualruby_examples/all_widgets/bin/AllWidgets.rb +43 -0
- data/visualruby_examples/all_widgets/bin/glade/AllWidgets.glade +166 -0
- data/visualruby_examples/all_widgets/bin/splash.png +0 -0
- data/visualruby_examples/calculator/.vr_settings.yaml +21 -0
- data/visualruby_examples/calculator/bin/Calculator.rb +63 -0
- data/visualruby_examples/calculator/bin/glade/Calculator.glade +243 -0
- data/visualruby_examples/calculator/main.rb +13 -0
- data/visualruby_examples/child_window/.vr_settings.yaml +46 -0
- data/visualruby_examples/child_window/bin/ChildWindowDemo.rb +41 -0
- data/visualruby_examples/child_window/bin/MyChildClass.rb +42 -0
- data/visualruby_examples/child_window/bin/glade/ChildWindowDemo.glade +101 -0
- data/visualruby_examples/child_window/bin/glade/MyChildClass.glade +58 -0
- data/visualruby_examples/child_window/main.rb +13 -0
- data/visualruby_examples/drag_drop/.vr_settings.yaml +19 -0
- data/visualruby_examples/drag_drop/bin/DragDropDemo.rb +45 -0
- data/visualruby_examples/drag_drop/bin/glade/DragDropDemo.glade +143 -0
- data/visualruby_examples/drag_drop/img/folder.png +0 -0
- data/visualruby_examples/drag_drop/img/glade.png +0 -0
- data/visualruby_examples/drag_drop/img/gtk-edit.png +0 -0
- data/visualruby_examples/drag_drop/img/obj.png +0 -0
- data/visualruby_examples/drag_drop/img/png.png +0 -0
- data/visualruby_examples/drag_drop/img/rb.png +0 -0
- data/visualruby_examples/drag_drop/img/ruby.png +0 -0
- data/visualruby_examples/drag_drop/img/unknown.png +0 -0
- data/visualruby_examples/drag_drop/main.rb +14 -0
- data/visualruby_examples/listview/.vr_settings.yaml +46 -0
- data/visualruby_examples/listview/bin/SongListView.rb +89 -0
- data/visualruby_examples/listview/bin/SongListViewGUI.rb +67 -0
- data/visualruby_examples/listview/bin/audio-x-generic.png +0 -0
- data/visualruby_examples/listview/bin/glade/SongListViewGUI.glade +220 -0
- data/visualruby_examples/listview/main.rb +19 -0
- data/visualruby_examples/listview_objects/.vr_settings.yaml +46 -0
- data/visualruby_examples/listview_objects/bin/DataObject.rb +32 -0
- data/visualruby_examples/listview_objects/bin/DataObjectGUI.rb +41 -0
- data/visualruby_examples/listview_objects/bin/ListViewObjects.rb +34 -0
- data/visualruby_examples/listview_objects/bin/ListViewObjectsGUI.rb +18 -0
- data/visualruby_examples/listview_objects/bin/glade/DataObject.glade +198 -0
- data/visualruby_examples/listview_objects/bin/glade/ListViewObjectsGUI.glade +102 -0
- data/visualruby_examples/listview_objects/main.rb +13 -0
- data/visualruby_examples/simple_ruby_gui/.vr_settings.yaml +45 -0
- data/visualruby_examples/simple_ruby_gui/bin/DataObjectGUI.rb +20 -0
- data/visualruby_examples/simple_ruby_gui/bin/glade/DataObjectGUI.glade +163 -0
- data/visualruby_examples/simple_ruby_gui/simple_ruby_gui +16 -0
- data/visualruby_examples/treeview/.vr_settings.yaml +18 -0
- data/visualruby_examples/treeview/bin/MyClass.rb +28 -0
- data/visualruby_examples/treeview/bin/glade/MyClass.glade +48 -0
- data/visualruby_examples/treeview/main.rb +14 -0
- data/vr +40 -0
- metadata +202 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<interface>
|
|
3
|
+
<requires lib="gtk+" version="2.16"/>
|
|
4
|
+
<!-- interface-naming-policy project-wide -->
|
|
5
|
+
<object class="GtkWindow" id="window1">
|
|
6
|
+
<property name="visible">True</property>
|
|
7
|
+
<property name="can_focus">False</property>
|
|
8
|
+
<property name="title" translatable="yes">ListView Objects</property>
|
|
9
|
+
<property name="modal">True</property>
|
|
10
|
+
<property name="default_width">700</property>
|
|
11
|
+
<property name="default_height">460</property>
|
|
12
|
+
<signal name="destroy" handler="destroy_window" swapped="no"/>
|
|
13
|
+
<child>
|
|
14
|
+
<object class="GtkHBox" id="hbox1">
|
|
15
|
+
<property name="visible">True</property>
|
|
16
|
+
<property name="can_focus">False</property>
|
|
17
|
+
<child>
|
|
18
|
+
<object class="GtkVBox" id="vbox1">
|
|
19
|
+
<property name="visible">True</property>
|
|
20
|
+
<property name="can_focus">False</property>
|
|
21
|
+
<child>
|
|
22
|
+
<object class="GtkLabel" id="label2">
|
|
23
|
+
<property name="visible">True</property>
|
|
24
|
+
<property name="can_focus">False</property>
|
|
25
|
+
<property name="label" translatable="yes"><big><big><big>ListView Objects</big></big></big>
|
|
26
|
+
Try double-clicking on each field to edit an object. Also, try entering invalid email addresses.</property>
|
|
27
|
+
<property name="use_markup">True</property>
|
|
28
|
+
</object>
|
|
29
|
+
<packing>
|
|
30
|
+
<property name="expand">True</property>
|
|
31
|
+
<property name="fill">True</property>
|
|
32
|
+
<property name="position">0</property>
|
|
33
|
+
</packing>
|
|
34
|
+
</child>
|
|
35
|
+
<child>
|
|
36
|
+
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
|
37
|
+
<property name="visible">True</property>
|
|
38
|
+
<property name="can_focus">True</property>
|
|
39
|
+
<property name="hscrollbar_policy">automatic</property>
|
|
40
|
+
<property name="vscrollbar_policy">automatic</property>
|
|
41
|
+
<child>
|
|
42
|
+
<placeholder/>
|
|
43
|
+
</child>
|
|
44
|
+
</object>
|
|
45
|
+
<packing>
|
|
46
|
+
<property name="expand">True</property>
|
|
47
|
+
<property name="fill">True</property>
|
|
48
|
+
<property name="padding">15</property>
|
|
49
|
+
<property name="position">1</property>
|
|
50
|
+
</packing>
|
|
51
|
+
</child>
|
|
52
|
+
<child>
|
|
53
|
+
<object class="GtkFrame" id="frame1">
|
|
54
|
+
<property name="height_request">120</property>
|
|
55
|
+
<property name="visible">True</property>
|
|
56
|
+
<property name="can_focus">False</property>
|
|
57
|
+
<property name="label_xalign">0</property>
|
|
58
|
+
<property name="shadow_type">in</property>
|
|
59
|
+
<child>
|
|
60
|
+
<object class="GtkAlignment" id="alignment1">
|
|
61
|
+
<property name="visible">True</property>
|
|
62
|
+
<property name="can_focus">False</property>
|
|
63
|
+
<property name="left_padding">12</property>
|
|
64
|
+
<child>
|
|
65
|
+
<object class="GtkLabel" id="labelQuote">
|
|
66
|
+
<property name="width_request">600</property>
|
|
67
|
+
<property name="visible">True</property>
|
|
68
|
+
<property name="can_focus">False</property>
|
|
69
|
+
<property name="label" translatable="yes">label</property>
|
|
70
|
+
<property name="wrap">True</property>
|
|
71
|
+
</object>
|
|
72
|
+
</child>
|
|
73
|
+
</object>
|
|
74
|
+
</child>
|
|
75
|
+
<child type="label">
|
|
76
|
+
<object class="GtkLabel" id="labelQ">
|
|
77
|
+
<property name="visible">True</property>
|
|
78
|
+
<property name="can_focus">False</property>
|
|
79
|
+
<property name="label" translatable="yes"><b>Quote</b></property>
|
|
80
|
+
<property name="use_markup">True</property>
|
|
81
|
+
</object>
|
|
82
|
+
</child>
|
|
83
|
+
</object>
|
|
84
|
+
<packing>
|
|
85
|
+
<property name="expand">False</property>
|
|
86
|
+
<property name="fill">False</property>
|
|
87
|
+
<property name="padding">14</property>
|
|
88
|
+
<property name="position">2</property>
|
|
89
|
+
</packing>
|
|
90
|
+
</child>
|
|
91
|
+
</object>
|
|
92
|
+
<packing>
|
|
93
|
+
<property name="expand">True</property>
|
|
94
|
+
<property name="fill">True</property>
|
|
95
|
+
<property name="padding">15</property>
|
|
96
|
+
<property name="position">0</property>
|
|
97
|
+
</packing>
|
|
98
|
+
</child>
|
|
99
|
+
</object>
|
|
100
|
+
</child>
|
|
101
|
+
</object>
|
|
102
|
+
</interface>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
|
|
3
|
+
require 'vrlib'
|
|
4
|
+
|
|
5
|
+
#make program output in real time so errors visible in VR.
|
|
6
|
+
STDOUT.sync = true
|
|
7
|
+
STDERR.sync = true
|
|
8
|
+
|
|
9
|
+
#everything in these directories will be included
|
|
10
|
+
my_path = File.expand_path(File.dirname(__FILE__))
|
|
11
|
+
require_all Dir.glob(my_path + "/bin/**/*.rb")
|
|
12
|
+
|
|
13
|
+
ListViewObjectsGUI.new.show
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:VR_ENV
|
|
2
|
+
backup_path: /home/eric
|
|
3
|
+
browser: firefox
|
|
4
|
+
current_file: /home/eric/vrp/vrx/visualruby_examples/simple_ruby_gui/simple_ruby_gui
|
|
5
|
+
font_name: Monospace 10
|
|
6
|
+
glade_path: glade-gtk2
|
|
7
|
+
height: 639
|
|
8
|
+
open_files:
|
|
9
|
+
- /home/eric/vrp/vrx/visualruby_examples/simple_ruby_gui/bin/DataObjectGUI.rb
|
|
10
|
+
- /home/eric/vrp/vrx/visualruby_examples/simple_ruby_gui/simple_ruby_gui
|
|
11
|
+
open_folders:
|
|
12
|
+
- /home/eric/vrp/vrx/visualruby_examples/simple_ruby_gui
|
|
13
|
+
- /home/eric/vrp/vrx/visualruby_examples/simple_ruby_gui/bin
|
|
14
|
+
- /home/eric/vrp/vrx/visualruby_examples/simple_ruby_gui/bin/glade
|
|
15
|
+
panel_pos: 360
|
|
16
|
+
rdoc_command_line: rdoc -x README
|
|
17
|
+
run_command_line: ruby simple_ruby_gui
|
|
18
|
+
tab_spaces: 2
|
|
19
|
+
width: 1122
|
|
20
|
+
builder: !ruby/object:Gtk::Builder {}
|
|
21
|
+
glade_box: !ruby/object:VR::SimpleComboBoxEntry {}
|
|
22
|
+
browser_box: !ruby/object:VR::SimpleComboBoxEntry {}
|
|
23
|
+
buttonChooseFolder: ! '...'
|
|
24
|
+
vbox1: !ruby/object:Gtk::VBox {}
|
|
25
|
+
label7: ! 'Editor Font:'
|
|
26
|
+
label3: ! 'Back-up Path:'
|
|
27
|
+
window1: !ruby/object:Gtk::Window {}
|
|
28
|
+
hbuttonbox1: !ruby/object:Gtk::HButtonBox {}
|
|
29
|
+
buttonCancel: Cancel
|
|
30
|
+
label8: ! 'RDoc Command Line: '
|
|
31
|
+
table1: !ruby/object:Gtk::Table {}
|
|
32
|
+
buttonTryBrowser: Try
|
|
33
|
+
buttonSave: Save
|
|
34
|
+
hboxBrowser: !ruby/object:Gtk::HBox {}
|
|
35
|
+
hboxGlade: !ruby/object:Gtk::HBox {}
|
|
36
|
+
label1: <big><big><b>Visual Ruby Settings</b></big></big>
|
|
37
|
+
label2: ! 'Browser Command Line:'
|
|
38
|
+
label4: ! 'Spaces for Each Tab in Editor:'
|
|
39
|
+
label5: ! 'Glade Command Line:'
|
|
40
|
+
label6: ! 'Command Line when "Run" is pressed:'
|
|
41
|
+
hbox1: !ruby/object:Gtk::HBox {}
|
|
42
|
+
hbox2: !ruby/object:Gtk::HBox {}
|
|
43
|
+
hbox3: !ruby/object:Gtk::HBox {}
|
|
44
|
+
hbox4: !ruby/object:Gtk::HBox {}
|
|
45
|
+
buttonTryGlade: Try
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
class DataObjectGUI
|
|
3
|
+
|
|
4
|
+
include GladeGUI
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def initialize(name, address, phone, email)
|
|
8
|
+
super() #loads glade file and creates variables: @name, @address etc. from glade form names
|
|
9
|
+
@name.text = name
|
|
10
|
+
@address.text = address
|
|
11
|
+
@phone.text = phone
|
|
12
|
+
@email.text = email
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def buttonShow__clicked(button)
|
|
16
|
+
VR::msg "Curent values:\n\n#{@name.text}\n#{@address.text}\n#{@email.text}\n#{@phone.text}\n"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<interface>
|
|
3
|
+
<requires lib="gtk+" version="2.16"/>
|
|
4
|
+
<!-- interface-naming-policy project-wide -->
|
|
5
|
+
<object class="GtkWindow" id="window1">
|
|
6
|
+
<property name="visible">True</property>
|
|
7
|
+
<property name="title" translatable="yes">Basic Object Demo</property>
|
|
8
|
+
<property name="modal">True</property>
|
|
9
|
+
<property name="window_position">center-always</property>
|
|
10
|
+
<signal name="destroy" handler="destroy_window"/>
|
|
11
|
+
<child>
|
|
12
|
+
<object class="GtkHBox" id="hbox1">
|
|
13
|
+
<property name="visible">True</property>
|
|
14
|
+
<child>
|
|
15
|
+
<object class="GtkVBox" id="vbox1">
|
|
16
|
+
<property name="visible">True</property>
|
|
17
|
+
<property name="spacing">10</property>
|
|
18
|
+
<child>
|
|
19
|
+
<object class="GtkLabel" id="label5">
|
|
20
|
+
<property name="visible">True</property>
|
|
21
|
+
<property name="label" translatable="yes"><big><big>Basic Object Demo</big></big>
|
|
22
|
+
This was created with visualruby. See visualruby.net.</property>
|
|
23
|
+
<property name="use_markup">True</property>
|
|
24
|
+
</object>
|
|
25
|
+
<packing>
|
|
26
|
+
<property name="padding">10</property>
|
|
27
|
+
<property name="position">0</property>
|
|
28
|
+
</packing>
|
|
29
|
+
</child>
|
|
30
|
+
<child>
|
|
31
|
+
<object class="GtkTable" id="table1">
|
|
32
|
+
<property name="visible">True</property>
|
|
33
|
+
<property name="n_rows">4</property>
|
|
34
|
+
<property name="n_columns">2</property>
|
|
35
|
+
<property name="column_spacing">7</property>
|
|
36
|
+
<property name="row_spacing">10</property>
|
|
37
|
+
<child>
|
|
38
|
+
<object class="GtkLabel" id="label1">
|
|
39
|
+
<property name="visible">True</property>
|
|
40
|
+
<property name="xalign">1</property>
|
|
41
|
+
<property name="label" translatable="yes">Name:</property>
|
|
42
|
+
</object>
|
|
43
|
+
</child>
|
|
44
|
+
<child>
|
|
45
|
+
<object class="GtkLabel" id="label2">
|
|
46
|
+
<property name="visible">True</property>
|
|
47
|
+
<property name="xalign">1</property>
|
|
48
|
+
<property name="label" translatable="yes">Address:</property>
|
|
49
|
+
</object>
|
|
50
|
+
<packing>
|
|
51
|
+
<property name="top_attach">1</property>
|
|
52
|
+
<property name="bottom_attach">2</property>
|
|
53
|
+
</packing>
|
|
54
|
+
</child>
|
|
55
|
+
<child>
|
|
56
|
+
<object class="GtkLabel" id="label3">
|
|
57
|
+
<property name="visible">True</property>
|
|
58
|
+
<property name="xalign">1</property>
|
|
59
|
+
<property name="label" translatable="yes">Email:</property>
|
|
60
|
+
</object>
|
|
61
|
+
<packing>
|
|
62
|
+
<property name="top_attach">2</property>
|
|
63
|
+
<property name="bottom_attach">3</property>
|
|
64
|
+
</packing>
|
|
65
|
+
</child>
|
|
66
|
+
<child>
|
|
67
|
+
<object class="GtkLabel" id="label4">
|
|
68
|
+
<property name="visible">True</property>
|
|
69
|
+
<property name="xalign">1</property>
|
|
70
|
+
<property name="label" translatable="yes">Phone</property>
|
|
71
|
+
</object>
|
|
72
|
+
<packing>
|
|
73
|
+
<property name="top_attach">3</property>
|
|
74
|
+
<property name="bottom_attach">4</property>
|
|
75
|
+
</packing>
|
|
76
|
+
</child>
|
|
77
|
+
<child>
|
|
78
|
+
<object class="GtkEntry" id="DataObjectGUI.name">
|
|
79
|
+
<property name="visible">True</property>
|
|
80
|
+
<property name="can_focus">True</property>
|
|
81
|
+
<property name="invisible_char">•</property>
|
|
82
|
+
</object>
|
|
83
|
+
<packing>
|
|
84
|
+
<property name="left_attach">1</property>
|
|
85
|
+
<property name="right_attach">2</property>
|
|
86
|
+
</packing>
|
|
87
|
+
</child>
|
|
88
|
+
<child>
|
|
89
|
+
<object class="GtkEntry" id="DataObjectGUI.address">
|
|
90
|
+
<property name="visible">True</property>
|
|
91
|
+
<property name="can_focus">True</property>
|
|
92
|
+
<property name="invisible_char">•</property>
|
|
93
|
+
</object>
|
|
94
|
+
<packing>
|
|
95
|
+
<property name="left_attach">1</property>
|
|
96
|
+
<property name="right_attach">2</property>
|
|
97
|
+
<property name="top_attach">1</property>
|
|
98
|
+
<property name="bottom_attach">2</property>
|
|
99
|
+
</packing>
|
|
100
|
+
</child>
|
|
101
|
+
<child>
|
|
102
|
+
<object class="GtkEntry" id="DataObjectGUI.email">
|
|
103
|
+
<property name="visible">True</property>
|
|
104
|
+
<property name="can_focus">True</property>
|
|
105
|
+
<property name="invisible_char">•</property>
|
|
106
|
+
</object>
|
|
107
|
+
<packing>
|
|
108
|
+
<property name="left_attach">1</property>
|
|
109
|
+
<property name="right_attach">2</property>
|
|
110
|
+
<property name="top_attach">2</property>
|
|
111
|
+
<property name="bottom_attach">3</property>
|
|
112
|
+
</packing>
|
|
113
|
+
</child>
|
|
114
|
+
<child>
|
|
115
|
+
<object class="GtkEntry" id="DataObjectGUI.phone">
|
|
116
|
+
<property name="visible">True</property>
|
|
117
|
+
<property name="can_focus">True</property>
|
|
118
|
+
<property name="invisible_char">•</property>
|
|
119
|
+
</object>
|
|
120
|
+
<packing>
|
|
121
|
+
<property name="left_attach">1</property>
|
|
122
|
+
<property name="right_attach">2</property>
|
|
123
|
+
<property name="top_attach">3</property>
|
|
124
|
+
<property name="bottom_attach">4</property>
|
|
125
|
+
</packing>
|
|
126
|
+
</child>
|
|
127
|
+
</object>
|
|
128
|
+
<packing>
|
|
129
|
+
<property name="position">1</property>
|
|
130
|
+
</packing>
|
|
131
|
+
</child>
|
|
132
|
+
<child>
|
|
133
|
+
<object class="GtkHButtonBox" id="hbuttonbox1">
|
|
134
|
+
<property name="visible">True</property>
|
|
135
|
+
<child>
|
|
136
|
+
<object class="GtkButton" id="buttonShow">
|
|
137
|
+
<property name="label" translatable="yes">Show</property>
|
|
138
|
+
<property name="visible">True</property>
|
|
139
|
+
<property name="can_focus">True</property>
|
|
140
|
+
<property name="receives_default">True</property>
|
|
141
|
+
</object>
|
|
142
|
+
<packing>
|
|
143
|
+
<property name="expand">False</property>
|
|
144
|
+
<property name="fill">False</property>
|
|
145
|
+
<property name="position">0</property>
|
|
146
|
+
</packing>
|
|
147
|
+
</child>
|
|
148
|
+
</object>
|
|
149
|
+
<packing>
|
|
150
|
+
<property name="padding">10</property>
|
|
151
|
+
<property name="position">2</property>
|
|
152
|
+
</packing>
|
|
153
|
+
</child>
|
|
154
|
+
</object>
|
|
155
|
+
<packing>
|
|
156
|
+
<property name="padding">15</property>
|
|
157
|
+
<property name="position">0</property>
|
|
158
|
+
</packing>
|
|
159
|
+
</child>
|
|
160
|
+
</object>
|
|
161
|
+
</child>
|
|
162
|
+
</object>
|
|
163
|
+
</interface>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
|
|
3
|
+
require 'vrlib'
|
|
4
|
+
|
|
5
|
+
#make program output in real time so errors visible in VR.
|
|
6
|
+
STDOUT.sync = true
|
|
7
|
+
STDERR.sync = true
|
|
8
|
+
|
|
9
|
+
#everything in these directories will be included
|
|
10
|
+
my_path = File.expand_path(File.dirname(__FILE__))
|
|
11
|
+
require_all Dir.glob(my_path + "/bin/**/*.rb")
|
|
12
|
+
|
|
13
|
+
x = DataObjectGUI.new("Harvey Milktoast", "123 Main, Hemet, CA 90090", "harvey@harveyserver.com", "132-243-4323")
|
|
14
|
+
x.show
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
--- !ruby/object:VR_ENV
|
|
2
|
+
backup_path: /home/eric
|
|
3
|
+
browser: chromium-browser
|
|
4
|
+
current_file: /home/eric/visualruby/treeview/bin/MyClass.rb
|
|
5
|
+
font_name: Monospace 10
|
|
6
|
+
glade_path: glade-gtk2
|
|
7
|
+
height: 707
|
|
8
|
+
open_files:
|
|
9
|
+
- /home/eric/visualruby/treeview/bin/MyClass.rb
|
|
10
|
+
- /home/eric/visualruby/treeview/main.rb
|
|
11
|
+
open_folders:
|
|
12
|
+
- /home/eric/visualruby/treeview
|
|
13
|
+
- /home/eric/visualruby/treeview/bin
|
|
14
|
+
panel_pos: 360
|
|
15
|
+
rdoc_command_line: rdoc -x README
|
|
16
|
+
run_command_line: ruby main.rb
|
|
17
|
+
tab_spaces: 2
|
|
18
|
+
width: 1236
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
class MyClass #(change name)
|
|
3
|
+
|
|
4
|
+
include GladeGUI
|
|
5
|
+
|
|
6
|
+
def before_show()
|
|
7
|
+
@tree = VR::TreeView.new(:name => String, :age => Integer)
|
|
8
|
+
top = @tree.add_row(nil)
|
|
9
|
+
top[:name] = "Family"
|
|
10
|
+
eric = @tree.add_row(top, :name => "Eric", :age => 47)
|
|
11
|
+
joe = @tree.add_row(eric, :name => "Joe", :age => 15)
|
|
12
|
+
ann = @tree.add_row(eric, :name => "Ann", :age => 17)
|
|
13
|
+
pat = @tree.add_row(ann, :name => "Pat", :age => 2)
|
|
14
|
+
steve = @tree.add_row(top, :name => "Steve", :age => 51)
|
|
15
|
+
|
|
16
|
+
#alternate format
|
|
17
|
+
harvey = @tree.add_row(top)
|
|
18
|
+
harvey[:name] = "Harvey"
|
|
19
|
+
harvey[:age] = 60
|
|
20
|
+
@scrolledwindow1 = @tree
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def button1__clicked(*args)
|
|
24
|
+
@builder["button1"].label = @builder["button1"].label == "Hello World" ? "Goodbye World" : "Hello World"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<interface>
|
|
3
|
+
<requires lib="gtk+" version="2.16"/>
|
|
4
|
+
<!-- interface-naming-policy project-wide -->
|
|
5
|
+
<object class="GtkWindow" id="window1">
|
|
6
|
+
<property name="visible">True</property>
|
|
7
|
+
<property name="can_focus">False</property>
|
|
8
|
+
<property name="title" translatable="yes">TreeView Demo</property>
|
|
9
|
+
<property name="modal">True</property>
|
|
10
|
+
<property name="window_position">center-always</property>
|
|
11
|
+
<property name="default_width">300</property>
|
|
12
|
+
<property name="default_height">200</property>
|
|
13
|
+
<signal name="destroy" handler="destroy_window" swapped="no"/>
|
|
14
|
+
<child>
|
|
15
|
+
<object class="GtkVBox" id="vbox1">
|
|
16
|
+
<property name="visible">True</property>
|
|
17
|
+
<property name="can_focus">False</property>
|
|
18
|
+
<child>
|
|
19
|
+
<object class="GtkVBox" id="vbox2">
|
|
20
|
+
<property name="visible">True</property>
|
|
21
|
+
<property name="can_focus">False</property>
|
|
22
|
+
<child>
|
|
23
|
+
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
|
24
|
+
<property name="visible">True</property>
|
|
25
|
+
<property name="can_focus">True</property>
|
|
26
|
+
<property name="hscrollbar_policy">automatic</property>
|
|
27
|
+
<property name="vscrollbar_policy">automatic</property>
|
|
28
|
+
<child>
|
|
29
|
+
<placeholder/>
|
|
30
|
+
</child>
|
|
31
|
+
</object>
|
|
32
|
+
<packing>
|
|
33
|
+
<property name="expand">True</property>
|
|
34
|
+
<property name="fill">True</property>
|
|
35
|
+
<property name="position">0</property>
|
|
36
|
+
</packing>
|
|
37
|
+
</child>
|
|
38
|
+
</object>
|
|
39
|
+
<packing>
|
|
40
|
+
<property name="expand">True</property>
|
|
41
|
+
<property name="fill">True</property>
|
|
42
|
+
<property name="position">0</property>
|
|
43
|
+
</packing>
|
|
44
|
+
</child>
|
|
45
|
+
</object>
|
|
46
|
+
</child>
|
|
47
|
+
</object>
|
|
48
|
+
</interface>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
|
|
3
|
+
require 'vrlib'
|
|
4
|
+
|
|
5
|
+
#make program output in real time so errors visible in VR.
|
|
6
|
+
STDOUT.sync = true
|
|
7
|
+
STDERR.sync = true
|
|
8
|
+
|
|
9
|
+
#everything in these directories will be included
|
|
10
|
+
my_path = File.expand_path(File.dirname(__FILE__))
|
|
11
|
+
require_all Dir.glob(my_path + "/bin/**/*.rb")
|
|
12
|
+
|
|
13
|
+
MyClass.new.show
|
|
14
|
+
|
data/vr
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
require "rubygems"
|
|
5
|
+
require "gtk2"
|
|
6
|
+
require "gtksourceview2"
|
|
7
|
+
require "require_all"
|
|
8
|
+
require "yaml" #needed
|
|
9
|
+
require "net/http" #needed
|
|
10
|
+
require "net/https" #needed
|
|
11
|
+
require "find" #needed
|
|
12
|
+
require "fileutils" #needed
|
|
13
|
+
require "rubygems/installer"
|
|
14
|
+
require "rubygems/uninstaller"
|
|
15
|
+
require "rubygems/package"
|
|
16
|
+
require "rubygems/specification"
|
|
17
|
+
|
|
18
|
+
#rubygems uses rubygems/package as of ruby 2.0.0
|
|
19
|
+
begin
|
|
20
|
+
require "rubygems/builder"
|
|
21
|
+
rescue LoadError
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#make program output in real time so errors visible
|
|
26
|
+
STDOUT.sync = true
|
|
27
|
+
STDERR.sync = true
|
|
28
|
+
|
|
29
|
+
my_path = File.expand_path(File.dirname(__FILE__))
|
|
30
|
+
if my_path =~ /^\/home\/eric\/vrp\/.*/
|
|
31
|
+
require File.expand_path(my_path + "/../vrlib") + "/vrlib.rb"
|
|
32
|
+
else
|
|
33
|
+
require "vrlib"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
require_all Dir.glob(my_path + "/bin/**/*.rb") # cant require_all root because .rb files in root will run????
|
|
37
|
+
|
|
38
|
+
VR_Main.new(ARGV).show
|
|
39
|
+
|
|
40
|
+
|