class SearchEntry2Demo
# Copyright © 2015-2016 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. #
Entry/Delayed Search Entry¶ ↑
GtkSearchEntry sets up GtkEntries ready for search. Search entries have their "changed" signal delayed and should be used when the searched operation is slow such as loads of entries to search, or online searches.
Public Class Methods
new(main_window)
click to toggle source
# File gtk3/sample/gtk-demo/search_entry2.rb, line 13 def initialize(main_window) @window = Gtk::Window.new(:toplevel) @window.title = "Delayed Search Entry" @window.transient_for = main_window @window.resizable = true @window.set_size_request(200, -1) initialize_vbox @entry = Gtk::SearchEntry.new initialize_search_bar @vbox.pack_start(@searchbar, :expand => false, :fill => false, :padding => 0) # Hook the search bar to key presses @window.signal_connect("key-press-event") do |_widget, event| @searchbar.handle_event(event) end initialize_help_label initialize_toggle_button initialize_result_hbox initialize_signal_hbox end
Public Instance Methods
run()
click to toggle source
# File gtk3/sample/gtk-demo/search_entry2.rb, line 38 def run if !@window.visible? @window.show_all else @window.destroy end @window end