Sha256: 4fb0fe4ab808e4dd43a92d9579a92f8bdc93026b57d176dd0ba8cd069c81427c

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8
require 'Context/Gtk/Widget'
require 'gtk2'

module JLDrill::Gtk
    class InfoWindow < Gtk::Dialog
        include Context::Gtk::Widget

        def initialize(view)
            @view = view
            super("Info", nil,
                    Gtk::Dialog::DESTROY_WITH_PARENT,
                    [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_ACCEPT])

            sw = Gtk::ScrolledWindow.new
            sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
            sw.shadow_type = Gtk::SHADOW_IN
            self.vbox.add(sw)
            
            @contents = Gtk::TextView.new
            @contents.wrap_mode = Gtk::TextTag::WRAP_WORD
            @contents.editable = false
            @contents.cursor_visible = false
            sw.add(@contents)
            self.set_default_size(600, 360)
        end

        def addContents(string)
            @contents.buffer.text = string
        end
        
        def execute(string)
            addContents(string)
            run
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.6.0.1 lib/jldrill/views/gtk/widgets/InfoWindow.rb