Sha256: 4fc04e9d69718abfa6cd653de9ddded6e7d05d70d74ffc88cf10bc227bf81be7

Contents?: true

Size: 1.25 KB

Versions: 19

Compression:

Stored size: 1.25 KB

Contents

# Copyright (c) 2008-2016 Ruby-GNOME2 Project Team
# This program is licenced under the same licence as Ruby-GNOME2.
#
=begin
= Entry/Entry Buffer

Gtk::EntryBuffer provides the text content in a Gtk::Entry.
Applications can provide their own buffer implementation,
e.g. to provide secure handling for passwords in memory.
=end
class EntryBufferDemo
  def initialize(main_window)
    @window = Gtk::Window.new(:toplevel)
    @window.screen = main_window.screen
    @window.title = "Entry Buffer"
    @window.resizable = false

    vbox = Gtk::Box.new(:vertical, 5)
    @window.add(vbox)
    vbox.set_border_width(5)

    label = Gtk::Label.new
    markup = "Entries share a buffer. Typing in one is reflected in the other."
    label.markup = markup
    vbox.pack_start(label, :expand => false, :fill => false, :padding => 0)

    # Create the buffer that will be shared
    buffer = Gtk::EntryBuffer.new

    # first entry
    entry = Gtk::Entry.new(buffer)
    vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0)

    # second entry
    entry = Gtk::Entry.new(buffer)
    vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0)
  end

  def run
    if !@window.visible?
      @window.show_all
    else
      @window.destroy
    end
  end
end

Version data entries

19 entries across 11 versions & 2 rubygems

Version Path
savant-echo-1.0.4 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-1.0.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-1.0.1 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-1.0.1 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.91 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.91 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.9 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.9 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.6 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.6 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.5 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.5 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.4 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.3 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
savant-echo-0.1.3 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/sample/gtk-demo/entry_buffer.rb
gtk3-3.1.0-x64-mingw32 sample/gtk-demo/entry_buffer.rb
gtk3-3.1.0-x86-mingw32 sample/gtk-demo/entry_buffer.rb
gtk3-3.1.0 sample/gtk-demo/entry_buffer.rb