ruby-****@sourc*****
ruby-****@sourc*****
2012年 12月 17日 (月) 09:29:10 JST
------------------------- REMOTE_ADDR = 184.145.81.223 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dnd-intro ------------------------- @@ -248,22 +248,26 @@ ((*hiki-dnd-dbg.rb*)) module HikiDnDdbg + def blow_up(targs) - target_names="\n" - line="" + target_names="" + line="\n\t\t" targs.each do |token| if line.length > 65 - target_names += "\t\t" + line + target_names += line line = "\n\t\t" end line += token.name + ", " end target_names + line.chop.chop + ";\n" end - # NOTE: - # Global value {{ $DEBUG }} must be set to true for this method to run! - # If set the {{ $MONITOR }} global variable to true this method only - # reports which signals were caught. + # NOTE: + # Either {{ $DEBUG }} or {{ $MONITOR }} must be set to true for this + # method to run! If both are set {{ $MONITOR }} cancels {{ $DEBUG }}. + # ALSO: + # If you are using Gtk::TextView as source and/or destination, you + # may alse need to initialize {{ $text_buffer }} global variable to + # your {{ Gtk::TextView#buffer }}. def prn_dnd_sig_parms(sig, *parms) return if (!($DEBUG||=false)) && (!($MONITOR||=false)) w=dc=x=y=d=i=t=nil @@ -287,10 +291,15 @@ end $prev_sig = sig print "#{sig}" - + dots = "" + (40 - sig.length).times {dots += "."} if $MONITOR # ||= false msg = sig == 'drag-motion' ? - " ... potentially many 'drag-motion' signals were caught." : " caught.\n" + " ... potentially many 'drag-motion' signals were caught." : " #{dots} caught." puts msg return else @@ -324,7 +329,12 @@ end puts end - + def show_if_widget_contains_its_own_gdk_window(w) answer = "#{w.class} does not contain its own Gdk::Window" if w.respond_to? :no_window?