Class: Gtk2AppLib::Dialogs::TextView

Inherits:
Gtk::Dialog
  • Object
show all
Defined in:
lib/gtk2applib/dialogs/text_view.rb

Overview

creates a TextView dialog

Instance Method Summary (collapse)

Constructor Details

- (TextView) initialize(message, options)

Returns a new instance of TextView



8
9
10
11
12
13
14
15
16
17
# File 'lib/gtk2applib/dialogs/text_view.rb', line 8

def initialize(message, options)
  @options = options
  super(@options[:TITLE],
    @options[:WINDOW], @options[:FLAGS], *@options[:DIALOG_BUTTONS])
  box = self.vbox
  if @options[:SCROLLED_WINDOW] then
    box = Widgets::ScrolledWindow.new(box, *@options[:ScrolledWindow])
  end
  @text_view = Widgets::TextView.new(message, box, *@options[:TextView])
end

Instance Method Details

- (Object) run



19
20
21
22
23
24
25
# File 'lib/gtk2applib/dialogs/text_view.rb', line 19

def run
  message = nil
  self.show_all
  super { |response| message = @text_view.text if response == 1 }
  self.destroy
  message
end