Class: Zerenity::TextInfo
Overview
:nodoc:
Class Method Summary collapse
- .build(dialog, options) ⇒ Object
- .check(options) ⇒ Object
- .retrieve_selection(dialog, options) ⇒ Object
Methods inherited from Base
Class Method Details
.build(dialog, options) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/zerenity/textinfo.rb', line 31 def self.build(dialog,) super(dialog,) textView = Gtk::TextView.new textView.set_size_request([:width].to_i,[:height].to_i) textView.buffer.text = [:text].to_s textView.editable = [:editable] scrolledWindow = Gtk::ScrolledWindow.new scrolledWindow. = [:scrollable] ? Gtk::POLICY_AUTOMATIC : Gtk::POLICY_NEVER scrolledWindow. = [:scrollable] ? Gtk::POLICY_AUTOMATIC : Gtk::POLICY_NEVER scrolledWindow.add(textView) dialog.vbox.add(scrolledWindow) end |
.check(options) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/zerenity/textinfo.rb', line 22 def self.check() super() [:editable] ||= false [:scrollable] ||= false [:height] ||= -1 [:width] ||= -1 [:text] ||= "" end |
.retrieve_selection(dialog, options) ⇒ Object
44 45 46 47 |
# File 'lib/zerenity/textinfo.rb', line 44 def self.retrieve_selection(dialog,) super(dialog,) return dialog.vbox.children[0].children[0].buffer.text end |