[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-filechooser

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 1月 17日 (火) 04:21:55 JST


-------------------------
REMOTE_ADDR = 184.145.90.60
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-filechooser
-------------------------
@@ -65,24 +65,24 @@
  window.signal_connect('destroy') { Gtk.main_quit }
  
  label = Gtk::Label.new
- chooser_dir  = Gtk::FileChooserButton.new(
+ choo_dir_btt  = Gtk::FileChooserButton.new(
      "Choose a Folder", Gtk::FileChooser::ACTION_SELECT_FOLDER)
- chooser_file = Gtk::FileChooserButton.new(
+ choo_file_btt = Gtk::FileChooserButton.new(
      "Choose a File", Gtk::FileChooser::ACTION_OPEN)
  
  # Let's add an extra widget (a button) to the {{ dialog }}
  extra_button1 = Gtk::Button.new("Extra button")
  extra_button2 = Gtk::Button.new("Extra button #2")
- chooser_file.extra_widget = extra_button1
- chooser_dir.extra_widget  = extra_button2
+ choo_file_btt.extra_widget = extra_button1
+ choo_dir_btt.extra_widget  = extra_button2
  
- chooser_dir.signal_connect('selection_changed') do |w|
-   # puts "In chooser_dir(): #{w.class}=#{w}"   # <<< w=Gtk::FileChooserButton
-   folder_changed(w, chooser_file)
+ choo_dir_btt.signal_connect('selection_changed') do |w|
+   # puts "In choo_dir_btt(): #{w.class}=#{w}"   # <<< Gtk::FileChooserButton=choo_dir_btt
+   folder_changed(w, choo_file_btt)
  end
- chooser_file.signal_connect('selection_changed') do |w|
-   # puts "In chooser_file(): #{w.class}=#{w}"  # <<< w=Gtk::FileChooserButton
-   file_changed(chooser_file, label)
+ choo_file_btt.signal_connect('selection_changed') do |w|
+   # puts "In choo_file_btt(): #{w.class}=#{w}"  # <<< w=Gtk::FileChooserButton=choo_file_btt
+   file_changed(choo_file_btt, label)
  end
  extra_button1.signal_connect("clicked") do
    puts "extra button #1 clicked"
@@ -91,9 +91,9 @@
    puts "extra button #2 clicked"
  end
  
- chooser_dir.current_folder  = GLib.home_dir
- # chooser_file.current_folder = "/tmp"  # <--- will have no effect, since callback overrides it 
- # chooser_file.filename = "/home/iwk/wk/a_cfile.c" # <--- would work if file existed
+ choo_dir_btt.current_folder  = GLib.home_dir
+ # choo_file_btt.current_folder = "/tmp"  # <--- will have no effect, since callback overrides it 
+ # choo_file_btt.filename = "/home/iwk/wk/a_cfile.c" # <--- would work if file existed
  
  filter1 = Gtk::FileFilter.new
  filter2 = Gtk::FileFilter.new
@@ -103,12 +103,12 @@
  filter1.add_pattern('*.jpg')
  filter1.add_pattern('*.gif')
  filter2.add_pattern('*')
- chooser_file.add_filter(filter2) # 1st added will be the default
- chooser_file.add_filter(filter1)
+ choo_file_btt.add_filter(filter2) # 1st added will be the default
+ choo_file_btt.add_filter(filter1)
  
  vbox = Gtk::VBox.new(true, 5)
- vbox.pack_start_defaults(chooser_dir)
- vbox.pack_start_defaults(chooser_file)
+ vbox.pack_start_defaults(choo_dir_btt)
+ vbox.pack_start_defaults(choo_file_btt)
  vbox.pack_start_defaults(label)
  
  window.add(vbox)




ruby-gnome2-cvs メーリングリストの案内
Back to archive index