Sha256: a17e41381be9c4d2dc02855f5b590914ab198f74e385ac7a2e3448991d4c38dd

Contents?: true

Size: 788 Bytes

Versions: 111

Compression:

Stored size: 788 Bytes

Contents

#!/usr/bin/env ruby
=begin
  test.rb - Ruby/GtkSourceView2 sample script.

  Copyright (c) 2006 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.

  $Id: test.rb,v 1.4 2007/06/03 02:11:07 mutoh Exp $
=end

require 'gtksourceview2'

w = Gtk::Window.new
w.signal_connect("delete-event"){Gtk::main_quit}

view = Gtk::SourceView.new
w.add(Gtk::ScrolledWindow.new.add(view))
view.show_line_numbers = true
view.insert_spaces_instead_of_tabs = true
view.indent_width = 4
view.show_right_margin = true
view.right_margin_position = 80

lang = Gtk::SourceLanguageManager.new.get_language('ruby')
view.buffer.language = lang
view.buffer.highlight_syntax = true
view.buffer.highlight_matching_brackets = true

w.set_default_size(450,300)
w.show_all

Gtk.main

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
gtksourceview2-3.2.3 sample/test.rb
gtksourceview2-3.2.2 sample/test.rb
gtksourceview2-3.2.1 sample/test.rb
gtksourceview2-3.2.0 sample/test.rb
gtksourceview2-3.1.9 sample/test.rb
gtksourceview2-3.1.8 sample/test.rb
gtksourceview2-3.1.7 sample/test.rb
gtksourceview2-3.1.6 sample/test.rb
gtksourceview2-3.1.4 sample/test.rb
gtksourceview2-3.1.3 sample/test.rb
gtksourceview2-3.1.2 sample/test.rb
gtksourceview2-3.1.1 sample/test.rb
gtksourceview2-3.1.0 sample/test.rb
gtksourceview2-3.0.9 sample/test.rb
gtksourceview2-3.0.8 sample/test.rb
gtksourceview2-3.0.7 sample/test.rb
gtksourceview2-3.0.6 sample/test.rb
gtksourceview2-3.0.5 sample/test.rb
gtksourceview2-3.0.4 sample/test.rb
gtksourceview2-3.0.3 sample/test.rb