share tips object
authorgc <gc>
Mon, 24 Mar 2008 16:55:30 +0000 (16:55 +0000)
committergc <gc>
Mon, 24 Mar 2008 16:55:30 +0000 (16:55 +0000)
bin/booh-classifier

index 9743ed7..d33775b 100644 (file)
@@ -951,7 +951,7 @@ def sb_msg(msg)
     end
 end
 
-def show_entry(entry, i)
+def show_entry(entry, i, tips)
     #- scope entry
     msg 3, "showing entry #{entry}"
     entry.image = Gtk::Image.new(entry.pixbuf_thumbnail)
@@ -964,7 +964,7 @@ def show_entry(entry, i)
     else
         entry.button = Gtk::Button.new.add(entry.image)
     end
-    Gtk::Tooltips.new.set_tip(entry.button, entry.get_beautified_name, nil)
+    tips.set_tip(entry.button, entry.get_beautified_name, nil)
     $imagesline.pack_start(entry.alignment = Gtk::Alignment.new(0.5, 1, 0, 0).add(entry.button).show_all, false, false)
     entry.button.signal_connect('clicked') {
         if (last_shown = $mainview.get_shown_entry) != entry
@@ -997,6 +997,7 @@ def show_entries(allentries)
     total_loaded_files = 0
     total_loaded_size = 0
     i = 0
+    tips = Gtk::Tooltips.new
     while i < allentries.size
 #        printf "%d %s\n", i, __LINE__
         entry = allentries[i]
@@ -1012,7 +1013,7 @@ def show_entries(allentries)
         end
 
         if loaded_pixbuf
-            show_entry(entry, i)
+            show_entry(entry, i, tips)
             if $allentries != allentries
                 #- loaded another directory while this one was not yet finished
                 msg 3, "allentries differ, stopping this deprecated load"