Package: ruby-gtk2 Version: 1.0.0-1 Severity: normal
Was debugging a demo with a liststore an found that liststores don't work in the Debian package but do work in in perfectly when the package is removed and gem installed. Attaching the demo which fails. -- System Information: Debian Release: wheezy/sid APT prefers stable APT policy: (900, 'stable'), (500, 'testing'), (410, 'unstable'), (200, 'experimental'), (111, 'oldstable'), (107, 'natty-updates'), (107, 'natty') Architecture: amd64 (x86_64) Kernel: Linux 3.0.0-rc3-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages ruby-gtk2 depends on: ii libatk1.0-0 2.0.1-2 ATK accessibility toolkit ii libc6 2.13-10 Embedded GNU C Library: Shared lib ii libcairo2 1.10.2-6.1 The Cairo 2D vector graphics libra ii libfontconfig1 2.8.0-2.1 generic font configuration library ii libfreetype6 2.4.2-2.1+squeeze1 FreeType 2 font engine, shared lib ii libgdk-pixbuf2.0-0 2.23.5-3 GDK Pixbuf library ii libglib2.0-0 2.28.6-1 The GLib library of C routines ii libgtk2.0-0 2.24.5-4cmb1 GTK+ graphical user interface libr ii libpango1.0-0 1.28.4-1 Layout and rendering of internatio ii libruby1.8 1.8.7.352-2 Libraries necessary to run Ruby 1. ii libruby1.9.1 1.9.2.290-2 Libraries necessary to run Ruby 1. ii libx11-6 2:1.3.3-4 X11 client-side library ii ruby-atk 1.0.0-1 ATK bindings for the Ruby language ii ruby-gdk-pixbuf2 1.0.0-1 Gdk-Pixbuf 2 bindings for the Ruby ii ruby-pango 1.0.0-1 Pango bindings for the Ruby langua ruby-gtk2 recommends no packages. ruby-gtk2 suggests no packages. -- no debconf information
#!/usr/bin/env ruby require 'gtk2' class Array def mapm_rev receiver, method self.map{|item| receiver.send method, item } end def mapm method, *args self.map{|item| item.send method, *args} end end def echo *strings STDERR.puts strings.join(' ') end class Gtk::TreeSelection def can_select? path !@exclude or (@other_selected != path) end def selection_changed changed # This is kind of evil. In glade the user_data is the object on which # the signal callback is called. It is set to the *other* unchanged selection which then can note # the item that was selected and either deselect it or disable it as appropriate. echo "sel", *([(selected[0] rescue nil), (changed.selected[0] rescue nil)].mapm :inspect) # This handles the override case unselect_iter selected if !@exclude and selected and changed.selected and (selected.path == changed.selected.path) # And this the exclude case self.other_selected = changed.selected end def other_selected_iter return nil unless @other_selected tree_view.model.get_iter @other_selected end def other_selected_text iter = other_selected_iter other_selected_iter[0] if iter end def vis_enable_row value echo 'en', *([other_selected_text, value].mapm :inspect) other_selected_iter[@index] = value if @other_selected end def other_selected= iter echo 'sav', *([other_selected_text, (iter[0] rescue nil)].mapm :inspect) path = iter.path if iter if path != @other_selected then vis_enable_row true if @exclude @other_selected = path vis_enable_row false if @exclude end end def exclude= value echo 'exc', @index, value vis_enable_row !value #if @exclude != value # Would issue uninitialized variable warnings @exclude = value end def index= value # Kind of initialization of the exclusion mechanism @index = value @other_selected = nil end attr_reader :exclude, :index end class Dialog < Gtk::Window def selections_do (1..2).each{|n| yield @builder["treeview-selection#{n}"], n } end def initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = nil) super(Gtk::Window::TOPLEVEL) @window = nil gtkversion = [2, 16, 0] # 2.12 should have most recent features. Set to later if needed. available = Gtk.check_version? *gtkversion if available label = Gtk::Label.new("If you can see this message there was an error loading interface description #{path_or_data.inspect}.") else label = Gtk::Label.new("You need GTK+ >= #{gtkversion.join '.'} to run this application.") end add(label) return unless available @builder = Gtk::Builder.new @builder << path_or_data @builder.connect_signals {|name| method(name)} store = @builder['liststore'] (1...20).each{|n| i=store.insert(n) ; i[1] = i[2] = true ; i[0] = "Item %i" % (n % 10)} selections_do{|sel, n| sel.index = n sel.exclude = false sel.set_select_function{|selection, model, path, path_currentry_selected| selection.can_select? path } } @window = @builder['window1'] end def selection_changed changed changed.tree_view.columns[0].title = (changed.selected[0] rescue nil) end def exclude_toggled button selections_do{|sel, n| sel.exclude = button.active? } end def app_quit Gtk.main_quit end def show @window = self unless @window @window.show_all @window.signal_connect("destroy") { Gtk.main_quit } end end Dialog.new('twin_tree_view.glade', nil, "Twin Tre View Demo").show Gtk.main
twin_tree_view.glade
Description: XML document