From plusgforce at gmail.com Fri Jan 1 05:38:48 2010 From: plusgforce at gmail.com (Philip Stephens) Date: Fri, 1 Jan 2010 04:38:48 -0600 Subject: [wxruby-users] help with clean exits Message-ID: <536e2d6f1001010238q5f12f95cr243168d541f0aaca@mail.gmail.com> require 'wx' require 'Eyes.rb' require 'date.rb' # I am trying to close then mainframe window cleanly so I don't have to # shut down ruby1.9 via `kill -9 .....'. When I press cancel on the first # (welcome) window it does exit cleanly. However when I try to shut down # the main window using the close box, it hangs. It doesn't even use the # on_window_close window event. How do I rectify this situation? Any # help would be appreciated. If you want more info just ask. Thanks # Happy new year everyone! # # Philip class Main_Frame < EyesFrame def on_init() evt_close {|event| on_window_close(event)} end def on_window_close(event) puts ("************") destroy() end end class EW_Dialog < EW_dialog def on_init() set_affirmative_id(Wx::ID_OK) set_escape_id(Wx::ID_CANCEL) end end class Waiter # This method waits x seconds to allow other processing to # take place such as opening a new window def initialize(secs) startTime = Time.new() startSecs = startTime.hour() * 60 * 60 startSecs += (startTime.min() * 60) startSecs += startTime.sec() puts "startSecs #{startSecs}" endSecs = startSecs + secs puts "endSecs #{endSecs}" currSecs = startSecs while (currSecs < endSecs) currTime = Time.new currSecs = currTime.hour() * 60 * 60 currSecs += (currTime.min() * 60) currSecs += currTime.sec() puts ("currentsecs: #{currSecs}") end end end class MyApp < Wx::App def on_init() @screen1 = EW_Dialog.new # show welcome dialog case @screen1.show_modal() when Wx::ID_CANCEL then @screen1.close puts("Cancel") exit_main_loop() when Wx::ID_OK @screen1.close @screen2 = Main_Frame.new() @screen2.show set_top_window(@screen2) Waiter.new(1) #wait x seconds end #case end #def end # class app = MyApp.new app.main_loop -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Jan 1 22:56:11 2010 From: lists at ruby-forum.com (Reimundo Heluani) Date: Sat, 2 Jan 2010 04:56:11 +0100 Subject: [wxruby-users] ldd problems with svn version Message-ID: <18bd01725942a23cd11fdd859a0f1313@ruby-forum.com> Hi there, I just built wxruby, ruby and wxWidgets from svn trunk stable and I'm having problems with undefined symbols on wxruby2.so. It looks like a broken ruby installation but I'm not sure, I'd appreciate any help. require 'wx' looks ok though. Thanks R. ldd -r /usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so linux-vdso.so.1 => (0x00007fff653ff000) libwx_gtk2u_stc-2.8.so.0 => /usr/lib64/libwx_gtk2u_stc-2.8.so.0 (0x00007fbb7a12d000) libwx_gtk2u_gl-2.8.so.0 => /usr/lib64/libwx_gtk2u_gl-2.8.so.0 (0x00007fbb79f1e000) libwx_gtk2u_media-2.8.so.0 => /usr/lib64/libwx_gtk2u_media-2.8.so.0 (0x00007fbb79d0b000) libwx_gtk2u_richtext-2.8.so.0 => /usr/lib64/libwx_gtk2u_richtext-2.8.so.0 (0x00007fbb79a12000) libwx_gtk2u_aui-2.8.so.0 => /usr/lib64/libwx_gtk2u_aui-2.8.so.0 (0x00007fbb79798000) libwx_gtk2u_xrc-2.8.so.0 => /usr/lib64/libwx_gtk2u_xrc-2.8.so.0 (0x00007fbb794ff000) libwx_gtk2u_qa-2.8.so.0 => /usr/lib64/libwx_gtk2u_qa-2.8.so.0 (0x00007fbb792dd000) libwx_gtk2u_html-2.8.so.0 => /usr/lib64/libwx_gtk2u_html-2.8.so.0 (0x00007fbb7902b000) libwx_gtk2u_adv-2.8.so.0 => /usr/lib64/libwx_gtk2u_adv-2.8.so.0 (0x00007fbb78d45000) libwx_gtk2u_core-2.8.so.0 => /usr/lib64/libwx_gtk2u_core-2.8.so.0 (0x00007fbb78728000) libwx_baseu_xml-2.8.so.0 => /usr/lib64/libwx_baseu_xml-2.8.so.0 (0x00007fbb7851d000) libwx_baseu_net-2.8.so.0 => /usr/lib64/libwx_baseu_net-2.8.so.0 (0x00007fbb782ed000) libwx_baseu-2.8.so.0 => /usr/lib64/libwx_baseu-2.8.so.0 (0x00007fbb77f8f000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbb77d72000) librt.so.1 => /lib64/librt.so.1 (0x00007fbb77b69000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fbb77965000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fbb7772d000) libgtk-x11-2.0.so.0 => /usr/lib64/libgtk-x11-2.0.so.0 (0x00007fbb770d5000) libgdk-x11-2.0.so.0 => /usr/lib64/libgdk-x11-2.0.so.0 (0x00007fbb76e21000) libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007fbb76c00000) libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007fbb769e5000) libpangoxft-1.0.so.0 => /usr/lib64/libpangoxft-1.0.so.0 (0x00007fbb767dd000) libpangox-1.0.so.0 => /usr/lib64/libpangox-1.0.so.0 (0x00007fbb765d0000) libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007fbb76387000) libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007fbb76142000) libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007fbb75f3e000) libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007fbb75d3a000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fbb75a5a000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fbb75750000) libm.so.6 => /lib64/libm.so.6 (0x00007fbb754ce000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fbb752b8000) libc.so.6 => /lib64/libc.so.6 (0x00007fbb74f63000) libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007fbb74caf000) libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007fbb74a83000) libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fbb74800000) libz.so.1 => /lib64/libz.so.1 (0x00007fbb745ea000) libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fbb743ba000) libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x00007fbb74191000) libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007fbb73f6e000) libtiff.so.3 => /usr/lib64/libtiff.so.3 (0x00007fbb73d13000) libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007fbb73b3a000) libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00007fbb738d0000) libgstreamer-0.10.so.0 => /usr/lib64/libgstreamer-0.10.so.0 (0x00007fbb735f7000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fbb732ae000) libgconf-2.so.4 => /opt/gnome/lib64/libgconf-2.so.4 (0x00007fbb73071000) libgstinterfaces-0.10.so.0 => /usr/lib64/libgstinterfaces-0.10.so.0 (0x00007fbb72e5f000) libSDL-1.2.so.0 => /usr/lib64/libSDL-1.2.so.0 (0x00007fbb72bc3000) libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fbb7299b000) /lib64/ld-linux-x86-64.so.2 (0x00007fbb7af00000) libXinerama.so.1 => /usr/X11R7/lib64/libXinerama.so.1 (0x00007fbb72798000) libXrandr.so.2 => /usr/X11R7/lib64/libXrandr.so.2 (0x00007fbb72590000) libXcursor.so.1 => /usr/X11R7/lib64/libXcursor.so.1 (0x00007fbb72387000) libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007fbb7217b000) libXcomposite.so.1 => /usr/X11R7/lib64/libXcomposite.so.1 (0x00007fbb71f79000) libXext.so.6 => /usr/X11R7/lib64/libXext.so.6 (0x00007fbb71d67000) libXdamage.so.1 => /usr/X11R7/lib64/libXdamage.so.1 (0x00007fbb71b64000) libXfixes.so.3 => /usr/X11R7/lib64/libXfixes.so.3 (0x00007fbb7195f000) libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007fbb716e9000) libpixman-1.so.0 => /usr/X11R7/lib64/libpixman-1.so.0 (0x00007fbb714a1000) libXrender.so.1 => /usr/X11R7/lib64/libXrender.so.1 (0x00007fbb71298000) libX11.so.6 => /usr/X11R7/lib64/libX11.so.6 (0x00007fbb70f60000) libxcb.so.1 => /usr/X11R7/lib64/libxcb.so.1 (0x00007fbb70d44000) libXau.so.6 => /usr/X11R7/lib64/libXau.so.6 (0x00007fbb70b42000) libXdmcp.so.6 => /usr/X11R7/lib64/libXdmcp.so.6 (0x00007fbb7093d000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fbb70726000) libXft.so.2 => /usr/X11R7/lib64/libXft.so.2 (0x00007fbb70512000) libGLcore.so.1 => /usr/lib64/libGLcore.so.1 (0x00007fbb6f1eb000) libnvidia-tls.so.1 => /usr/lib64/tls/libnvidia-tls.so.1 (0x00007fbb6f0e9000) libORBit-2.so.0 => /opt/gnome/lib64/libORBit-2.so.0 (0x00007fbb6ee79000) libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 (0x00007fbb6ec57000) libdbus-1.so.3 => /usr/lib64/libdbus-1.so.3 (0x00007fbb6ea17000) undefined symbol: rb_eIndexError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cRange (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eIOError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cObject (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eNameError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_mKernel (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cFalseClass (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cSymbol (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eNotImpError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eNoMemError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eNoMethodError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cNilClass (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eRangeError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eRuntimeError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eZeroDivError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cTrueClass (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cFixnum (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eSyntaxError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eTypeError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_cProc (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eArgError (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_eFatal (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_str_cat2 (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_protected_method (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_module_function (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_to_id (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_rescue (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_hash_aref (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_intern2 (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_num2dbl (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_yield (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_string_value_ptr (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_str_cat (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_method (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_tainted_str_new (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_module (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_iv_get (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_str_new (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_ary_new (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_str_new_cstr (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_big2ulong (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_const_get (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_fix2int (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_num2long (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_enc_str_new (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_warning (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_uint2big (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_const_defined (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_range_new (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_str_append (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_f_sprintf (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_exc_new3 (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_ary_entry (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_num2ulong (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_exc_raise (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_obj_is_kind_of (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_warn (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_utf8_encoding (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_int2big (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_raise (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_class (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_undef_alloc_func (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_intern (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_class_under (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_block_given_p (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_alloc_func (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_funcall (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_obj_clone (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_big2long (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_undef_method (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_ary_push (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_singleton_method (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_gc_mark (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_readonly_variable (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_inspect (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_gv_get (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_ivar_defined (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_obj_classname (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_data_object_alloc (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_ary_shift (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_gc_start (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_define_const (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_float_new (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_big2dbl (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_respond_to (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_check_type (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_num2int (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_iv_set (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) undefined symbol: rb_gv_set (/usr/lib64/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86_64-linux/lib/wxruby2.so) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jan 2 03:15:12 2010 From: lists at ruby-forum.com (Michael Mcandrews) Date: Sat, 2 Jan 2010 09:15:12 +0100 Subject: [wxruby-users] WxScrolledWindow (putting into) Message-ID: <14faf8a8df53b4b457ba8599f5643b8e@ruby-forum.com> I'm having a real problem getting stuff into a WxScrolledWindow. What I'm trying to do is use a scrolled widow to display a set records (two elements, a StaticText label and a TextCtrl entry box) that will likely be longer than the window (so need vertical scrolling). But I can't get anything into the ScrolledWindow control, everythings ends up at the top left of the entire form, as if I haven't placed them properly. Does a ScrolledWindow need to be put into a sizer? Does the Scrolled Window need a sizer inside of it? Do items go into the ScrolledWindow directly, or do they need to be placed into a sizer that is inside the ScrolledWindow? I've tried everycombination I can think of, but have not hit upon the correct one. No matter what I try, all "record" items end up at the top left of the form, just as they would appear if the items had been "defined" but not yet "placed". -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sat Jan 2 03:40:14 2010 From: mario at ruby-im.net (Mario Steele) Date: Sat, 2 Jan 2010 03:40:14 -0500 Subject: [wxruby-users] WxScrolledWindow (putting into) In-Reply-To: <14faf8a8df53b4b457ba8599f5643b8e@ruby-forum.com> References: <14faf8a8df53b4b457ba8599f5643b8e@ruby-forum.com> Message-ID: Hello Michael, To answer your question as easily as possible, the problem you are facing, is that your scrolled window, needs to have a Panel or Window created inside of it, in order for it to work. Then if your going to have multiple controls, and don't want to exclusively control where they are, then you will need to use a sizer on that Panel or Window, then all controls that are to be displayed in the Scrolled Window, need to have their parent set to that Panel or Window. An example, would be: class MyFrame < Wx::Frame def initialize() super nil @scrolled = Wx::ScrolledWindow.new(self) @panel = Wx::Panel.new(@scrolled) text1 = Wx::StaticText.new(@panel,-1,"Hello World") edit1 = Wx::TextCtrl.new(@panel,-1,"") vbox = Wx::BoxSizer.new(Wx::VERTICAL) vbox.add text1 vbox.add edit1, 1, Wx::ALL | Wx::EXPAND @panel.sizer = vbox end end With this design, you'll see that text1 and edit1 are children of @panel, instead of MyFrame, or @scrolled. @panel is a child of @scrolled. And you don't nesscarly need to create the Box Sizer before you create the controls. You can create the controls at any time, as long as they are assigned to a Box Sizer, before displaying them (Through show, or show_all methods of Window), otherwise, they'll just appear in the upper left hand corner. ;-) hth to clarify, Mario On Sat, Jan 2, 2010 at 3:15 AM, Michael Mcandrews wrote: > I'm having a real problem getting stuff into a WxScrolledWindow. What > I'm trying to do is use a scrolled widow to display a set records (two > elements, a StaticText label and a TextCtrl entry box) that will likely > be longer than the window (so need vertical scrolling). But I can't get > anything into the ScrolledWindow control, everythings ends up at the top > left of the entire form, as if I haven't placed them properly. > > Does a ScrolledWindow need to be put into a sizer? > Does the Scrolled Window need a sizer inside of it? > Do items go into the ScrolledWindow directly, or do they need to be > placed into a sizer that is inside the ScrolledWindow? > > I've tried everycombination I can think of, but have not hit upon the > correct one. No matter what I try, all "record" items end up at the top > left of the form, just as they would appear if the items had been > "defined" but not yet "placed". > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sat Jan 2 08:22:31 2010 From: lists at ruby-forum.com (Haris Bogdanovic) Date: Sat, 2 Jan 2010 14:22:31 +0100 Subject: [wxruby-users] set font size for device context Message-ID: Hi. How to set font size for device context (for use with draw_text method) ? I tried set_point_size method of Font class but nothing happens. What exactly does this method do ? Thanks Haris -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jan 2 11:08:07 2010 From: lists at ruby-forum.com (Simon Vdm) Date: Sat, 2 Jan 2010 17:08:07 +0100 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard In-Reply-To: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> References: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> Message-ID: <67862e9bc1ff404cbe460d076a8f27a2@ruby-forum.com> Antti Hakala wrote: > Hello, > I have a static gem of wxruby 2.0.1 that works on OS X Snow Leopard, > if somebody is interested. > I've tried it only on my own comp. It's about 9MB. I sure am! Can you send it to delirious AT atchoo DOT be ? Thanks! Simon -- Posted via http://www.ruby-forum.com/. From bureaux.sebastien at neuf.fr Mon Jan 4 04:16:32 2010 From: bureaux.sebastien at neuf.fr (Seb) Date: Mon, 04 Jan 2010 10:16:32 +0100 Subject: [wxruby-users] =?iso-8859-1?q?probl=E8me_de_fermeture_d=27applica?= =?iso-8859-1?q?tion_via_l=27ic=F4ne_de_la_barre_de_lancement_rapide?= Message-ID: <4B41B1F0.7080803@neuf.fr> Bonjour Alex. Quand j'ouvre mes applications et que je clique sur l'item "quittez" de l'ic?ne de la barre de lancement rapide, l'ic?ne dispara?t mais mes applications ne se ferme pas. Il faut que je passe dessus avec la souris pour que l'application se ferme. Je ne comprend pas, car ce code au d?part fonctionnait et maintenant il ne fonctionne plus??? Voici le code que j'utilise pour mes applications: class Icone1< TaskBarIcon def initialize(recettes) super() icone = Icon.new("images/icone.ico", BITMAP_TYPE_ICO) set_icon(icone, 'Cocktails-wxruby') evt_menu(Icone_Sortie) {onIcone_sortie} end def create_popup_menu menu = Menu.new menu.append(Icone_Sortie, "Quittez") return menu end def onIcone_sortie $icone.remove_icon() exit end end Je n'obtient aucun message d'erreur pour ce probl?me quand j'ex?cute mes applications avec scite. Est-ce moi qui est fait une erreur? La cause vient peut ?tre des changements effectu?s suivant les diff?rentes versions de wxruby? Ou peut on consulter les divers changements apport?s ? chaque version de wxruby? merci From bureaux.sebastien at neuf.fr Tue Jan 5 03:32:32 2010 From: bureaux.sebastien at neuf.fr (Seb) Date: Tue, 05 Jan 2010 09:32:32 +0100 Subject: [wxruby-users] =?iso-8859-1?q?probl=E8me_de_fermeture_d=27applica?= =?iso-8859-1?q?tion_via_l=27ic=F4ne_de_la_barre_de_lancement_rapide?= In-Reply-To: <4B41B1F0.7080803@neuf.fr> References: <4B41B1F0.7080803@neuf.fr> Message-ID: <4B42F920.4030306@neuf.fr> J'ai tester mes applications sur un pc autre que le mien, et il n'y a pas ce probl?me de fermeture d'application via l'ic?ne de la barre de lancement rapide, ?a fonctionne correctement. Donc le probl?me apparement proviendrait de mon pc. Si quelqu'un peut avoir une r?ponse ? cela. merci From lists at ruby-forum.com Fri Jan 8 05:14:19 2010 From: lists at ruby-forum.com (Nome Cognome) Date: Fri, 8 Jan 2010 11:14:19 +0100 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> Message-ID: <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> This is a Google translation. My system is: - Ubuntu 9.10, - C++ compiler version g++-4.4.1-4ubuntu8, - wx 2.8.10, - Swig 1.3.38, - Ruby 1.9.1p376, - wxRuby 2.0.1. Everything's fine until the compilation and installation of SWIG as indicated in the Guide http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages, when compiling wxRuby 2.0.1, it ends with a large number of warnings and errors, citing the end: /usr/include/GL/glxext.h:847: error: typedef ?PFNGLXENUMERATEVIDEODEVICESNVPROC? is initialized (use decltype instead) /usr/include/GL/glxext.h:847: error: ?Display? was not declared in this scope /usr/include/GL/glxext.h:847: error: ?dpy? was not declared in this scope /usr/include/GL/glxext.h:848: error: expected primary-expression before ?int? /usr/include/GL/glxext.h:849: error: expected primary-expression before ?int? /usr/include/GL/glxext.h:850: error: typedef ?PFNGLXBINDVIDEODEVICENVPROC? is initialized (use decltype instead) /usr/include/GL/glxext.h:850: error: ?Display? was not declared in this scope /usr/include/GL/glxext.h:850: error: ?dpy? was not declared in this scope /usr/include/GL/glxext.h:851: error: expected primary-expression before ?unsigned? /usr/include/GL/glxext.h:852: error: expected primary-expression before ?unsigned? /usr/include/GL/glxext.h:853: error: expected primary-expression before ?const? src/GLCanvas.cpp: In function ?VALUE _wrap_new_wxGLCanvas(int, VALUE*, VALUE)?: src/GLCanvas.cpp:2742: warning: format not a string literal and no format arguments src/GLCanvas.cpp:2748: warning: format not a string literal and no format arguments src/GLCanvas.cpp:2799: warning: format not a string literal and no format arguments src/GLCanvas.cpp:2819: warning: format not a string literal and no format arguments src/GLCanvas.cpp:2822: warning: format not a string literal and no format arguments src/GLCanvas.cpp: In function ?VALUE _wrap_wxGLCanvas_SetCurrent(int, VALUE*, VALUE)?: src/GLCanvas.cpp:2872: warning: format not a string literal and no format arguments src/GLCanvas.cpp: In function ?VALUE _wrap_wxGLCanvas_SetColour(int, VALUE*, VALUE)?: src/GLCanvas.cpp:2896: warning: format not a string literal and no format arguments src/GLCanvas.cpp:2901: warning: format not a string literal and no format arguments src/GLCanvas.cpp: In function ?VALUE _wrap_wxGLCanvas_SwapBuffers(int, VALUE*, VALUE)?: src/GLCanvas.cpp:2922: warning: format not a string literal and no format arguments src/GLCanvas.cpp: In function ?VALUE _wrap_disown_wxGLCanvas(int, VALUE*, VALUE)?: src/GLCanvas.cpp:2943: warning: format not a string literal and no format arguments rake aborted! Command failed with status (1): [g++ -c -I/usr/lib/wx/include/gtk2-unicod...] (See full trace by running task with --trace) I also tried to install libwxgtk2.8-dbg and wx2.8-headers, but the result does not change. Can you help me in any way? For example, you can have a Ruby gem that is specific to Ubuntu 9.10 help non-expert like me to compile from source? wxRuby is a great and beautiful GUI toolkit for the Ruby, I regret very much not using it. Thanks to all and please excuse the bad English. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Fri Jan 8 06:48:44 2010 From: mario at ruby-im.net (Mario Steele) Date: Fri, 8 Jan 2010 06:48:44 -0500 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> Message-ID: To all: You can download the version of wxRuby 2.0.1 that I have compiled specifically for Ubuntu 9.10. This version was compiled for Ruby 1.8.7 p174, which is the default available in the Ubuntu Repositories. Run the following commands in your Console: wget http://www.trilake.net/wxRuby/wxruby-2.0.1-x86-linux.gem sudo gem install --local wxruby-2.0.1-x86-linux.gem sudo apt-get install libwxgtk2.8-0 libwxbase2.8-0 irb require 'rubygems' require 'wx' exit If everything installed properly, the above irb require statements should have outputted 2 "=> true" results. Which means that wxRuby is now installed, and working for you. hth, Mario P.S. Anyone looking for a version for Ruby 1.9 series of interpreter, let me know, and I'll get a compile out there. On Fri, Jan 8, 2010 at 5:14 AM, Nome Cognome wrote: > This is a Google translation. > > My system is: > - Ubuntu 9.10, > - C++ compiler version g++-4.4.1-4ubuntu8, > - wx 2.8.10, > - Swig 1.3.38, > - Ruby 1.9.1p376, > - wxRuby 2.0.1. > > Everything's fine until the compilation and installation of SWIG as > indicated in the Guide > http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages > , > when compiling wxRuby 2.0.1, it ends with a large number of warnings and > errors, citing the end: > > /usr/include/GL/glxext.h:847: error: typedef > ?PFNGLXENUMERATEVIDEODEVICESNVPROC? is initialized (use decltype > instead) > /usr/include/GL/glxext.h:847: error: ?Display? was not declared in this > scope > /usr/include/GL/glxext.h:847: error: ?dpy? was not declared in this > scope > /usr/include/GL/glxext.h:848: error: expected primary-expression before > ?int? > /usr/include/GL/glxext.h:849: error: expected primary-expression before > ?int? > /usr/include/GL/glxext.h:850: error: typedef > ?PFNGLXBINDVIDEODEVICENVPROC? is initialized (use decltype instead) > /usr/include/GL/glxext.h:850: error: ?Display? was not declared in this > scope > /usr/include/GL/glxext.h:850: error: ?dpy? was not declared in this > scope > /usr/include/GL/glxext.h:851: error: expected primary-expression before > ?unsigned? > /usr/include/GL/glxext.h:852: error: expected primary-expression before > ?unsigned? > /usr/include/GL/glxext.h:853: error: expected primary-expression before > ?const? > src/GLCanvas.cpp: In function ?VALUE _wrap_new_wxGLCanvas(int, VALUE*, > VALUE)?: > src/GLCanvas.cpp:2742: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp:2748: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp:2799: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp:2819: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp:2822: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp: In function ?VALUE _wrap_wxGLCanvas_SetCurrent(int, > VALUE*, VALUE)?: > src/GLCanvas.cpp:2872: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp: In function ?VALUE _wrap_wxGLCanvas_SetColour(int, > VALUE*, VALUE)?: > src/GLCanvas.cpp:2896: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp:2901: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp: In function ?VALUE _wrap_wxGLCanvas_SwapBuffers(int, > VALUE*, VALUE)?: > src/GLCanvas.cpp:2922: warning: format not a string literal and no > format arguments > src/GLCanvas.cpp: In function ?VALUE _wrap_disown_wxGLCanvas(int, > VALUE*, VALUE)?: > src/GLCanvas.cpp:2943: warning: format not a string literal and no > format arguments > rake aborted! > Command failed with status (1): [g++ -c > -I/usr/lib/wx/include/gtk2-unicod...] > > (See full trace by running task with --trace) > > > I also tried to install libwxgtk2.8-dbg and wx2.8-headers, but the > result does not change. Can you help me in any way? > For example, you can have a Ruby gem that is specific to Ubuntu 9.10 > help non-expert like me to compile from source? > wxRuby is a great and beautiful GUI toolkit for the Ruby, I regret very > much not using it. > > Thanks to all and please excuse the bad English. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Jan 8 09:28:26 2010 From: lists at ruby-forum.com (Nome Cognome) Date: Fri, 8 Jan 2010 15:28:26 +0100 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> Message-ID: Mario Steele wrote: P.S. Anyone looking for a version for Ruby 1.9 series of interpreter, > let > me know, and I'll get a compile out there. Hello Mario. I would be really grateful if you could have a version of wxRuby for Ruby 1.9 series of interpreter. Thanks in advance. :) -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Fri Jan 8 10:14:19 2010 From: mario at ruby-im.net (Mario Steele) Date: Fri, 8 Jan 2010 10:14:19 -0500 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> Message-ID: I will work on it tonight, and hopefully have it then. I will send an email out when I get it done. On Fri, Jan 8, 2010 at 9:28 AM, Nome Cognome wrote: > Mario Steele wrote: > P.S. Anyone looking for a version for Ruby 1.9 series of interpreter, > > let > > me know, and I'll get a compile out there. > > Hello Mario. I would be really grateful if you could have a version of > wxRuby for Ruby 1.9 series of interpreter. > > Thanks in advance. :) > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Jan 10 11:48:16 2010 From: lists at ruby-forum.com (Lui Kore) Date: Sun, 10 Jan 2010 17:48:16 +0100 Subject: [wxruby-users] Problem with StyledTextCtrl Message-ID: <4641f2592b5935f3f17c78bab8084c67@ruby-forum.com> I am using StyledTextCtrl, and want to get direct function and pointer from the handle so that I can pass them to some old codes written in C. But the output of the following code is "0, 0", which means send_msg() returns nothing but 0. require 'wx' module Wx App.run do frame = Frame.new nil, :title => "stc" stc = StyledTextCtrl.new frame, -1 # http://www.scintilla.org/Steps.html fn = stc.send_msg 2184, 0, 0 # SCI_GETDIRECTFUNCTION ptr = stc.send_msg 2185, 0, 0 # SCI_GETDIRECTPOINTER puts "#{fn}, #{ptr}" #=> "0, 0" ? frame.show end end Why ? My environments: Windows7, wxruby-ruby19(2.0.1) I also tried stc.get_handle() and pass the handle to C, but still got no response. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 15 19:12:11 2010 From: lists at ruby-forum.com (Michael Mcandrews) Date: Sat, 16 Jan 2010 01:12:11 +0100 Subject: [wxruby-users] WxScrolledWindow (putting into) In-Reply-To: References: <14faf8a8df53b4b457ba8599f5643b8e@ruby-forum.com> Message-ID: <8b95b92f258e10c9e36910bf6eec79d0@ruby-forum.com> Mario Steele wrote: > An example, would be: > > class MyFrame < Wx::Frame > def initialize() > super nil > @scrolled = Wx::ScrolledWindow.new(self) > @panel = Wx::Panel.new(@scrolled) > text1 = Wx::StaticText.new(@panel,-1,"Hello World") > edit1 = Wx::TextCtrl.new(@panel,-1,"") > vbox = Wx::BoxSizer.new(Wx::VERTICAL) > vbox.add text1 > vbox.add edit1, 1, Wx::ALL | Wx::EXPAND > @panel.sizer = vbox > end > end Thanks for the example, that makes it clear what the methodology is; however, when I run your code I get the same results, exactly. The StaticText is in the upper left hand corner, it is almost completely overwritten (only the left-most pixel of the text is visible) by the TextCtrl, which does function proprely. I can add size and position parameters to both the StaticText and TextCtrl, but they have no effect, the controls are always placed in the upper left-hand corner of the frame, just where they would appear if the items had been "declared", but not yet "defined" as to where they appear in the "form". I am running on a WinXP system, using ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] and wxruby 2.0.0. Is this a version mis-match problem? -- Posted via http://www.ruby-forum.com/. From bruno.lehyaric at gmail.com Sun Jan 17 16:07:59 2010 From: bruno.lehyaric at gmail.com (bruno le hyaric) Date: Sun, 17 Jan 2010 22:07:59 +0100 Subject: [wxruby-users] Does wxRuby include Gizmos controls? Message-ID: Hi, I'm starting to use wxRuby for personal projects. Originally, I used wxPython in my company because they don't want to install the Ruby environment just for me... But at home, I still prefer the Ruby language... So, wxWidgets is a great library, but wxPythons add some intersting stuff. I'm specially interested by the TreeListCtrl. it seems that this control belongs to Gizmos C++ library. I'm wondering if the Gizmos library is included in wxRuby or do you plan to include it soon? Bruno. From mario at ruby-im.net Sun Jan 17 16:29:08 2010 From: mario at ruby-im.net (Mario Steele) Date: Sun, 17 Jan 2010 16:29:08 -0500 Subject: [wxruby-users] Does wxRuby include Gizmos controls? In-Reply-To: References: Message-ID: Hello Bruno, I've looked at the Gizmos library, which was moved out of the core of wxWidgets before version 2.8. And as far as I can see, the only supported ports for Gizmos library is wxMSW, according to wxCode's page for it. Unfortunately, we do not include support for Gizmos, as we try to keep wxRuby cross-platform capable. If Gizmos is truely cross-platform, then it may be possible to build a wrapper around Gizmos, and have it work with wxRuby. I do not know, as we have not officially tried to create extensions for other external libraries for wxWidgets, to work with wxRuby. We would like to see something like this done, in particular with wxWebKit as a possible replacement for the wxWidgets wxHtmlCtrl class, but we haven't had a chance to be able to do any work with it, at least I haven't. I think Alex may have, but he would be the one to answer that. hth, Mario On Sun, Jan 17, 2010 at 4:07 PM, bruno le hyaric wrote: > Hi, > > I'm starting to use wxRuby for personal projects. > > Originally, I used wxPython in my company because they don't want to > install the Ruby environment just for me... But at home, I still > prefer the Ruby language... > > So, wxWidgets is a great library, but wxPythons add some intersting stuff. > I'm specially interested by the TreeListCtrl. it seems that this > control belongs to Gizmos C++ library. > > I'm wondering if the Gizmos library is included in wxRuby or do you > plan to include it soon? > > Bruno. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Jan 18 03:09:18 2010 From: lists at ruby-forum.com (Nome Cognome) Date: Mon, 18 Jan 2010 09:09:18 +0100 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> Message-ID: Mario Steele wrote: > I will work on it tonight, and hopefully have it then. I will send an > email > out when I get it done. Hi Mario. Any news on this? Thanks. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Mon Jan 18 08:58:59 2010 From: mario at ruby-im.net (Mario Steele) Date: Mon, 18 Jan 2010 08:58:59 -0500 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> Message-ID: My apologizes Nome, I had been working on upgrading my system, and getting Ruby 1.9 gem made was on the back burner. I have finished it, after I got everything setup again with the new hardware. http://www.trilake.net/wxRuby/wxruby-ruby19-2.0.1-x86-linux.gem This gem will be compatible with Ubuntu 9.10, with everything (Except SWIG), taken directly from the Repositories. If you have any problems with this version, please feel free to let me know. Remember to install via: sudo gem1.9 install --local wxruby-ruby19-2.0.1-x86-linux.gem If the gem command attains the 1.9 part, otherwise, just use the gem command. hth, Mario On Mon, Jan 18, 2010 at 3:09 AM, Nome Cognome wrote: > Mario Steele wrote: > > I will work on it tonight, and hopefully have it then. I will send an > > email > > out when I get it done. > > Hi Mario. Any news on this? > > Thanks. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Mon Jan 18 09:02:53 2010 From: mario at ruby-im.net (Mario Steele) Date: Mon, 18 Jan 2010 09:02:53 -0500 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> <9d20a1091810cb9df5d6bedc9f84df50@ruby-forum.com> Message-ID: Sorry, seems that the gem is messed up, please don't download from that URL till I say it is alright. On Mon, Jan 18, 2010 at 8:58 AM, Mario Steele wrote: > My apologizes Nome, > > I had been working on upgrading my system, and getting Ruby 1.9 gem made > was on the back burner. I have finished it, after I got everything setup > again with the new hardware. > > http://www.trilake.net/wxRuby/wxruby-ruby19-2.0.1-x86-linux.gem > > This gem will be compatible with Ubuntu 9.10, with everything (Except > SWIG), taken directly from the Repositories. If you have any problems with > this version, please feel free to let me know. > > Remember to install via: > > sudo gem1.9 install --local wxruby-ruby19-2.0.1-x86-linux.gem > > If the gem command attains the 1.9 part, otherwise, just use the gem > command. > > > hth, > > Mario > > On Mon, Jan 18, 2010 at 3:09 AM, Nome Cognome wrote: > >> Mario Steele wrote: >> > I will work on it tonight, and hopefully have it then. I will send an >> > email >> > out when I get it done. >> >> Hi Mario. Any news on this? >> >> Thanks. >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > > -- > Mario Steele > http://www.trilake.net > http://www.ruby-im.net > http://rubyforge.org/projects/wxruby/ > http://rubyforge.org/projects/wxride/ > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Jan 18 18:17:24 2010 From: alex at pressure.to (Alex Fenton) Date: Mon, 18 Jan 2010 23:17:24 +0000 Subject: [wxruby-users] Does wxRuby include Gizmos controls? In-Reply-To: References: Message-ID: <4B54EC04.5040208@pressure.to> hi bruno bruno le hyaric wrote: > I'm wondering if the Gizmos library is included in wxRuby or do you > plan to include it soon? like Mario says, it's not included at the moment. adding additional classes isn't uaully very hard using SWIG and the existing wxRuby glue code. But we've tended to be pretty conservative in adding more build dependencies to the core library for wxRuby 2.0, which compiles everything into a single binary. wxRuby 3.0 is planned to be more modular, so other developers could add on wxRuby wrappers around extra C++ classes like Gizmos and the things on wxCode. But wxRuby 3.0 isn't being actively worked on just at the moment. alex From lists at ruby-forum.com Wed Jan 20 04:46:56 2010 From: lists at ruby-forum.com (Carlo Bertini) Date: Wed, 20 Jan 2010 10:46:56 +0100 Subject: [wxruby-users] undefined reference to `wxGraphicsRenderer::CreateBitmap(wxB Message-ID: <6dc056a76c2ca344dc2a224887d89b58@ruby-forum.com> Hi to all, i've compiled wxWidgets with this options: ./configure --enable-optimise --enable-stl --enable-unicode --disable-threads --enable-static --with-opengl --disable-shared --enable-monolithic --disable-debug --with-libjpeg=builtin --with-libpng=builtin --with-zlib=builtin --enable-graphics_ctx --enable-mediactrl --enable-unicode --with-libtiff=builtin --with-expat=builtin --enable-gui -enable-xrc --enable-mdi --enable-gif --enable-pcx --enable-iff --enable-png --enable-xpm and also compiled StyledTextCtrl . My system is : Windows xp sp3 ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] gcc.exe 3.4.5 swig.exe 1.3.38 rake 0.8.7 when compiled wxruby (from svn), i've recived this error: c:\msys\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: warning: auto-importing has been activated without --enable-auto-import spe cified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs. C:\msys\1.0\src\wxWidgets-2.8.10/lib/libwx_mswu-2.8.a(monolib_graphcmn.o):graphcmn.cpp:(.text+0x3374): undefined reference to `wxGraphicsRenderer::CreateBitmap(wxBitmap const&)' collect2: ld returned 1 exit status rake aborted! Command failed with status (1): [g++ -shared -L. obj/AboutDialogInfo.o o...] -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jan 21 08:28:34 2010 From: lists at ruby-forum.com (Carlo Bertini) Date: Thu, 21 Jan 2010 14:28:34 +0100 Subject: [wxruby-users] undefined reference to `wxGraphicsRenderer::CreateBitmap(wxB In-Reply-To: <6dc056a76c2ca344dc2a224887d89b58@ruby-forum.com> References: <6dc056a76c2ca344dc2a224887d89b58@ruby-forum.com> Message-ID: [SOLVED] IF i compile wxWidgests 2.8.10 i've this error: C:\msys\1.0\src\wxWidgets-2.8.10/lib/libwx_mswu-2.8.a(monolib_graphcmn.o):graphcmn.cpp:(.text+0x3374): undefined reference to `wxGraphicsRenderer::CreateBitmap(wxBitmap const&)' If i compile with wxWidgets 2.8.9 WORK !!! this is the gem : svn version: 2107 http://www.waydotnet.com/ruby/wxruby-ruby19-2.0.1.svn-x86-mingw32.gem Only problem when install without --no-rdoc :D Carlo Bertini -- Posted via http://www.ruby-forum.com/. From jdezenzio at gmail.com Fri Jan 22 10:39:40 2010 From: jdezenzio at gmail.com (Joel Dezenzio) Date: Fri, 22 Jan 2010 10:39:40 -0500 Subject: [wxruby-users] Need Help with understanding Threads, Timers, and Yield Message-ID: <000501ca9b79$1df27ee0$59d77ca0$@com> Hi Everyone, I'm posting this to the correct list now. I'm a new GUI developer that is having some difficulty understanding some of the nuances of GUI development with Ruby and want to hopefully get some of my questions answered. First, let me provide my setup: . I'm using Ruby 1.9.1 patch 243 installed from mingw32-ruby-1.9.1-wxruby-2.0.1-setup.exe . . I'm using DialogBlocks as my GUI designer. . I'm using wg_sugar/xrcise for compiling my xrc source files. . I'm using Windows Vista and Netbeans 6.8 IDE for my development environment. . I've created a full project template to make it easier to develop my GUIs going forward using all of this setup. My design template is segmented as follows: . \icons . \images . \lib . \nbproject . \psd . \tasks . \ui . Rakefile . Start My xrc source and the ruby files that handle that source are stored in my UI directory. My lib folder contains my main program ruby files and the tasks folder contains my rake tasks. The rest of the folders are pretty self-explanatory. The start file houses the following in the first file listed here: http://gist.github.com/283794 Notes: I'm first requiring any files I need and then loading my globals and a wxhelper file. The wxhelper file is fairly simple in that it's loading all of the ruby files that are listed in my UI directory for handling the GUi frames. In addition, any pre-init type of events that need to take place (building directories, reading configuration files, etc. are done with WxHelper. Then I'm loading my main.rb file which houses all of the meat of my code, including the listener events. As you can see on lines 16-18 of the start file, I'm starting a timer to pass threads. I believe this is the proper place to put this code, but I may be mistaken. I'll ask questions about this in a moment. Lastly, my main.rb file handles something similar in the second file listed here: http://gist.github.com/283794 When I'm ready to work on my GUI development, I simply design in DialogBlocks, save my xrc, run a rake task that automatically builds my ruby files from xrc using xrcise, and then type ruby start to execute my GUI. I prefer this type of setup because it feels right. However, it may not be the most efficient way to design and therefore, if there is a better way to implement a design template, please let me know. So, now that I have all of my pre-requisite mish-mosh out of the way (my apologies for the length), you at least understand how I'm operating and can possibly answer my questions a little more easily now. Here are my questions: Question 1: Did I place the timer event in the right spot? I placed it in the init section of my start script. Second-guessing myself, the only other place I felt I could place it would be within the initialize section of my main.rb script but this didn't feel right. Because my program is starting with the init, I felt it should go here. If I'm mistaken, please correct me and explain why it shouldn't go here. Question 2: My program is going to be using several open socket connections simultaneously and CPU processing will occur as well. Therefore, I'm trying to simplify my template by incorporating threads to handle CPU/IO blocking. I believe I understand the processes, but my biggest issue may be WHEN and HOW to implement threads in my programs. Coming from other languages where simple gui designs didn't incorporate threading, I can understand and appreciate the concept behind threading. I had first thought about implementing fibers but I don't believe this is the best thing for me to do since I'm going to be handling cpu blocking. In addition, some java users mention that even if you use a fiber, you have to have a thread to manage it. So, threading is the way I want to go. I'm a newbie and novice programmer in terms of threading and even looking over the examples, I just can't wrap my head around it at the moment. Any help would be appreciated with reference to my code listed above and when to use threads and also how to use them. Question 3: I really do love DialogBlocks because it does simplify GUI design. I read and parsed my own set of notes which I'll outline below and post the follow-up question: In DBLK, all top-level Frames, Dialogs and Panels become Ruby classes. The name you type in the class field within DBLK becomes the class name in your Ruby program. Likewise, for the controls "within" a container, the DBLK class name becomes the name of a Ruby module in your program that will be used to extend the control. How am I supposed to properly include the classes and modules within my program template structure? Should I be placing multiple modules and classes in the same main.rb file or should I place them in separate files and (require?/load?) them from my main.rb file? For instance, the first class that I had which is listed in main.rb is GuiMain which is referenced from the main gui frame that acts as the parent container for my application. I haven't added any other elements yet that will become modules or classes, so I'm just uncertain where these code bits will be placed, or how to properly include them in my GUI. Any help concerning this would be appreciated. Question 4: This is more of a dialogblocks question but I'm certain someone who may use dialogblocks can answer it for me. The question I have relates to sizers and my application as a whole. I understand the concept of sizers but what I don't understand is how to properly size my Gui App depending on resolution sizes of other users' desktops. For instance, right now I have a simple 700 x 550 starting gui app. I know that if I place a vertical sizer into my app and a main panel into that sizer, that whenever someone resizes the app, it will stretch out the main panel as well. However, this appears frustrating to me mainly because I'm heavily into CSS designing and I'm always trying to optimize for different browser sizes. What is a good starting application size (and the absolute maximum size you should place as a minimum starting point, before resizing?) Or, is there a way to test for desktop resolution across all OS platforms, and determine an initial gui app starting size based on that resolution type? These four question outlines are my biggest concerns at the moment. I'm a very fast learner, have a lot of free time to read/learn and browse api, etc. I soak up information like a sponge which is a good thing. So, please feel free to inundate me with as much information possible about these questions and/or other novice items that I may not know about. I like the feel of WxRuby and I'm really excited to get down into porting some of my older GUI app code over to WxRuby. Many thanks in advance. Sincerely, Joel Dezenzio -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.lehyaric at gmail.com Fri Jan 22 11:44:14 2010 From: bruno.lehyaric at gmail.com (bruno le hyaric) Date: Fri, 22 Jan 2010 17:44:14 +0100 Subject: [wxruby-users] Does wxRuby include Gizmos controls? In-Reply-To: References: Message-ID: Ok, Thanks both of you, Alex and Mario. I will use the standard TreeCtrl from wxRuby for the moment. Bruno. 2010/1/17, bruno le hyaric : > Hi, > > I'm starting to use wxRuby for personal projects. > > Originally, I used wxPython in my company because they don't want to > install the Ruby environment just for me... But at home, I still > prefer the Ruby language... > > So, wxWidgets is a great library, but wxPythons add some intersting stuff. > I'm specially interested by the TreeListCtrl. it seems that this > control belongs to Gizmos C++ library. > > I'm wondering if the Gizmos library is included in wxRuby or do you > plan to include it soon? > > Bruno. > From lists at ruby-forum.com Fri Jan 22 12:36:47 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Fri, 22 Jan 2010 18:36:47 +0100 Subject: [wxruby-users] Question on using images on panels Message-ID: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> I'm trying to place a simple logo on one of the panels within the center of my main gui. In DialogBlocks, the panel class is LogoPanel which when using xrcise to generate the ruby file from xrc, creates: @logo = finder.call("logo") @logo.extend(LogoPanel) In my main loop I have: class GuiMain < XrcFrameMain def initialize super() evt_menu( @mb_fm_new, :on_new_workspace ) evt_menu( @mb_fm_save, :on_save_workspace ) evt_menu( @mb_fm_exit, :on_exit ) st_response("Idle...",2) st_response(Time.now.strftime("%B %d, %Y"), 1) end end module LogoPanel # logo image img_file = File.join( File.dirname(__FILE__)+"/../images/kirin", 'logo.png') @bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_PNG) self.paint do |dc| dc.draw_line(@bitmap, @offset, @offset, false) end end which generates the following error: E:\Gui-Development\Kirin>ruby start E:/Gui-Development/Kirin/lib/main.rb:25:in `': undefined metho d `paint' for LogoPanel:Module (NoMethodError) from E:/Gui-Development/Kirin/lib/main.rb:20:in `' from start:12:in `load' from start:12:in `
' I can't make the LogoPanel a class because I will receive an error that it was expecting a module to be there. So, I believe the class for this particular panel expects a module class. Without this code in there, or just using: module LogoPanel end .. the gui will show but the section where the logo should appear is all white as it is missing the paint. This is a rather important topic for me because I'd like to understand better how to paint and change the appearance of my GUI in many areas... For instance, I want to add a custom png file as the background of my entire GUI and then paint the logo on the side, etc. This app will be used cross platform so the images will have to be converted to a usable source, which I haven't gotten into yet. Any ideas on everything I just posted? Thanks. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Fri Jan 22 15:35:53 2010 From: mario at ruby-im.net (Mario Steele) Date: Fri, 22 Jan 2010 15:35:53 -0500 Subject: [wxruby-users] Question on using images on panels In-Reply-To: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> References: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> Message-ID: Hello Alpha, On Fri, Jan 22, 2010 at 12:36 PM, Alpha Blue wrote: > I'm trying to place a simple logo on one of the panels within the center > of my main gui. In DialogBlocks, the panel class is LogoPanel which > when using xrcise to generate the ruby file from xrc, creates: > > @logo = finder.call("logo") > @logo.extend(LogoPanel) > > In my main loop I have: > > class GuiMain < XrcFrameMain > def initialize > super() > evt_menu( @mb_fm_new, :on_new_workspace ) > evt_menu( @mb_fm_save, :on_save_workspace ) > evt_menu( @mb_fm_exit, :on_exit ) > st_response("Idle...",2) > st_response(Time.now.strftime("%B %d, %Y"), 1) > end > end > > module LogoPanel > # logo image > img_file = File.join( File.dirname(__FILE__)+"/../images/kirin", > 'logo.png') > @bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_PNG) > self.paint do |dc| > dc.draw_line(@bitmap, @offset, @offset, false) > end > end > > This part is where you have the problem, your doing the call to self.paint in the top level of the module, which self is the Module Class, and in which does not have a paint method associated with the module itself. Even after you extend your object to include the Module, this code still is expecting self to be the Module, not the class instance that your extending. Therefore, your problem lies with this. The solution to this, is to do the following with your module: module LogoPanel def setup_resources img_file = File.join(File.dirname(__FILE__),"..","images","kirin","logo.png") @bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_ANY) self.evt_paint do |event| self.paint do |dc| dc.draw_bitmap(@bitmap,0,0,false) end end end end Then just after your @logo.extend(LogoPanel), you just type @logo.setup_resources() Now, you'll notice two things different in my version, compared to yours, as far as setting things up, I put everything into a Method that you will need to invoke, in order to get your Bitmap to use for drawing, and in the method in which I get the filename. With File.join(), it has a variable argument passing setup to the signature for it, so you can pass as many parameters to it that you want, and it will build up the path, with the operating system slash in use. This is the optimal method in which to build paths, as it's never a guarantee that the '/' slash character will work. File.join() will automatically use the correct path separator for you. Lastly, I used draw_bitmap, instead of draw_line, as this is just the most simplest way in which to do this, when not using a Wx::StaticBitmap, to display the Image, which is another option, instead of you drawing it yourself, as WxWidgets and wxRuby will handle the drawing of the bitmap for you. which generates the following error: > > E:\Gui-Development\Kirin>ruby start > E:/Gui-Development/Kirin/lib/main.rb:25:in `': > undefined metho > d `paint' for LogoPanel:Module (NoMethodError) > from E:/Gui-Development/Kirin/lib/main.rb:20:in ` (required)>' > from start:12:in `load' > from start:12:in `
' > > I can't make the LogoPanel a class because I will receive an error that > it was expecting a module to be there. So, I believe the class for this > particular panel expects a module class. Without this code in there, or > just using: > > module LogoPanel > end > > .. the gui will show but the section where the logo should appear is all > white as it is missing the paint. > > This is a rather important topic for me because I'd like to understand > better how to paint and change the appearance of my GUI in many areas... > > For instance, I want to add a custom png file as the background of my > entire GUI and then paint the logo on the side, etc. This app will be > used cross platform so the images will have to be converted to a usable > source, which I haven't gotten into yet. > As for this, if you want to use a custom png for the background of your entire GUI, the best suggestion to use, is the evt_erase_background method for catching background erases, and drawing custom images for the background of your application. In this method, you need to do the following: self.evt_erase_background do |event| self.paint do |dc| dc.draw_bitmap(@bitmap,0,0,false) end end hth, Mario > Any ideas on everything I just posted? > > Thanks. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Jan 22 16:32:01 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Fri, 22 Jan 2010 22:32:01 +0100 Subject: [wxruby-users] Question on using images on panels In-Reply-To: References: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> Message-ID: <3ac7381deeb0d7d4e720f2a0dfe1f5eb@ruby-forum.com> Hi Mario, I'm losing hair and you just saved me from pulling out the rest of it. My thanks! I actually understood everything you said and fixed it in a matter of 30 seconds. Once I saw how you extended the module, I felt a little silly. But, that's okay since I'm a novice designer in ruby. :) Here's what I did and why I did it with changes from you: My new module is: module LogoPanel def setup_resources img_file = File.join(File.dirname(__FILE__),"..","images","kirin","logo.png") @bitmap = Wx::Bitmap.new(img_file, Wx::BITMAP_TYPE_ANY) self.evt_paint do |event| self.paint do |dc| dc.draw_bitmap(@bitmap,0,0,false) end end end end And I actually accessed it in initializers like such: class GuiMain < XrcFrameMain def initialize super() # File Menu - new workspace evt_menu( @mb_fm_new, :on_new_workspace ) # File Menu - save workspace evt_menu( @mb_fm_save, :on_save_workspace ) # File Menu - exit evt_menu( @mb_fm_exit, :on_exit ) # Status Bar text (3 frames so 0,1,2 are relevant array positions) st_response("Idle...",2) st_response(Time.now.strftime("%B %d, %Y"), 1) # setup the logo here @logo.setup_resources() end end I didn't want to put the @logo.setup_resources() after the code in the ruby file that's being translated from XRC because it states not to change any of the file but to instead extend upon the file. My biggest issue has been trying to understand how to tie in modules and other classes and where to place the code. You've helped me out a bunch with regards to this. I plan on changing my initializers so that the events are all stored in a method like: def register_event_handler evt_menu( @mb_fm_new, :on_new_workspace ) evt_menu( @mb_fm_save, :on_save_workspace ) evt_menu( @mb_fm_exit, :on_exit ) end and then the initializers file can look like such: class GuiMain < XrcFrameMain def initialize super() # Status Bar text (3 frames so 0,1,2 are relevant array positions) st_response("Idle...",2) st_response(Time.now.strftime("%B %d, %Y"), 1) # setup the logo here @logo.setup_resources() # process events register_event_handler end end I can do the same for objects that I need to have painted. But, I'm unsure about how to go about painting the main gui. I see your code but I'm not sure I understand it. Is it going into my initializers? self.evt_erase_background do |event| self.paint do |dc| dc.draw_bitmap(@bitmap,0,0,false) end end and then supply a bitmap for it like I did with the logo? If so, then I understand what you are trying to tell me and I thank you once again. My largest issue was finding very little documentation on how to use both WxRuby and DialogBlocks together simultaneously. I've been figuring it all out as I go and the one tutorial I did fine was very basic and trivial. So, it didn't help me out as much as it could have. Thank you. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 22 16:43:32 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Fri, 22 Jan 2010 22:43:32 +0100 Subject: [wxruby-users] Question on using images on panels In-Reply-To: <3ac7381deeb0d7d4e720f2a0dfe1f5eb@ruby-forum.com> References: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> <3ac7381deeb0d7d4e720f2a0dfe1f5eb@ruby-forum.com> Message-ID: <3ff3f6713d5e40c2253332cc9b8f125a@ruby-forum.com> Hi Mario, It's all working now. Here's the touched up code: http://gist.github.com/284158 I'm able to color the background of the main gui and place the logo in. There's only one issue and that is I notice I see a border on the logo. My guess is it's due to a border I might have set in dialogblocks so I'll troubleshoot from there. thanks again. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 22 16:58:12 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Fri, 22 Jan 2010 22:58:12 +0100 Subject: [wxruby-users] Question on using images on panels In-Reply-To: <3ff3f6713d5e40c2253332cc9b8f125a@ruby-forum.com> References: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> <3ac7381deeb0d7d4e720f2a0dfe1f5eb@ruby-forum.com> <3ff3f6713d5e40c2253332cc9b8f125a@ruby-forum.com> Message-ID: <3ee023f987b3baa357e3a3a8132682a9@ruby-forum.com> Okay one last follow-up. Here's what it's looking like with the code. Keep in mind that these two images are just examples and not what I'll actually use in my GUI. http://i780.photobucket.com/albums/yy89/jdezenzio/kirin_tear.jpg The two problems I see are: The Kirin logo to the top left just below the toolbar has a tiny bit of gray space just above the top of it. In addition, it has some strange white border around the image. I checked dialogblocks and removed all of the borders, setting them to 0 and unclicked them but they still appear. Secondly, when the image is sized there's tearing across the platform. Lastly, I'm not sure how to use just a small one pixel png image and stretch it as the entire background of my program using this code. Thoughts? Many thanks. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jan 23 11:25:10 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Sat, 23 Jan 2010 17:25:10 +0100 Subject: [wxruby-users] Transparency on WxStaticText background? Message-ID: <2325bb83deed55d6e255db2802dd5579@ruby-forum.com> I've painted my gui and I like the background mesh for my gui. I want my static text to inherit the background paint of my gui. Instead I get a gray background around the static text. Here's a picture: http://i780.photobucket.com/albums/yy89/jdezenzio/example_background.jpg How do I make it so that the background of the StaticText is transparent? Thanks. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jan 23 12:07:32 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Sat, 23 Jan 2010 18:07:32 +0100 Subject: [wxruby-users] Question on using images on panels In-Reply-To: <3ee023f987b3baa357e3a3a8132682a9@ruby-forum.com> References: <6b26620197d52e953883d0a1f7400681@ruby-forum.com> <3ac7381deeb0d7d4e720f2a0dfe1f5eb@ruby-forum.com> <3ff3f6713d5e40c2253332cc9b8f125a@ruby-forum.com> <3ee023f987b3baa357e3a3a8132682a9@ruby-forum.com> Message-ID: My fix for this was the following: 1. Until I can figure out how to make a small static image (say 1px x 10px) stretch and fill the entire window of my gui on user resize, and have it paint correctly, I ended up forcing a no-resize option on the gui and created a static image using the suggestions posted above. 2. The small gap between the picture was borders that were set on the sizers themselves with dialogblocks. On almost all elements that dialogblocks places on the screen, they all seem to start out with a 5 width top,right,left,bottom border. So, if anyone encounters something similar, make sure to remove all the borders. The same thing happens when you insert spacers. So, this particular issue is closed unless someone can guide me with a step-by-step process on how to set a small .png as a scaled background on resize events. Thanks. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Sat Jan 23 15:57:48 2010 From: alex at pressure.to (Alex Fenton) Date: Sat, 23 Jan 2010 20:57:48 +0000 Subject: [wxruby-users] Transparency on WxStaticText background? In-Reply-To: <2325bb83deed55d6e255db2802dd5579@ruby-forum.com> References: <2325bb83deed55d6e255db2802dd5579@ruby-forum.com> Message-ID: <4B5B62CC.3030900@pressure.to> On 23/01/2010 16:25, Alpha Blue wrote: > I've painted my gui and I like the background mesh for my gui. I want > my static text to inherit the background paint of my gui. Instead I get > a gray background around the static text. Here's a picture: > > http://i780.photobucket.com/albums/yy89/jdezenzio/example_background.jpg > > How do I make it so that the background of the StaticText is > transparent? > Hard to test without the code, but have you tried setting the DC's brush to TRANSPARENT? eg dc.brush = Wx::TRANSPARENT_BRUSH Also, take a look into evt_erase_background which is specifically designed for drawing bitmaps as a background on controls. hth alex From jdezenzio at gmail.com Sat Jan 23 16:17:02 2010 From: jdezenzio at gmail.com (Joel Dezenzio) Date: Sat, 23 Jan 2010 16:17:02 -0500 Subject: [wxruby-users] Transparency on WxStaticText background? In-Reply-To: <4B5B62CC.3030900@pressure.to> References: <2325bb83deed55d6e255db2802dd5579@ruby-forum.com> <4B5B62CC.3030900@pressure.to> Message-ID: <000001ca9c71$6970fb50$3c52f1f0$@com> Hi Alex, Basically, the control was created inside of DialogBlocks and extended into a module. The code appears like so: @title_st_one = finder.call("title_st_one") @title_st_one.extend(StaticTextControls) I then have a module for: module StaticTextControls self.evt_erase_background do |event| self.paint do |dc| dc.brush = Wx::TRANSPARENT_BRUSH # ?? end end end I can extend into this module using @title_st_one.repaint_my_control and I have some of the code above. I'm not wanting to paint a bitmap onto this control. I just want this control to become transparent so that the underlying bitmap which is already painted onto the parent frame shows. Example: Main Frame (already painted with bitmap) -- StaticTextControl (should be transparent so that it shows the Main Frame) I'll read up on evt_erase_background but I'm not sure how to use the dc.brush code you supplied with this example. Any further help would be appreciated. Sincerely, Joel Dezenzio Website Bio: http://jdezenzio.com/ Rails Production Sites: http://ncaastatpages.com From lists at ruby-forum.com Sat Jan 23 18:00:51 2010 From: lists at ruby-forum.com (John Baker) Date: Sun, 24 Jan 2010 00:00:51 +0100 Subject: [wxruby-users] Is there anyway to enable MultiSelect in the StyledTextCtrl Message-ID: I've noticed that the StyledTextControl (Scintilla basically) in wxWidgets has a great feature that allows multi-selections of text, just like TextMate. However wxRuby seems to have the function calls to support that feature. I'm wonder if there is a way to enable it or if there might be a way I could rewrite that wrapper to include that function. It seems strange that they would purposely omit that since they are seemingly pretty exhaustive on most functions calls. Any insight on this would be greatly appreciated. I'm trying to write an open source TextMate clone in Ruby and it's gonna be pretty hard without MultiSelect, I could probably hack something together but it'd be ugly. Thanks ahead of time. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jan 23 18:46:18 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Sun, 24 Jan 2010 00:46:18 +0100 Subject: [wxruby-users] Transparency on WxStaticText background? In-Reply-To: <000001ca9c71$6970fb50$3c52f1f0$@com> References: <2325bb83deed55d6e255db2802dd5579@ruby-forum.com> <4B5B62CC.3030900@pressure.to> <000001ca9c71$6970fb50$3c52f1f0$@com> Message-ID: So, I took the approach I believe you were trying to get me to do. I believe I found a partial answer but I'm still stumped. The partial answer is that I can't use a StaticText control and achieve transparency. Windows will force the background to the current theme and you can't get around that without drawing the text on the canvas instead. So, I removed the StaticText control and created a small panel using the same class and variable name. Here's what I have: module StaticTextControls def paint_text(message) self.evt_erase_background do |event| self.paint do |dc| dc.set_background_mode(Wx::TRANSPARENT) dc.set_brush(Wx::TRANSPARENT_BRUSH) dc.draw_text(message, 5, 5) end end end end and I call it using the following extension: @title_st_one.paint_text("Test for Paint") And here's what it shows: http://i780.photobucket.com/albums/yy89/jdezenzio/example_background2.jpg As you can see, the text is now painted on the panel and the panel is the gray looking rectangle behind the text. The problem I have now is how do I make the panel itself transparent so that the window behind it (the gradient steel blue I created) shows? Sure, I can paint a bitmap on the panel but I don't want to paint a bitmap image. I just want to force it to be transparent. Any ideas on how to do this? Thanks. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 10:20:00 2010 From: lists at ruby-forum.com (John Baker) Date: Sun, 24 Jan 2010 16:20:00 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? Message-ID: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> I've searched the documentation like crazy but I can't seem to find the events for each of the widgets. Any info on this would be greatly appreciated. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 10:48:45 2010 From: lists at ruby-forum.com (John Baker) Date: Sun, 24 Jan 2010 16:48:45 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> Message-ID: Maybe a better questions is: Is there a way to attack your event listeners to objects? Like can I take a control and add a mouse listener to it? If not then how would things be handled in a custom control -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 11:22:31 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Sun, 24 Jan 2010 17:22:31 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> Message-ID: Hi John, This page here: http://rubyhelp.org/docs/wxruby/ Scroll all the way down until you see the Events section. Each of the events sub-sections when clicked on will show you all of the evt_events for that section. It's a little confusing, I know, event to me. This is partly because the documentation was not created like a standard RI documentation. Your mouse events are here: http://rubyhelp.org/docs/wxruby/mouseevent.html When you have a control you can extend upon its behavior within a module. I'm still very new to wxruby but I'm learning quickly. Hopefully some of the links will help. I'm going to be very busy reading boards so don't be afraid to post your comments. I know sometimes this board appears very quiet, but it just needs some new life. Alex and Mario are great responders. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 11:30:23 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Sun, 24 Jan 2010 17:30:23 +0100 Subject: [wxruby-users] Is there anyway to enable MultiSelect in the StyledTextCtrl In-Reply-To: References: Message-ID: Hi John, Again, I managed to find this information out only because I downloaded the entire source file and scoured the events section of that file. It appears that events are separated for only two sections and that's StyledTextCtrl (Scintilla) and MediaCtrl events with prefix EVT_MEDIA. You can find the Scintilla events here: http://rubyhelp.org/docs/wxruby/styledtextctrl.html I found out this information because inside of the source files, there's a wx/classes/evthandler.rb file that contains all of the events around lines 168 - 1000. At the top of this event start lines were the following comments: # All StyledTextCtrl (Scintilla) events with prefix EVT_STC are dealt # with in the separate styledtextctrl.rb file. # # All MediaCtrl events with prefix EVT_MEDIA are dealt with in the # separate mediactrl.rb file So, the events were housed in: evthandler.rb (standard events) styledtextctrl.rb (Scintilla events) mediactrl.rb (Media Control events) Read my response to your previous thread about events to see where all of the events are located on the docs site of rubyforge. Take care mate. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 12:21:28 2010 From: lists at ruby-forum.com (John Baker) Date: Sun, 24 Jan 2010 18:21:28 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> Message-ID: <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> Hey I appreciate the info. I have checked all that info out already, the problem I have is how to implement it. Like I want to take a window and add key_down listener to it. I have a hard time finding how that is achievable. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 12:23:49 2010 From: lists at ruby-forum.com (John Baker) Date: Sun, 24 Jan 2010 18:23:49 +0100 Subject: [wxruby-users] Is there anyway to enable MultiSelect in the StyledTextC In-Reply-To: References: Message-ID: <5503da04d5c25ef4a8623c406b7742ee@ruby-forum.com> Again I appreciate you taking the time, however the Scintilla itself actually has a method which supports multiSelection where as StyledTextCtrl does not. That's unfortunate, but I was hoping to see if there was a way to extend it myself. -- Posted via http://www.ruby-forum.com/. From jdezenzio at gmail.com Sun Jan 24 12:31:30 2010 From: jdezenzio at gmail.com (Joel Dezenzio) Date: Sun, 24 Jan 2010 12:31:30 -0500 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> Message-ID: <000301ca9d1b$11c80740$355815c0$@com> Hi John, How are you developing your GUIs. Are you coding everything by hand or are you designing your layouts with a GUI designer and using Xrcise to compile the XRC (xml) for use with WxRuby? I'm doing the latter with DialogBlocks so how the events are tied into things are a little different for me because all of my elements are automatically setup for me and all I have to do is extend from those elements by setting up my listener events. If you have XRC and can post some code, I can help you or someone else can. Personally, I believe in GUI designers because I like to keep the graphical elements separate from the code. Let me know and post some code and I or someone else will try to help you out. Sincerely, Joel Dezenzio Website Bio: http://jdezenzio.com/ Rails Production Sites: http://ncaastatpages.com From lists at ruby-forum.com Sun Jan 24 13:32:02 2010 From: lists at ruby-forum.com (John Baker) Date: Sun, 24 Jan 2010 19:32:02 +0100 Subject: [wxruby-users] =?utf-8?q?Where_can_I_find_a_list_of_events_for_ea?= =?utf-8?q?ch=09widget=3F?= In-Reply-To: <000301ca9d1b$11c80740$355815c0$@com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <000301ca9d1b$11c80740$355815c0$@com> Message-ID: Well so far I have no code. What I'm doing is writing a IDE for programming that is similar to TextMate but written in ruby. I wanted to use StyledTextCtrl but while it has the charadded event that isn't really useful to me since it doesn't detect backspaces. So for lack of any other options I was going to try to create my own widget. I was just going to extend the scrolledWindow. It looks like it will do the trick, but I can't figure out how to capture keystrokes with it or even what events it possesses. So I'm kinda stuck unfortuantely. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 19:01:28 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Mon, 25 Jan 2010 01:01:28 +0100 Subject: [wxruby-users] =?utf-8?q?Where_can_I_find_a_list_of_events_for_ea?= =?utf-8?q?ch=09widget=3F?= In-Reply-To: References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <000301ca9d1b$11c80740$355815c0$@com> Message-ID: <29279e64d3c215d15837e83a35700ba2@ruby-forum.com> Hi John, One GUI application that I wrote in another language is a special search engine that also parses and finds code across the web. I just got back from a birthday party and performed a quick query for you and found the following: http://www.google.com/codesearch?as_q=Wx::StyledTextCtrl&hl=en&as_lang=ruby&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case= This might help you get started. Enjoy. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 24 19:18:16 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Mon, 25 Jan 2010 01:18:16 +0100 Subject: [wxruby-users] =?utf-8?q?Where_can_I_find_a_list_of_events_for_ea?= =?utf-8?q?ch=09widget=3F?= In-Reply-To: <29279e64d3c215d15837e83a35700ba2@ruby-forum.com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <000301ca9d1b$11c80740$355815c0$@com> <29279e64d3c215d15837e83a35700ba2@ruby-forum.com> Message-ID: <6e248242f6ea29d002f3d80d31ab44a8@ruby-forum.com> You could also look at incorporating highline with your app. I came across an interesting article concerning key captures here: http://blog.grayproductions.net/articles/i_just_want_one_character -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Jan 25 10:37:27 2010 From: alex at pressure.to (Alex Fenton) Date: Mon, 25 Jan 2010 15:37:27 +0000 Subject: [wxruby-users] Is there anyway to enable MultiSelect in the StyledTextCtrl In-Reply-To: References: Message-ID: <4B5DBAB7.9040001@pressure.to> hi John Baker wrote: > I've noticed that the StyledTextControl (Scintilla basically) in > wxWidgets has a great feature that allows multi-selections of text, just > like TextMate. However wxRuby seems to have the function calls to > support that feature. I'm wonder if there is a way to enable it or if > there might be a way I could rewrite that wrapper to include that > function. > On the scintilla site (http://www.scintilla.org/index.html) it seems that multi-selection was only added in Scintilla v2.0, but the wxWidgest 2.8 series is based on Scintilla versions around 1.71. So unfortunately this feature isn't available in C++ wxWidgets - it's not that it's omitted in Ruby. It may be that the SVN version of wxWidgets 3.0 supports Scintilla 2.x - did you see a reference to that? alex From alex at pressure.to Mon Jan 25 10:30:53 2010 From: alex at pressure.to (Alex Fenton) Date: Mon, 25 Jan 2010 15:30:53 +0000 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> Message-ID: <4B5DB92D.9050906@pressure.to> John Baker wrote: > Hey I appreciate the info. I have checked all that info out already, the > problem I have is how to implement it. Like I want to take a window and > add key_down listener to it. I have a hard time finding how that is > achievable. > You might find this document useful: http://wxruby.rubyforge.org/doc/eventhandlingoverview.html The only slightly complicated thing is understanding the difference between Command events and others. For other, generic events like mouse and key events, it's basically event_source.evt_type { # ... handler code } Since it inherits from Window, StyledTextCtrl should emit the evt_key_xxx family of events as well as the specialised STC events listed here: http://wxruby.rubyforge.org/doc/styledtextctrl.html hth alex From lists at ruby-forum.com Tue Jan 26 07:32:18 2010 From: lists at ruby-forum.com (John Baker) Date: Tue, 26 Jan 2010 13:32:18 +0100 Subject: [wxruby-users] =?utf-8?q?Where_can_I_find_a_list_of_events_for_ea?= =?utf-8?q?ch=09widget=3F?= In-Reply-To: <4B5DB92D.9050906@pressure.to> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <4B5DB92D.9050906@pressure.to> Message-ID: Hey Alex, yeah I checked it out, but the evt_key didn't seem to return any substantial data, or at least I wasn't able to get at it if it did. I printed out every single attribute and I never got a character code or anything. I may have missed something but I don't know. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Jan 26 07:56:04 2010 From: alex at pressure.to (Alex Fenton) Date: Tue, 26 Jan 2010 12:56:04 +0000 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <4B5DB92D.9050906@pressure.to> Message-ID: <4B5EE664.1050903@pressure.to> On 26/01/2010 12:32, John Baker wrote: > Hey Alex, yeah I checked it out, but the evt_key didn't seem to return > any substantial data, or at least I wasn't able to get at it if it did. > I printed out every single attribute and I never got a character code or > anything. > It (evt_char) seems to work fine for me - try the sample below. Note that you'll need to skip() the event if you want normal handling by the STC to proceed. Depending on the use case, you might also look into Wx::AcceleratorTable, which is a standardised, easy way to set up keyboard shortcuts, rather than handling the raw keypresses. alex -- require 'wx' class STCFrame < Wx::Frame def initialize super(nil, :title => 'Key Event Test') @stc = Wx::StyledTextCtrl.new(self) @stc.evt_char do | e | p e.key_code end end end Wx::App.run do STCFrame.new.show end From lists at ruby-forum.com Tue Jan 26 11:37:50 2010 From: lists at ruby-forum.com (Matteo Picciolini) Date: Tue, 26 Jan 2010 17:37:50 +0100 Subject: [wxruby-users] Create Image Message-ID: <553ddcaa004c47c1e431c23d138b7ff2@ruby-forum.com> I, i'm a problem with wx. I will do realized a software who take 8 piece of a photo frame and place a jpeg image on the middle of frame . How display them? How gem i will use ? I try with a Flex Grid Sizer but the result isn't good. Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Jan 26 18:44:49 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Wed, 27 Jan 2010 00:44:49 +0100 Subject: [wxruby-users] How do I add menu items from XRC source? Message-ID: I understand how to add normal menus and menu items by using append. However, when creating menus inside a designer and it's output to source, I can't figure out how to reference the menu from xrc to append items to. Example: I have a Menu called Favorites. Currently it has one item on it called Add Query to Favorites along with a separator (divider). I want to read from file and add favorite items beneath this separator, so normally if the code was written by me, I could do something like: favorites = Wx::Menu.new() favorites.append(101, "&Some Name", "Some Statusbar description") etc... However, in the ruby file that's pulled from XRC, the only variables listed are: @mb_main = finder.call("mb_main") .. which points to the entire menubar and.. @mb_fm_addfavorite = finder.call("mb_fm_addfavorite") .. which points to the add favorite menu item beneath the favorite menu. Notice that there's no favorite menu variable stored in the ruby file from xrc source and there's no place in the GUI designer (using dialogblocks) to place a custom ID for this menu. So, how do I reference the menu and append items to it? Thanks in advance. -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Tue Jan 26 21:06:48 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Wed, 27 Jan 2010 09:06:48 +0700 Subject: [wxruby-users] Create Image In-Reply-To: <553ddcaa004c47c1e431c23d138b7ff2@ruby-forum.com> References: <553ddcaa004c47c1e431c23d138b7ff2@ruby-forum.com> Message-ID: <26dadb3d1001261806i4d5db737g85522f45b7cac5cb@mail.gmail.com> Not quite sure what you want if you want similar size of every frame, there is Grid Sizer On Tue, Jan 26, 2010 at 11:37 PM, Matteo Picciolini wrote: > I, i'm a problem with wx. > I will do realized a software who take 8 piece of a photo frame and > place a jpeg image on the middle of frame . > How display them? How gem i will use ? > I try with a Flex Grid Sizer but the result isn't good. > Thanks > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Jan 27 10:43:52 2010 From: lists at ruby-forum.com (Matteo Picciolini) Date: Wed, 27 Jan 2010 16:43:52 +0100 Subject: [wxruby-users] Create Image In-Reply-To: <26dadb3d1001261806i4d5db737g85522f45b7cac5cb@mail.gmail.com> References: <553ddcaa004c47c1e431c23d138b7ff2@ruby-forum.com> <26dadb3d1001261806i4d5db737g85522f45b7cac5cb@mail.gmail.com> Message-ID: <7b3995198a6ebc176d3b49516979311b@ruby-forum.com> hendra kusuma wrote: > Not quite sure what you want > if you want similar size of every frame, > there is Grid Sizer Not exactly. I'm try to compose an image by use 9 differt image, 8 like this * * * * * * * * and one in the middle . The picture will united to make a photo frame, and the * are resize a run time . I try with GridSizer but i want no space within the picture . Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Jan 27 17:19:17 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Wed, 27 Jan 2010 23:19:17 +0100 Subject: [wxruby-users] How do I add menu items from XRC source? In-Reply-To: References: Message-ID: <15f9dc1ced953a2149e85c1231eae469@ruby-forum.com> Anyone able to answer this? I would think this would be an easy question to answer but it's looking more difficult by the minute. Other than creating all of my menus without using the GUI designer, what are my options for finding a menu only by the label? The only visible thing in the xrc source is: Under object class type of WxMenu. If I try to do a Wx::Menu.get_label('Favorites') I receive an undefined method for Menu. Yet in the api it says there's a get_label method which is a bit boggling. What am I doing wrong? I simply want to append one tiny menu item as a test underneath the menu label of Favorites, which is housed in XRC source, which does not provide a finder call variable assignment. Can anyone provide me a snippet of code that works for this? I'm certain I'm not the only one who designs a complete GUI inside of a designer. Don't be afraid to respond, even if you aren't completely sure. I'd rather have a few opinions that help me get pointed in the right direction than not having any opinions at all. Thanks. -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Wed Jan 27 21:06:57 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Thu, 28 Jan 2010 09:06:57 +0700 Subject: [wxruby-users] Create Image In-Reply-To: <7b3995198a6ebc176d3b49516979311b@ruby-forum.com> References: <553ddcaa004c47c1e431c23d138b7ff2@ruby-forum.com> <26dadb3d1001261806i4d5db737g85522f45b7cac5cb@mail.gmail.com> <7b3995198a6ebc176d3b49516979311b@ruby-forum.com> Message-ID: <26dadb3d1001271806p6d38e8f0p884bf8f8582e3e23@mail.gmail.com> On Wed, Jan 27, 2010 at 10:43 PM, Matteo Picciolini wrote: > hendra kusuma wrote: > > Not quite sure what you want > > if you want similar size of every frame, > > there is Grid Sizer > > > Not exactly. I'm try to compose an image by use 9 differt image, 8 like > this > > * * * > * * > * * * > > and one in the middle . The picture will united to make a photo frame, > and the * are resize a run time . > I try with GridSizer but i want no space within the picture . > Thanks > unfortunately, I am not good with this but from my short experience with wx lib, your best shot would probably your previous flex grid sizer unless you decide not to use wx, then SDL gem can be a consideration since it is a lib for making a game, you should have all necessary function to work with image -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Jan 27 22:23:41 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Thu, 28 Jan 2010 04:23:41 +0100 Subject: [wxruby-users] How do I add menu items from XRC source? In-Reply-To: <15f9dc1ced953a2149e85c1231eae469@ruby-forum.com> References: <15f9dc1ced953a2149e85c1231eae469@ruby-forum.com> Message-ID: <8b453e3d532bf723c7a67ffd15c628b3@ruby-forum.com> Well, I don't give up and because of that, I figured it out myself after a lot of trial and error. Because the xrc source does not provide anything for the menu besides the menu label, in order to append a menu item to that label you have to use the following example: Per above, the favorites menu was labeled as "Favorites". So, I put in the following code and it successfully added a menu item to the Favorites menu. favorites_menu = menu_bar.get_menu(menu_bar.find_menu('Favorites')) favorites_menu.append(Wx::ID_ANY, "My Favorite") -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Jan 27 23:19:16 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Thu, 28 Jan 2010 05:19:16 +0100 Subject: [wxruby-users] How do I add menu items from XRC source? In-Reply-To: <8b453e3d532bf723c7a67ffd15c628b3@ruby-forum.com> References: <15f9dc1ced953a2149e85c1231eae469@ruby-forum.com> <8b453e3d532bf723c7a67ffd15c628b3@ruby-forum.com> Message-ID: <02caaf103ea81aef7e525b21a136da13@ruby-forum.com> So, just adding some extra information for the next guy that comes after me that has a similar issue. Using the same format below: favorites_menu = menu_bar.get_menu(menu_bar.find_menu('Favorites')) favorites_menu.append(Wx::ID_ANY, "My Favorite") .. because I've set ID_ANY, I need to be able to catch and process that ID_ANY, which will automatically have an ID assigned by the application. You can do that by adding the following quick method: evt_menu(Wx::ID_ANY) do | event | puts @favorites_menu.label(event.id) end .. the only catch or pit fall that you need to avoid is where you place the event listener in an ordering process. If for example, you did the following: == WRONG WAY == evt_menu( @mb_fm_exit, :on_exit ) evt_menu(Wx::ID_ANY) do | event | puts @favorites_menu.label(event.id) end .. the :on_exit listener would not work because the ID_ANY listener overwrites the event based on order of operation. So, you need to place the ID_ANY listener at the top of all your listeners and then process other events below it. This includes both menu and toolbar events. == RIGHT WAY == evt_menu(Wx::ID_ANY) do | event | puts @favorites_menu.label(event.id) end evt_menu( @mb_fm_exit, :on_exit ) I hope this helps anyone else out down the road. Take care, -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jan 28 08:44:54 2010 From: lists at ruby-forum.com (=?utf-8?Q?Marvin_G=c3=bclker?=) Date: Thu, 28 Jan 2010 14:44:54 +0100 Subject: [wxruby-users] Compiling problem on Ubuntu 9.10 64 bit Message-ID: <51676e8059b9d963a30fb3a02c64f7e9@ruby-forum.com> Hello, I'm trying to compile wxruby for Ruby 1.9 on Ubuntu Karmic 64 bit, but I can't get it to work. I've already done this for the 32 bit version (on another machine, of course), so I don't see where's the problem with that. I thought, I had all neccessary libraries installed, but maybe you know better... After compiling for a long time, rake fails with this error: ----------------------------------- g++ -shared -fPIC -o -L. -rdynamic -Wl,-export-dynamic -shared obj/AboutDialogInfo.o obj/AcceleratorEntry.o obj/AcceleratorTable.o obj/ActivateEvent.o obj/Animation.o obj/AnimationCtrl.o obj/App.o obj/ArtProvider.o obj/AuiDefaultDockArt.o obj/AuiDockArt.o obj/AuiManager.o obj/AuiManagerEvent.o obj/AuiNotebook.o obj/AuiNotebookEvent.o obj/AuiPaneInfo.o obj/Bitmap.o obj/BitmapButton.o obj/BitmapComboBox.o obj/BitmapDataObject.o obj/BookCtrlBase.o obj/BookCtrlBaseEvent.o obj/BoxSizer.o obj/Brush.o obj/BusyInfo.o obj/Button.o obj/CalculateLayoutEvent.o obj/CalendarCtrl.o obj/CalendarDateAttr.o obj/CalendarEvent.o obj/Caret.o obj/CheckBox.o obj/CheckListBox.o obj/ChildFocusEvent.o obj/Choice.o obj/Choicebook.o obj/ChoicebookEvent.o obj/ClientDC.o obj/ClientDataContainer.o obj/Clipboard.o obj/ClipboardTextEvent.o obj/CloseEvent.o obj/CollapsiblePane.o obj/CollapsiblePaneEvent.o obj/Colour.o obj/ColourData.o obj/ColourDialog.o obj/ComboBox.o obj/CommandEvent.o obj/ContextHelpButton.o obj/ContextMenuEvent.o obj/Control.o obj/ControlWithItems.o obj/Cursor.o obj/DC.o obj/DataFormat.o obj/DataObject.o obj/DataObjectComposite.o obj/DataObjectSimple.o obj/DateEvent.o obj/DatePickerCtrl.o obj/Dialog.o obj/DirDialog.o obj/Display.o obj/DragImage.o obj/DropSource.o obj/DropTarget.o obj/EraseEvent.o obj/Event.o obj/EvtHandler.o obj/FileDataObject.o obj/FileDialog.o obj/FileDropTarget.o obj/FindDialogEvent.o obj/FindReplaceData.o obj/FindReplaceDialog.o obj/FlexGridSizer.o obj/FocusEvent.o obj/Font.o obj/FontData.o obj/FontDialog.o obj/Frame.o obj/GBPosition.o obj/GBSpan.o obj/GCDC.o obj/GDIObject.o obj/GLCanvas.o obj/Gauge.o obj/GenericDirCtrl.o obj/GraphicsBrush.o obj/GraphicsContext.o obj/GraphicsFont.o obj/GraphicsMatrix.o obj/GraphicsObject.o obj/GraphicsPath.o obj/GraphicsPen.o obj/Grid.o obj/GridBagSizer.o obj/GridCellAttr.o obj/GridCellBoolEditor.o obj/GridCellBoolRenderer.o obj/GridCellChoiceEditor.o obj/GridCellEditor.o obj/GridCellFloatEditor.o obj/GridCellFloatRenderer.o obj/GridCellNumberEditor.o obj/GridCellNumberRenderer.o obj/GridCellRenderer.o obj/GridCellStringRenderer.o obj/GridCellTextEditor.o obj/GridEditorCreatedEvent.o obj/GridEvent.o obj/GridRangeSelectEvent.o obj/GridSizeEvent.o obj/GridSizer.o obj/GridTableBase.o obj/HelpController.o obj/HelpEvent.o obj/HelpProvider.o obj/HtmlCell.o obj/HtmlCellEvent.o obj/HtmlContainerCell.o obj/HtmlEasyPrinting.o obj/HtmlHelpController.o obj/HtmlLinkEvent.o obj/HtmlLinkInfo.o obj/HtmlListBox.o obj/HtmlWidgetCell.o obj/HtmlWindow.o obj/HyperlinkCtrl.o obj/HyperlinkEvent.o obj/Icon.o obj/IconBundle.o obj/IconizeEvent.o obj/IdleEvent.o obj/Image.o obj/ImageList.o obj/KeyEvent.o obj/LayoutAlgorithm.o obj/ListBox.o obj/ListCtrl.o obj/ListEvent.o obj/ListItem.o obj/ListItemAttr.o obj/Listbook.o obj/ListbookEvent.o obj/Locale.o obj/Log.o obj/LogTextCtrl.o obj/MDIChildFrame.o obj/MDIParentFrame.o obj/Mask.o obj/MediaCtrl.o obj/MediaEvent.o obj/MemoryDC.o obj/Menu.o obj/MenuBar.o obj/MenuEvent.o obj/MenuItem.o obj/MessageDialog.o obj/MiniFrame.o obj/MouseEvent.o obj/MouseState.o obj/MoveEvent.o obj/MultiChoiceDialog.o obj/NavigationKeyEvent.o obj/Notebook.o obj/NotebookEvent.o obj/NotifyEvent.o obj/NumberEntryDialog.o obj/Object.o obj/PageSetupDialog.o obj/PageSetupDialogData.o obj/PaintDC.o obj/PaintEvent.o obj/Panel.o obj/PasswordEntryDialog.o obj/Pen.o obj/Point.o obj/PreviewCanvas.o obj/PreviewControlBar.o obj/PreviewFrame.o obj/PrintData.o obj/PrintDialog.o obj/PrintDialogData.o obj/PrintPreview.o obj/Printer.o obj/Printout.o obj/ProgressDialog.o obj/PropertySheetDialog.o obj/QueryLayoutInfoEvent.o obj/RadioBox.o obj/RadioButton.o obj/Rect.o obj/Region.o obj/RendererNative.o obj/RichTextAttr.o obj/RichTextBuffer.o obj/RichTextCharacterStyleDefinition.o obj/RichTextCtrl.o obj/RichTextEvent.o obj/RichTextFileHandler.o obj/RichTextFormattingDialog.o obj/RichTextHTMLHandler.o obj/RichTextHeaderFooterData.o obj/RichTextListStyleDefinition.o obj/RichTextParagraphStyleDefinition.o obj/RichTextPrinting.o obj/RichTextPrintout.o obj/RichTextStyleDefinition.o obj/RichTextStyleListBox.o obj/RichTextStyleListCtrl.o obj/RichTextStyleSheet.o obj/RichTextXMLHandler.o obj/SashEvent.o obj/SashLayoutWindow.o obj/SashWindow.o obj/ScreenDC.o obj/ScrollBar.o obj/ScrollEvent.o obj/ScrollWinEvent.o obj/ScrolledWindow.o obj/SearchCtrl.o obj/SetCursorEvent.o obj/ShowEvent.o obj/SingleChoiceDialog.o obj/Size.o obj/SizeEvent.o obj/Sizer.o obj/SizerItem.o obj/Slider.o obj/Sound.o obj/SpinButton.o obj/SpinCtrl.o obj/SpinEvent.o obj/SplashScreen.o obj/SplitterEvent.o obj/SplitterWindow.o obj/StandardPaths.o obj/StaticBitmap.o obj/StaticBox.o obj/StaticBoxSizer.o obj/StaticLine.o obj/StaticText.o obj/StatusBar.o obj/StdDialogButtonSizer.o obj/StyledTextCtrl.o obj/StyledTextEvent.o obj/SymbolPickerDialog.o obj/SystemSettings.o obj/TaskBarIcon.o obj/TextAttr.o obj/TextCtrl.o obj/TextDataObject.o obj/TextDropTarget.o obj/TextEntryDialog.o obj/TextUrlEvent.o obj/TextValidator.o obj/Timer.o obj/TimerEvent.o obj/TipProvider.o obj/TipWindow.o obj/ToggleButton.o obj/ToolBar.o obj/ToolBarToolBase.o obj/ToolTip.o obj/Toolbook.o obj/ToolbookEvent.o obj/TopLevelWindow.o obj/TreeCtrl.o obj/TreeEvent.o obj/Treebook.o obj/TreebookEvent.o obj/UpdateUIEvent.o obj/VListBox.o obj/VScrolledWindow.o obj/Validator.o obj/Window.o obj/WindowCreateEvent.o obj/WindowDC.o obj/WindowDestroyEvent.o obj/WindowDisabler.o obj/Wizard.o obj/WizardEvent.o obj/WizardPage.o obj/WizardPageSimple.o obj/XmlResource.o obj/RubyConstants.o obj/RubyStockObjects.o obj/Functions.o obj/Mac.o obj/wx.o -pthread -Wl,-Bsymbolic-functions -lwx_gtk2u_stc-2.8 -lwx_gtk2u_gl-2.8 -lwx_gtk2u_media-2.8 -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 -lpthread -lrt -ldl -lcrypt -lm -Wl,-Bdynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -o lib/wxruby2.so /usr/bin/ld: obj/AboutDialogInfo.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC obj/AboutDialogInfo.o: could not read symbols: Bad value collect2: ld returned 1 exit status rake aborted! Command failed with status (1): [g++ -shared -fPIC -o -L. -rdynamic -Wl,-...] (See full trace by running task with --trace) ----------------------------------- Anyone an idea? Or does somebody know where to obtain the wxruby-ruby19 gem for Ubuntu Karmic 64 bit? ruby -v: ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux] Marvin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 29 00:43:50 2010 From: lists at ruby-forum.com (John Baker) Date: Fri, 29 Jan 2010 06:43:50 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <4B5EE664.1050903@pressure.to> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <4B5DB92D.9050906@pressure.to> <4B5EE664.1050903@pressure.to> Message-ID: <261dea7750160ec9cd0881b19f9f817d@ruby-forum.com> Hey sorry I'm way late on this but thanks. I'm gonna check out this code. I'll report back when I do. -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Fri Jan 29 03:31:58 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Fri, 29 Jan 2010 15:31:58 +0700 Subject: [wxruby-users] How do I add menu items from XRC source? In-Reply-To: <02caaf103ea81aef7e525b21a136da13@ruby-forum.com> References: <15f9dc1ced953a2149e85c1231eae469@ruby-forum.com> <8b453e3d532bf723c7a67ffd15c628b3@ruby-forum.com> <02caaf103ea81aef7e525b21a136da13@ruby-forum.com> Message-ID: <26dadb3d1001290031o64e58cebx8691068b7cafac07@mail.gmail.com> Whoa, thanks I always read your post regarding on this matter since I encountered same problem back then and cannot find the solution On Thu, Jan 28, 2010 at 11:19 AM, Alpha Blue wrote: > So, just adding some extra information for the next guy that comes after > me that has a similar issue. > > Using the same format below: > > favorites_menu = menu_bar.get_menu(menu_bar.find_menu('Favorites')) > favorites_menu.append(Wx::ID_ANY, "My Favorite") > > .. because I've set ID_ANY, I need to be able to catch and process that > ID_ANY, which will automatically have an ID assigned by the application. > You can do that by adding the following quick method: > > evt_menu(Wx::ID_ANY) do | event | > puts @favorites_menu.label(event.id) > end > > .. the only catch or pit fall that you need to avoid is where you place > the event listener in an ordering process. If for example, you did the > following: > > == WRONG WAY == > > evt_menu( @mb_fm_exit, :on_exit ) > evt_menu(Wx::ID_ANY) do | event | > puts @favorites_menu.label(event.id) > end > > .. the :on_exit listener would not work because the ID_ANY listener > overwrites the event based on order of operation. So, you need to place > the ID_ANY listener at the top of all your listeners and then process > other events below it. This includes both menu and toolbar events. > > == RIGHT WAY == > > evt_menu(Wx::ID_ANY) do | event | > puts @favorites_menu.label(event.id) > end > evt_menu( @mb_fm_exit, :on_exit ) > > I hope this helps anyone else out down the road. > > Take care, > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabio.petrucci at gmail.com Fri Jan 29 05:19:30 2010 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 29 Jan 2010 11:19:30 +0100 Subject: [wxruby-users] How do I add menu items from XRC source? In-Reply-To: <26dadb3d1001290031o64e58cebx8691068b7cafac07@mail.gmail.com> References: <15f9dc1ced953a2149e85c1231eae469@ruby-forum.com> <8b453e3d532bf723c7a67ffd15c628b3@ruby-forum.com> <02caaf103ea81aef7e525b21a136da13@ruby-forum.com> <26dadb3d1001290031o64e58cebx8691068b7cafac07@mail.gmail.com> Message-ID: Too late but this is the way i do: You can design your menu directly into the xrc (i'm using wxformbuilder) and access the menu as follow (self is the frame): @menu_bar = self.get_menu_bar() @mnu_open = @menu_bar.find_menu_item('File', 'Open') @mnu_exit = @menu_bar.find_menu_item('File', 'Exit') to access submenu... mnu_invoice = @menu_bar.find_item(@menu_bar.find_menu_item('Options', 'Invoice')).get_sub_menu() @mnu_commerce = mnu_fattura.find_item('Commerce') @mnu_service = mnu_fattura.find_item('Service') and to connect the event... evt_menu(@mnu_exit) do | event | Wx::get_app.exit_main_loop() end evt_menu(@mnu_service) do | event | ... end hope this help. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Jan 29 06:51:43 2010 From: lists at ruby-forum.com (Carlo Bertini) Date: Fri, 29 Jan 2010 12:51:43 +0100 Subject: [wxruby-users] Compiling problem on Ubuntu 9.10 64 bit In-Reply-To: <51676e8059b9d963a30fb3a02c64f7e9@ruby-forum.com> References: <51676e8059b9d963a30fb3a02c64f7e9@ruby-forum.com> Message-ID: <12760e534b7152c4ff245f2e2b58cfd3@ruby-forum.com> from http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets Unpack the wxWidgets distribution, create a 'build' directory, then do: ../configure --disable-shared --with-gtk --enable-monolithic --enable-unicode --disable-debug --enable-catch_segvs --enable-graphics_ctx --enable-mediactrl --with-opengl --with-libjpeg=builtin --with-libpng=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --enable-gui --enable-xrc --enable-mdi --enable-gif --enable-pcx --enable-iff --enable-pnm --enable-xpm (Note that this command should be all one line; if you are on a 64-bit architecture, you may also need to add the following flags to the end: CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC) in my laptop (ubuntu 9.10 64bit ) work see also http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 29 07:07:58 2010 From: lists at ruby-forum.com (Carlo Bertini) Date: Fri, 29 Jan 2010 13:07:58 +0100 Subject: [wxruby-users] Compiling problem on Ubuntu 9.10 64 bit In-Reply-To: <12760e534b7152c4ff245f2e2b58cfd3@ruby-forum.com> References: <51676e8059b9d963a30fb3a02c64f7e9@ruby-forum.com> <12760e534b7152c4ff245f2e2b58cfd3@ruby-forum.com> Message-ID: <9797c10c9ad91c94e9367a8e340d9a46@ruby-forum.com> this is the gem : svn version: 2107 http://www.waydotnet.com/ruby/wxruby-ruby19-2.0.1.dev-x86_64-linux.gem without StyledTextCtrl Only problem when install without --no-rdoc Carlo Bertini -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 29 22:00:50 2010 From: lists at ruby-forum.com (John Baker) Date: Sat, 30 Jan 2010 04:00:50 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <4B5EE664.1050903@pressure.to> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <4B5DB92D.9050906@pressure.to> <4B5EE664.1050903@pressure.to> Message-ID: <400bcb4ee085f53baf9ec81cf11c691f@ruby-forum.com> Alex Fenton wrote: > On 26/01/2010 12:32, John Baker wrote: >> Hey Alex, yeah I checked it out, but the evt_key didn't seem to return >> any substantial data, or at least I wasn't able to get at it if it did. >> I printed out every single attribute and I never got a character code or >> anything. aww man I got so excited for this to work but then it doesn't recognize the backspace key! Not sure if there is another solution but that is pretty useless otherwise. I hope that is not the case -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 29 22:03:44 2010 From: lists at ruby-forum.com (John Baker) Date: Sat, 30 Jan 2010 04:03:44 +0100 Subject: [wxruby-users] Where can I find a list of events for each widget? In-Reply-To: <400bcb4ee085f53baf9ec81cf11c691f@ruby-forum.com> References: <22c9a0a9706c257281715ce2ce434821@ruby-forum.com> <4b71efbfcdda96e842d94e7efa1b6240@ruby-forum.com> <4B5DB92D.9050906@pressure.to> <4B5EE664.1050903@pressure.to> <400bcb4ee085f53baf9ec81cf11c691f@ruby-forum.com> Message-ID: <3da750189db68218a23cc3106b0e7254@ruby-forum.com> Nevermind, I found evt_key_down which actually does work using your code. Awesome. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 31 18:05:52 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Mon, 1 Feb 2010 00:05:52 +0100 Subject: [wxruby-users] Strange Issue with Wx_Sugar and xml.load Message-ID: <91086babda054e956de214ebb427cc91@ruby-forum.com> Hi everyone, I'm having a strange issue and I'm trying to wrap my head around it and unfortunately, I'm not having much luck. Let me simplify my directory structure and show you what's happening: \lib -- app.rb -- main.rb -- xrc_source.rb -- xrc_source.xrc ---------------------------------------------- app.rb just contains some standard requires: $:.unshift File.dirname(__FILE__) require 'wx' require 'pp' require "xrc_source" require "main" Wx::App.run do GuiMain.new.show end ---------------------------------------------- When the xrc_source.rb is required, inside of xrc_source.rb is the following line: xml.load('xrc_source') .. which is automatically generated by running the xrcise command: xrcise -o xrc_source.rb xrc_source.xrc So Sugar is creating the load line. Now, so far so good. When I try to run my app out of the lib directory using ruby app.rb it launches and the gui is working just fine. If I try to package this using ocra and type ocra app.rb it automatically creates an app.exe executable file. If I double-click the exe file, it launches and everything is good. Again, so far so good. Now, if I move this new executable file anywhere else, and launch it, I receive the following error: Cannot load resources from file 'xrc_source.xrc'. ======== So, does this mean that if I use wx_sugar, I won't be able to create a stand-a-lone GUI app with ocra? Notice, I'm not receiving any errors concerning any other loads or requires from my other files. The only error is occurring from the xml.load method inside of the file that was created via xrcise. I'm sure there must be a way around this. Please advise. Thanks. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jan 31 18:22:28 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Mon, 1 Feb 2010 00:22:28 +0100 Subject: [wxruby-users] Strange Issue with Wx_Sugar and xml.load In-Reply-To: <91086babda054e956de214ebb427cc91@ruby-forum.com> References: <91086babda054e956de214ebb427cc91@ruby-forum.com> Message-ID: Just for clarification: xml.load('xrc_source') is actually xml.load('xrc_source.xrc') I believe the problem is probably more related to something ocra is doing during compile so I added a bug report to the ocra home project page. If anyone else is using ocra with wxruby, and you are able to move the exe to another part of your system and launch it, please let me know what I'm doing wrong in terms of the xrc source load from sugar.. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sun Jan 31 20:04:36 2010 From: mario at ruby-im.net (Mario Steele) Date: Sun, 31 Jan 2010 20:04:36 -0500 Subject: [wxruby-users] Strange Issue with Wx_Sugar and xml.load In-Reply-To: References: <91086babda054e956de214ebb427cc91@ruby-forum.com> Message-ID: After reading Ocra's website, it looks as though, if you want the xrc_source.xrc to be included, you need to add it to the ocra command line execution, EG: ocra app.rb xrc_source.xrc This will add xrc_source.xrc to the executable, and when it extracts it, it'll be placed into the same directory as your app.rb, so it should work then. hth, Mario On Sun, Jan 31, 2010 at 6:22 PM, Alpha Blue wrote: > Just for clarification: > > xml.load('xrc_source') > > is actually xml.load('xrc_source.xrc') > > I believe the problem is probably more related to something ocra is > doing during compile so I added a bug report to the ocra home project > page. If anyone else is using ocra with wxruby, and you are able to > move the exe to another part of your system and launch it, please let me > know what I'm doing wrong in terms of the xrc source load from sugar.. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Jan 31 21:00:55 2010 From: lists at ruby-forum.com (Alpha Blue) Date: Mon, 1 Feb 2010 03:00:55 +0100 Subject: [wxruby-users] Strange Issue with Wx_Sugar and xml.load In-Reply-To: References: <91086babda054e956de214ebb427cc91@ruby-forum.com> Message-ID: <62dbb94cdedf82b0417679e4845d0519@ruby-forum.com> Mario Steele wrote: > After reading Ocra's website, it looks as though, if you want the > xrc_source.xrc to be included, you need to add it to the ocra command > line > execution, EG: > > ocra app.rb xrc_source.xrc > > This will add xrc_source.xrc to the executable, and when it extracts it, > it'll be placed into the same directory as your app.rb, so it should > work > then. > > hth, > > Mario Hey Mario, I'm not sure how I missed that. I tried what you said and with the packager what happens is when I open the file on another part of the system, I receive the same error. However, instead of closing the app and allowing it to fully close, I go to the temp directory within appdata and I personally checked out everything. There's a src folder that shows that it is indeed pulling the xrc source and placing it in the same directory. So, perhaps it has something to do with how it's being required in the xml.load? Should I be placing some other relative path? Again, a very strange thing as all of the files are there but it refuses to load the xrc source. The error usually happens when the path is not correct. But, I'm not sure why that is.. -- Posted via http://www.ruby-forum.com/.