From mathias.bruce at gmail.com Sun Aug 2 23:04:48 2009 From: mathias.bruce at gmail.com (Mathias Bruce) Date: Mon, 3 Aug 2009 05:04:48 +0200 Subject: [wxruby-users] Drag & drop problems with ListCtrl Message-ID: <674e40dd0908022004h2654facck82aa06e07eadc5e9@mail.gmail.com> Hi! I'm having some trouble using a ListCtrl as a drag & drop source. I select a row and then try to drag it, but nothing happens. The evt_list_begin_drag doesn't seem to trigger. I've found no good examples of it anywhere, except an old sample that seems to have been a part of wxruby 0.6.0 that I found here: http://www.koders.com/ruby/fid431E286522E3E0DEE10CFA48B571A48A0B1BE9EE.aspx?s=kevin+smith+dragdrop#L1 I know it's old, but after (briefly) comparing it to the current documentation I can't see why the code shouldn't work... Or at least trigger the evt_list_begin_drag. I hope I am mistaken, and that someone can point out some easy fix... I need to drag rows in a ListCtrl and either drop on the same ListCtrl or a TreeCtrl, but as the evt_list_begin_drag doesn't seem to trigger, I'm sort of stuck. Neither the drag & drop samples that ship with the wxruby gem nor any mailing list discussion I've found seem to cover what I'm after. I've run the code basically unmodified (just changing the requires to 'rubygems' and 'wx' instead of 'wxruby', and removing ':' characters on the case-when so it works in Ruby 1.9) on OS X 10.5.7 both with ruby 1.8.6 (p287) and the wxruby 1.9.9 gem, and with ruby 1.9.1 (p129) and the wxruby-ruby19 2.0.0 gem, and neither work. The latter is my preferred target. Any help getting this to work would be *greatly* appreciated! A code sample that works (atleast on someone elses machine) with a ListCtrl as a drag & drop source and target would be superb, so I could try the same sample, and if it doesn't work try to figure out why. I've pasted the sample I tried at the end of the mail, modified as noted above for convenience if anyone has the time to try it out. Best regards and thanks in advance, Mathias Code sample follows: # dragdrop.rb sample by Kevin Smith #require 'wxruby' require 'rubygems' require 'wx' class DragListBox < Wx::ListCtrl def initialize(parent) super(parent, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::LC_REPORT | Wx::LC_SINGLE_SEL) insert_column(0, 'Fruits') evt_list_begin_drag(get_id) do | e | on_drag(e) end end def append(text) row = get_item_count insert_item(row, text) set_item_text(row, text) end def get_selected_row return get_next_item(-1, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED) end def on_drag(event) selected_row = get_selected_row if(selected_row < 0) puts("nothing to drag") return end data = Wx::TextDataObject.new(get_item_text(selected_row)) dragSource = Wx::DropSource.new(self); dragSource.set_data(data); result = dragSource.do_drag_drop(Wx::DRAG_ALLOW_MOVE) case result when Wx::DRAG_NONE puts("Drop was rejected") when Wx::DRAG_CANCEL puts("Drag canceled by user") when Wx::DRAG_COPY puts("Copied") when Wx::DRAG_MOVE puts("Moved") delete_item(selected_row) else puts("ERROR or Unknown result!") end end end class MyDropTarget < Wx::TextDropTarget def initialize(owner) super() @owner = owner @owner.set_drop_target(self) end def on_drop_text(x, y, text) puts("Accepting drop of #{text} at #{x}, #{y}") @owner.handle_drop(text) return true end end class DropListBox < Wx::ListBox def initialize(parent) super(parent, -1) target = MyDropTarget.new(self) end def handle_drop(text) append(text) end end class MyFrame < Wx::Frame def initialize(title) super(nil, -1, title) list1 = DragListBox.new(self) list1.append('Apple') list1.append('Banana') list1.append('Cranberry') list2 = DropListBox.new(self) lists = Wx::BoxSizer.new(Wx::HORIZONTAL) lists.add(list1, 1, Wx::EXPAND) lists.add(list2, 1, Wx::EXPAND) instructions = Wx::StaticText.new(self, -1, "You can drag items from the left list to the right\n" + "(or to any window in your system that accepts text drops.\n" + "If you hold down shift while releasing, the item \n" + "will be MOVED instead of COPIED\n") main_sizer = Wx::BoxSizer.new(Wx::VERTICAL) main_sizer.add(instructions, 0, Wx::EXPAND) main_sizer.add(lists, 1, Wx::EXPAND) set_sizer(main_sizer) end end class DragDropApp < Wx::App def on_init frame = MyFrame.new("wxRuby Drag and Drop App") frame.show end end a = DragDropApp.new a.main_loop() From lists at ruby-forum.com Mon Aug 3 06:07:07 2009 From: lists at ruby-forum.com (Guillaume Bestguigui) Date: Mon, 3 Aug 2009 12:07:07 +0200 Subject: [wxruby-users] Background running application Message-ID: <30e2193000d819db6ec73ad7371ea55a@ruby-forum.com> Hello everyone, I need to create a WxRuby application that still runs when the frame is inactive. The application must display a message when something happens, even if the application is not focused. How could I do that ? Thanks a lot -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Aug 3 06:59:59 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 03 Aug 2009 11:59:59 +0100 Subject: [wxruby-users] Background running application In-Reply-To: <30e2193000d819db6ec73ad7371ea55a@ruby-forum.com> References: <30e2193000d819db6ec73ad7371ea55a@ruby-forum.com> Message-ID: <4A76C32F.8090207@pressure.to> Guillaume Bestguigui wrote: > I need to create a WxRuby application that still runs when the frame is > inactive. The application must display a message when something happens, > even if the application is not focused. How could I do that ? The most conventional way would probably be to call Wx::App#is_active (or Wx::App#active?) to see if the application is in the foreground. If it isn't, call Wx::TopLevelWindow#request_user_attention when you want the user to switch to a given frame. This will use the platform's correct way of signalling that an update has happened in the app - eg, on Windows, I think it will make the application's icon/title in the taskbar flash. Note that you can also detect when an app becomes active/inactive using the event handlers provided by ActivateEvent. See the sample etc/activation.rb for an example of this. http://wxruby.rubyforge.org/doc/app.html#App_isactive http://wxruby.rubyforge.org/doc/toplevelwindow.html#TopLevelWindow_requestuserattention http://wxruby.rubyforge.org/doc/activateevent.html As an alternative, you could use Wx::TaskBarIcon to have an icon for the app in the area near the clock (on Windows). You could change the icon's appearance when information is available. a From alex at pressure.to Wed Aug 5 07:57:24 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Aug 2009 12:57:24 +0100 Subject: [wxruby-users] mingw32 library compatibility In-Reply-To: References: Message-ID: <4A7973A4.3010006@pressure.to> Hi Fabio Fabio Petrucci wrote: > is the mingw32 wxruby distribution > http://rubyforge.org/frs/download.php/52487/wxruby-ruby19-2.0.0-x86-mingw32.gem > compatible with > mingw32 ruby 1.9.1 installer provided by Luis Lavena > http://rubyinstaller.org/downloads/ ? I think it is - I believe that's the MingW-ruby19 distribution that's used to build wxruby-2.0.0 for that platform. It's certainly the one I use. alex From alex at pressure.to Thu Aug 6 06:21:26 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Aug 2009 11:21:26 +0100 Subject: [wxruby-users] wxruby and threads problem In-Reply-To: <1ffc56810908060225h7b6c04e4gf0c6910c1bc254d9@mail.gmail.com> References: <1ffc56810908050225i3048a004yb2434c5482f7f632@mail.gmail.com> <1ffc56810908060225h7b6c04e4gf0c6910c1bc254d9@mail.gmail.com> Message-ID: <4A7AAEA6.7020203@pressure.to> bao bao wrote: > thanks for your quickly reply, but i got the following error: > /am.rb:26:in `on_init': undefined method `every' for Wx::Timer:Class > (NoMethodError) > from am.rb:43:in `initialize' > from am.rb:43:in `new' > from am.rb:43/ > My wxruby version is ***0.6.0. > * This is a VERY old and buggy version of wxruby. You should definitely use the latest version 2.0.0 - you can find that here: http://rubyforge.org/frs/?group_id=35&release_id=31815 Can I ask where you found a link to that old version? thanks alex From lists at ruby-forum.com Thu Aug 6 20:29:27 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Fri, 7 Aug 2009 02:29:27 +0200 Subject: [wxruby-users] Any plan for wxRuby 2.0.1 release? Message-ID: Hi, The current v2.0 for Ruby 1.9 does not work Ruby 1.9.1 p129 (mingw32 installer perview1). Thanks, Zhimin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Aug 10 15:16:47 2009 From: lists at ruby-forum.com (Chris Stuff) Date: Mon, 10 Aug 2009 21:16:47 +0200 Subject: [wxruby-users] xrcise -o test.rb ui.xrc Message-ID: <9fb2e464a2c71c674ef474d736275292@ruby-forum.com> I built a small form in wxFormBuilder. In cmd i wrote xrcise -o test.rb ui.xrc output was C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:4 6:in `clean_id_attr_readers': undefined method `each' for # (No MethodError) from (erb):16:in `output' from C:/ruby/lib/ruby/1.9.1/erb.rb:753:in `eval' from C:/ruby/lib/ruby/1.9.1/erb.rb:753:in `result' from C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/o utputter.rb:19:in `output' from C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:126:in `block (2 levels) in ' from C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:125:in `each' from C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:125:in `block in ' from C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:124:in `open' from C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:124:in `' from C:/ruby/bin/xrcise:19:in `load' from C:/ruby/bin/xrcise:19:in `
' File : ui.xrc 500,300 Test 2 2 0 0 wxEXPAND | wxALL 5 wxVERTICAL wxALL 5 0 wxALL 5 0 wxALL 5 0 wxALL 5 0 wxEXPAND | wxALL 5 2 2 0 0 wxALL 5 Can someone explain what's wrong? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Aug 13 06:31:59 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 13 Aug 2009 11:31:59 +0100 Subject: [wxruby-users] perhaps OOT, Time.parse error In-Reply-To: <26dadb3d0908130154w3a0bca77t76425f6e7fdf33d2@mail.gmail.com> References: <26dadb3d0908130154w3a0bca77t76425f6e7fdf33d2@mail.gmail.com> Message-ID: <4A83EB9F.1080900@pressure.to> hendra kusuma wrote: > I found error when I parse a string to date using Time.parse > I use 3 textctrl to get date, month and year > then I combine them into a string with format yyyy-mm-dd (because I am > going to save the date to mysql) > > then I parse it to date to check if the date valid with > begin > bday = Time.parse('yyyy-mm-dd') > rescue > puts "error" > end > > somehow, it works ok if the year > 1971 > but it give me error message starting from 1970 and less > > error message show something about time.rb:184:in 'local': argument > out of range Ruby's Time class only supports dates after 1970 (the start of the "epoch"), at least, it's only guaranteed to support dates after then portably. Use the standard 'datetime' class to support a wider range of dates. I believe this is changed in the current preview ruby 1.9.2 alex From lists at ruby-forum.com Fri Aug 14 05:38:04 2009 From: lists at ruby-forum.com (Ross Goodell) Date: Fri, 14 Aug 2009 11:38:04 +0200 Subject: [wxruby-users] TextCtrl performance for large files Message-ID: <482515f866d5b43347d077cf73e82329@ruby-forum.com> I've been trying to speed up my program, which uses a TextCtrl, for large files by getting rid of code using line numbers. However, it seems that just using the get_range method is slowing down my program for large files. I don't know whether I'm doing something wrong or there's a way to access the text without significant slowing in large files. If anyone can help, I'd very much appreciate it. Thanks, Ross Goodell -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Aug 14 09:48:23 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Aug 2009 14:48:23 +0100 Subject: [wxruby-users] TextCtrl performance for large files In-Reply-To: <482515f866d5b43347d077cf73e82329@ruby-forum.com> References: <482515f866d5b43347d077cf73e82329@ruby-forum.com> Message-ID: <4A856B27.4090807@pressure.to> Hi Ross Goodell wrote: > I've been trying to speed up my program, which uses a TextCtrl, for > large files by getting rid of code using line numbers. However, it > seems that just using the get_range method is slowing down my program > for large files. I don't know whether I'm doing something wrong or > there's a way to access the text without significant slowing in large > files. What ruby version and platform are you working on? You might be able to optimise by pulling out larger sections of text at one go and working on them in Ruby. There's an inherent overhead with each call to the Wx API: where it cross the Ruby / C++ boundary new strings have to be created and converted. Also you could try using Wx::StyledTextCtrl which is a code-oriented editor. Its API should be a drop-in replacement for TextCtrl, and it may be better optimised for the kind of task you're using it for. a From alex at pressure.to Fri Aug 14 09:49:53 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Aug 2009 14:49:53 +0100 Subject: [wxruby-users] Any plan for wxRuby 2.0.1 release? In-Reply-To: References: Message-ID: <4A856B81.2060902@pressure.to> Hi Zhimin Zhimin Zhan wrote: > The current v2.0 for Ruby 1.9 does not work Ruby 1.9.1 p129 (mingw32 > installer perview1). Yes, we're hoping to release one in the next few weeks. Chauk-Mean has been doing some good work with the lastest 1.9.1 patch level and we'll be releasing against that. cheers alex From alex at pressure.to Fri Aug 14 09:55:46 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Aug 2009 14:55:46 +0100 Subject: [wxruby-users] xrcise -o test.rb ui.xrc In-Reply-To: <9fb2e464a2c71c674ef474d736275292@ruby-forum.com> References: <9fb2e464a2c71c674ef474d736275292@ruby-forum.com> Message-ID: <4A856CE2.1030207@pressure.to> Chris Stuff wrote: > I built a small form in wxFormBuilder. In cmd i wrote > > xrcise -o test.rb ui.xrc > > output was > > C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:4 > 6:in `clean_id_attr_readers': undefined method `each' for > # (No > MethodError) Thanks for the report. I thought I'd fixed xrcise to work with ruby 1.9, but it seems not. I'll look to update wx_sugar for 1.9 shortly. In the meantime, as hendra says, you can just use ruby 1.8 to run xrcise. The code generated is no different for Ruby 1.8 and Ruby 1.9. alex From lists at ruby-forum.com Mon Aug 17 18:08:02 2009 From: lists at ruby-forum.com (Pito Salas) Date: Tue, 18 Aug 2009 00:08:02 +0200 Subject: [wxruby-users] wxRuby install problem Message-ID: <6a1c584af0d21778430d896f57e49933@ruby-forum.com> I was in a weird state. This post is long just because I give point by point evidence to help you quickly spot where my brain drove off the rails. The problem is that I have wxRuby installed (apparently) but ruby doesn't find it when running one of the wxRuby samples, and also 'gem which' doesn't seem to know what directory it's in. I think, despite trying to reset everything, there's some left over state somewhere that's mucking up the works. Any help would be appreciated... Here we go. Here's the base state: ~$ sudo gem install wxruby Bulk updating Gem source index for: http://gems.rubyforge.org/ Bulk updating Gem source index for: http://gems.github.com/ Successfully installed wxruby-1.9.3-universal-darwin 1 gem installed ~$ gem which wxruby Can't find wxruby ~$ gem which wxruby-1.9.3-universal-darwin Can't find wxruby-1.9.3-universal-darwin and trying to run one of the samples gives me: LoadError: no such file to load ? wx Ater messing around in a bunch of ways (resetting cache, uninstall and reinstall the gem, and so on.) I decided to go back to a blank slate... I did a complete update of Ruby on my Mac OS X 10.5.8: ~$ sudo port selfupdate MacPorts base version 1.710 installed Downloaded MacPorts base version 1.710 The MacPorts installation is not outdated so it was not updated ~$ sudo port upgrade ruby ......... lots of stuff....but no errors ---> Cleaning ruby And a reinstall of rubygems: ~$ sudo port install rb-rubygems Password: ---> Staging rb-rubygems into destroot ---> Installing rb-rubygems @1.3.4_0 ---> Activating rb-rubygems @1.3.4_0 ---> Cleaning rb-rubygems *** FIRST weird thing, even though stuff was reinstalled, there are already gems there including wxRuby ~$ gem list *** LOCAL GEMS *** actionmailer (2.0.2) ...... wxruby (1.9.3) BUT when I check 'which' I get an odd error. When I reinstall wxruby again, it looks like it does something, but 'gem which' still fails, as does running the app. ~$ gem which wxruby Can't find ruby library file or shared library wxruby ~$ sudo gem install wxruby Successfully installed wxruby-2.0.0-universal-darwin-9 1 gem installed Installing ri documentation for wxruby-2.0.0-universal-darwin-9... Installing RDoc documentation for wxruby-2.0.0-universal-darwin-9... ~$ gem which wxruby Can't find ruby library file or shared library wxruby Note that my ruby and rubygems are installed, by 'port' in it's usual place: ~$ which ruby /opt/local/bin/ruby ~$ which gem /opt/local/bin/gem I am stumped. There's some state left over but I thought I'd wasted too much time and I'd ask for help... Help? Any tips, I may be missing something obvious... THANKS! -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Tue Aug 18 13:20:53 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Tue, 18 Aug 2009 19:20:53 +0200 Subject: [wxruby-users] mingw32 library compatibility In-Reply-To: References: <4A7973A4.3010006@pressure.to> Message-ID: Hi, 2009/8/5 Fabio Petrucci : > Hi Alex, > > i've got the ruby installer from > http://rubyinstaller.org/downloads/rubyinstaller-1.9.1-p129-preview1.exe and > wxruby 2.0 from > http://rubyforge.org/frs/download.php/52487/wxruby-ruby19-2.0.0-x86-mingw32.gem > > but if i try to launch a sample application from the wxruby distribution i > get this error: > The wxruby-ruby19-2.0.0-x86-mingw32.gem has been built with ruby-1.9.1-p0. This version is binary incompatible with recent versions of ruby-1.9.1 (p129, p243) and ruby-1.9.2-preview1. The upcoming wxruby-2.0.1 release will fix this issue. Cheers. Chauk-Mean. From lists at ruby-forum.com Thu Aug 20 16:12:47 2009 From: lists at ruby-forum.com (Pito Salas) Date: Thu, 20 Aug 2009 22:12:47 +0200 Subject: [wxruby-users] Debugging sizer usage and gui layout Message-ID: In other gui packages I have seen special 'debug modes' on panels or frames which highlighted the specific placement and size of each window and subwindow (as determined by sizers) to help you visualize why things aren't working as expected. Is there such a thing in wxRuby (or Wx in general?) Pito Salas -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Aug 24 19:17:36 2009 From: lists at ruby-forum.com (Philip Stephens) Date: Tue, 25 Aug 2009 01:17:36 +0200 Subject: [wxruby-users] paste event Message-ID: Here's my code for: evt_menu(@m_menu_paste) { pastetext } using wxruby2.0 def pastetext # this function is used to paste text from the clipboard and # does a simple test to see if the pasted text is a number # or a valid arithmetic expression # if not then restore the previous contents of the textctrl # (the calculator's window) to its original state @m_textctrl.set_editable(true) start_value = @m_textctrl.get_value() @m_textctrl.paste end_value = @m_textctrl.get_value() puts "start value:::" + start_value puts "end value:::::" + end_value @m_textctrl.set_editable(false) end When I run my calculator program I get the following output ClipBoard Data: 123456 Calculator's textctrl: 0123456 # I'm not worried about the zero Shell Output: start value:::0 end value:::::0 # I was hoping this would be 0123456 I was hoping that I could manipulate the end_value but the paste event does not fire until after the routine is finished. I tried process_event but could not manage to get the right syntax. Any help would be appreciated. Thanks, Philip -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Aug 24 19:48:11 2009 From: lists at ruby-forum.com (Philip Stephens) Date: Tue, 25 Aug 2009 01:48:11 +0200 Subject: [wxruby-users] xrcise -o test.rb ui.xrc In-Reply-To: <9fb2e464a2c71c674ef474d736275292@ruby-forum.com> References: <9fb2e464a2c71c674ef474d736275292@ruby-forum.com> Message-ID: <88d7fdc7ed64f11d75c409985e4142f8@ruby-forum.com> Chris Stuff wrote: > I built a small form in wxFormBuilder. In cmd i wrote > > xrcise -o test.rb ui.xrc > > output was > > C:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:4 .... > > Can someone explain what's wrong? When I borrowed your xrc file here's what I got using linux: File:test.rb # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: UI.xrc # Generated at: Mon Aug 24 17:30:14 -0600 2009 class XrcFrameMain < Wx::Frame attr_reader :m_panel1, :m_textctrl1, :m_textctrl2, :m_button8, :m_button7, :m_panel2, :m_calendar1, :m_menubar1, :m_menu1, :m_menu11 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("UI.xrc") xml.load_frame_subclass(self, parent, "frmMain") finder = lambda do | x | int_id = Wx::xrcid(x) begin Wx::Window.find_window_by_id(int_id, self) || int_id # Temporary hack to work around regression in 1.9.2; remove # begin/rescue clause in later versions rescue RuntimeError int_id end end @m_panel1 = finder.call("m_panel1") @m_textctrl1 = finder.call("m_textCtrl1") @m_textctrl2 = finder.call("m_textCtrl2") @m_button8 = finder.call("m_button8") @m_button7 = finder.call("m_button7") @m_panel2 = finder.call("m_panel2") @m_calendar1 = finder.call("m_calendar1") @m_menubar1 = finder.call("m_menubar1") @m_menu1 = finder.call("m_menu1") @m_menu11 = finder.call("m_menu11") if self.class.method_defined? "on_init" self.on_init() end end end File: test2.rb begin require 'rubygems' rescue LoadError end require 'wx' require 'test.rb' # Inherit from the generated base class and set up event handlers class AppFrame < XrcFrameMain def initialize super() end end # Wx::App is the container class for any wxruby app. To start an # application, either define a subclass of Wx::App, create an instance, # and call its main_loop method, OR, simply call the Wx::App.run class # method, as shown here. Wx::App.run do AppFrame.new.show end The second file I created manually and it works. At least it's a start. Philip -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Aug 25 03:19:27 2009 From: lists at ruby-forum.com (Philip Stephens) Date: Tue, 25 Aug 2009 09:19:27 +0200 Subject: [wxruby-users] paste event In-Reply-To: References: Message-ID: <28a30ea922647420fcc12a2f0ed76923@ruby-forum.com> Never mind, I found Wx::Clipboard which alowed me to do what I wanted to do which was validate text on a clip board before placing it in the calculator's textctrl. -Philip -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Aug 27 04:08:44 2009 From: lists at ruby-forum.com (Julien Letroll) Date: Thu, 27 Aug 2009 10:08:44 +0200 Subject: [wxruby-users] libwx_gtk2u_media not found Message-ID: <85a7311abf1cee4ab41dfaddb39ebb3a@ruby-forum.com> bonjour, Je viens d'installer le dernier netbeans, et en passant par sont gestionnaire de gem, d'installer wxruby. Probl?me j'essai de l'utiliser avec le simple hello world fournis sur le site et netbeans me retourne : /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wxruby2.so: libwx_gtk2u_media-2.8.so.0: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wxruby2.so (LoadError) Je pr?cise je travail sous archlinux(linux), et ai recherch? apr?s un quelconque fichier libwx_gtk2u_media mais je n'ai rien trouv? :-s Une id?e de comment je pourrais r?gler cela? Hello, sorry for my english, it's not my first language :-o I have just install the last netbeans, and gem wxruby with him but when I want test a basic "hello world", I got this message : /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wxruby2.so: libwx_gtk2u_media-2.8.so.0: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wxruby2.so (LoadError) I work under archlinux(linux) and the file is not on my computer :-s Anyone have an idea or solutions? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Aug 27 17:51:58 2009 From: lists at ruby-forum.com (Dmitry a. Ustalov) Date: Thu, 27 Aug 2009 23:51:58 +0200 Subject: [wxruby-users] build troubles on fedora 11 Message-ID: <5ae928c46e72b73a231da35160984de4@ruby-forum.com> Because of "official" wxruby gem won't work on Fedora 11 distro eveel at notazik{/usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/samples /minimal}% ./minimal.rb /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wxruby2.so: /usr/lib /ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wxruby2.so: symbol _ZN13wxAuiNotebook16AdvanceSelectionEb, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference - /usr/lib/ruby/gems/1.8/gems /wxruby-2.0.0-x86-linux/lib/wxruby2.so (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from ./minimal.rb:8 I've decided to build wxruby by myself, but all my positive wishes are absolutely failed because of some issues. eveel{~/wxruby}% rake (in /home/eveel/wxruby) Enabling DYNAMIC build Enabling RELEASE build Enabling UNICODE build The following wxWidgets features are not available and will be skipped: PrinterDC g++ -c -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -DwxABI_VERSION=208010 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind- tables -fno-strict-aliasing -fPIC -Wno-unused-function -I. -I /usr/lib/ruby/1.8/i386-linux -o obj/AboutDialogInfo.o src/AboutDialogInfo.cpp { some g++ invocations } swig -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -DwxABI_VERSION=208010 -Iswig/custom -w401 -w801 -w515 -c++ -ruby -o src/AnimationCtrl.cpp swig/classes /AnimationCtrl.i ruby swig/renamer.rb src/AnimationCtrl.cpp ruby swig/fixplatform.rb src/AnimationCtrl.cpp ruby swig/fixmodule.rb src/AnimationCtrl.cpp Class: AnimationCtrl : Control ERROR! swig/fixmodule.rb Didn't find swig class rake aborted! Command failed with status (1): [ruby swig/fixmodule.rb src/AnimationCtrl.c...] (See full trace by running task with --trace) What's wrong? gcc: 4.4.1 ruby: 1.8.6 (p369) swig: 1.3.39 wx: 2.8.10 wxruby: trunk (last updated before this post were written) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Aug 27 20:04:15 2009 From: lists at ruby-forum.com (Haoqi Haoqi) Date: Fri, 28 Aug 2009 02:04:15 +0200 Subject: [wxruby-users] error in grid In-Reply-To: <492A9EFF.8000104@pressure.to> References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> <49183C6E.3030108@pressure.to> <491C3404.6090204@pressure.to> <492A9EFF.8000104@pressure.to> Message-ID: <9eb3bdb2df8e96e53682f66831427f0c@ruby-forum.com> libwx_gtk2u_gl-2.8.so.0: cannot open shared object file: No such file or directory =======fix the bug,just do========= sudo aptitude install libwxgtk2.8-dev ============In ubuntu============== -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Aug 27 23:08:06 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 28 Aug 2009 04:08:06 +0100 Subject: [wxruby-users] build troubles on fedora 11 In-Reply-To: <5ae928c46e72b73a231da35160984de4@ruby-forum.com> References: <5ae928c46e72b73a231da35160984de4@ruby-forum.com> Message-ID: <4A974A16.6040208@pressure.to> Dmitry a. Ustalov wrote: > I've decided to build wxruby by myself, but all my positive wishes are > absolutely failed because of some issues > .... > Class: AnimationCtrl > : Control > ERROR! swig/fixmodule.rb Didn't find swig class > rake aborted! > Command failed with status (1): [ruby swig/fixmodule.rb > src/AnimationCtrl.c] > > (See full trace by running task with --trace) > > What's wrong? > > gcc: 4.4.1 > ruby: 1.8.6 (p369) > swig: 1.3.39 > wx: 2.8.10 > wxruby: trunk (last updated before this post were written) > Your SWIG is too new. Since we released 1.0.1, SWIG released a new version that broke some features of the generated code we rely on. Please try downgrading to 1.3.38. alex From lists at ruby-forum.com Thu Aug 27 23:32:34 2009 From: lists at ruby-forum.com (Larry Rogers) Date: Fri, 28 Aug 2009 05:32:34 +0200 Subject: [wxruby-users] TreeCtrl Scrolling Message-ID: <5f3b93b988b8ef1660ac00fb8497904e@ruby-forum.com> I have been playing around with the wxRuby TreeCtrl for a couple of weeks now and I can't figure out how to get the scrolling to work. I believe it has scrolling built in but I can't get the to show up. I can place the TreeCtrl in a ScrolledWindow and scroll around over the tree but that breaks TreeItem visibility checks because the TreeCtrl doesn't know about it's parent. When using the TreeCtrl in the Scrolled window the scroll bars work properly when I set the ScrolledWindow virtual size to the treectrl client size. But I don't find any equivalent functionality in the treectrl itself. I've tried using it's super (window) virtual size but that doesn't seem to work either. The treectrl has some interesting methods like scrollto that make me believe it implements scrolling but I'm at a loss to make it work. Larry -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Aug 28 00:11:18 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 28 Aug 2009 05:11:18 +0100 Subject: [wxruby-users] TreeCtrl Scrolling In-Reply-To: <5f3b93b988b8ef1660ac00fb8497904e@ruby-forum.com> References: <5f3b93b988b8ef1660ac00fb8497904e@ruby-forum.com> Message-ID: <4A9758E6.3030400@pressure.to> Larry Rogers wrote: > I have been playing around with the wxRuby TreeCtrl for a couple of > weeks now and I can't figure out how to get the scrolling to work. I > believe it has scrolling built in but I can't get the to show up. I can > place the TreeCtrl in a ScrolledWindow and scroll around over the tree > but that breaks TreeItem visibility checks because the TreeCtrl doesn't > know about it's parent. That sounds strange. With TreeCtrl the scroll bars should appear when they're needed, and not when they're not. It's all handled by the widget itself - you definitely shouldn't need to use another control like ScrolledWindow - just use Sizers (as in general) to manage the size of your widgets. If this doesn't help, could you post a minimal, runnable sample that reproduces the problem, and also a bit more info about your platform and version. a From alex at pressure.to Fri Aug 28 09:38:52 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 28 Aug 2009 14:38:52 +0100 Subject: [wxruby-users] Debugging sizer usage and gui layout In-Reply-To: References: Message-ID: <4A97DDEC.9030903@pressure.to> Hi Pito Pito Salas wrote: > In other gui packages I have seen special 'debug modes' on panels or > frames which highlighted the specific placement and size of each window > and subwindow (as determined by sizers) to help you visualize why things > aren't working as expected. Is there such a thing in wxRuby (or Wx in > general?) Yes - http://thread.gmane.org/gmane.comp.lib.wxwidgets.general/53232/focus=53233 I haven't ever tried this myself. Also note that the distributed wxRuby builds are based on RELEASE rather than DEBUG builds of Wx - so unless you compile yourself this won't be available. It's not a solution for everything, but trying things out in a GUI designer can often help with the trickier bits of nesting, even if you don't use XRC for the final code. cheers a From lists at ruby-forum.com Fri Aug 28 23:04:21 2009 From: lists at ruby-forum.com (Larry Rogers) Date: Sat, 29 Aug 2009 05:04:21 +0200 Subject: [wxruby-users] TreeCtrl Scrolling In-Reply-To: <4A9758E6.3030400@pressure.to> References: <5f3b93b988b8ef1660ac00fb8497904e@ruby-forum.com> <4A9758E6.3030400@pressure.to> Message-ID: <23a23e6d632873e40885c0a206886fea@ruby-forum.com> Alex Fenton wrote: > Larry Rogers wrote: > > That sounds strange. With TreeCtrl the scroll bars should appear when > they're needed, and not when they're not. It's all handled by the widget > itself - you definitely shouldn't need to use another control like > ScrolledWindow - just use Sizers (as in general) to manage the size of > your widgets. > > If this doesn't help, could you post a minimal, runnable sample that > reproduces the problem, and also a bit more info about your platform and > version. > > a Hi Alex, Thanks for your reply. I am encouraged that you say it should work the way my instincts said it should. I have tried many variations of Frame/Pane/TreeCtrl with and without sizers at each layer. What is different about my case is that I'm using wxSU on a Mac, which if you're not familiar with it is an extension to Google Sketchup to use wxRuby to add 3rd party UI features. This is likely the source of my problem and it points me to another approach. I should get my UI running in wxRuby first and then adapt it to SketchUp. In doing so I will devise the example that you asked for and if it still doesn't work I will post that. Thanks for the hints. Larry -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Aug 30 14:48:13 2009 From: lists at ruby-forum.com (Dmitry a. Ustalov) Date: Sun, 30 Aug 2009 20:48:13 +0200 Subject: [wxruby-users] build troubles on fedora 11 In-Reply-To: <4A974A16.6040208@pressure.to> References: <5ae928c46e72b73a231da35160984de4@ruby-forum.com> <4A974A16.6040208@pressure.to> Message-ID: Alex Fenton wrote: > Your SWIG is too new. Since we released 1.0.1, SWIG released a new > version that broke some features of the generated code we rely on. > Please try downgrading to 1.3.38. > > alex Very well, I've downloaded and installed the SWIG 1.3.38, but rake fails: obj/wx.o: In function `wxRuby_IterateTracking': /usr/include/wx-2.8/wx/geometry.h:753: multiple definition of `cWxEvtHandler' obj/EvtHandler.o:/usr/include/wx-2.8/wx/geometry.h:112: first defined here obj/wx.o: In function `wxRuby_IterateTracking': /usr/include/wx-2.8/wx/thread.h:594: multiple definition of `cWxEvent' obj/Event.o:/usr/include/wx-2.8/wx/thread.h:554: first defined here obj/wx.o: In function `wxRuby_IterateTracking': /usr/include/wx-2.8/wx/thread.h:554: multiple definition of `cWxWindow' obj/Window.o:/usr/lib/ruby/1.8/i386-linux/ruby.h:696: first defined here obj/wx.o: In function `PtrToRbObjHash_wxImplementation_HashTable::begin()': /usr/include/wx-2.8/wx/geometry.h:113: multiple definition of `cWxTopLevelWindow' obj/TopLevelWindow.o:/usr/include/wx-2.8/wx/thread.h:554: first defined here obj/wx.o: In function `_wxHashTableBase2::GetFirstNode(unsigned int, _wxHashTable_NodeBase**)': /usr/include/wx-2.8/wx/geometry.h:107: multiple definition of `cWxSize' obj/Size.o:/usr/include/wx-2.8/wx/thread.h:554: first defined here It's sad :( -- Posted via http://www.ruby-forum.com/.