Top Level Namespace
Defined Under Namespace
Instance Method Summary collapse
-
#alert(message, options = {}) ⇒ String, ...
The alert method creates a pop-up alert in your program.
-
#alert2(message, options = {}) ⇒ String, ...
The alert method creates a pop-up alert in your program.
-
#oinspect(obj = self) ⇒ Object
Displays object on screen and halts the program.
Instance Method Details
#alert(message, options = {}) ⇒ String, ...
The alert method creates a pop-up alert in your program. It creates a modal window that halts execution of your code until the user closes it. Its great for displaying messages and debugging. It also has the option of allowing the user input in the form of a String or a selection from a Hash or Array. This small tool can save hundreds of lines of code in your programs. It can be used extesnively to display all types of messages and request all types of user input.
The alert box can disply 1, 2 or 3 buttons. The first button is denoted using the symbol: :button_yes button and is always displayed. You can add :button_no and :button_cancel.
If you want to add these buttons, just set their values to whatever text you want them to display and they will appear. Likewise, if you pass a :data parameter with a String, Hash or Array, it will ask for user input.
There are many examples in the “alert_box” example project.
140 141 142 143 |
# File 'lib/AlertDialog.rb', line 140 def alert(, = {}) win = VR::AlertDialog.new(, ) return win.run() end |
#alert2(message, options = {}) ⇒ String, ...
The alert method creates a pop-up alert in your program. It creates a modal window that halts execution of your code until the user closes it. Its great for displaying messages and debugging. It also has the option of allowing the user input in the form of a String or a selection from a Hash or Array. This small tool can save hundreds of lines of code in your programs. It can be used extesnively to display all types of messages and request all types of user input.
The alert box can disply 1, 2 or 3 buttons. The first button is denoted using the symbol: :button_yes button and is always displayed. You can add :button_no and :button_cancel.
If you want to add these buttons, just set their values to whatever text you want them to display and they will appear. Likewise, if you pass a :data parameter with a String, Hash or Array, it will ask for user input.
There are many examples in the “alert_box” example project.
145 146 147 148 149 |
# File 'lib/Alert.rb', line 145 def alert2(, = {}) ans = VR::Alert::DialogAnswer.new() VR::Alert.new(, ans, ).show_glade([:parent]) return ans.answer end |
#oinspect(obj = self) ⇒ Object
Displays object on screen and halts the program. Anywhere in your code you can halt the execution, and display an object in a window like this:
oinspect anyobject
Also, at any window, if you press the F8 key, the object inspector will run. Try it.
42 43 44 |
# File 'lib/oinspect/ObjectInspectorGUI.rb', line 42 def oinspect(obj=self) VR::ObjectInspector::ObjectInspectorGUI.new(obj).show_glade() end |