From alex at pressure.to Fri May 1 01:36:46 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 01 May 2009 06:36:46 +0100 Subject: [wxruby-users] WxRuby GUI doesn't look native In-Reply-To: <20090430231718.EAC37197857C@rubyforge.org> References: <20090430231718.EAC37197857C@rubyforge.org> Message-ID: <49FA8A6E.2070505@pressure.to> Hi Jonah jonah at nucleussystems.com wrote: > * Recently, I switched from Tk to WxRuby, because it comes as a gem, > and doesn't require an extra program. Over the past couple of days, > I've been playing with it, (on Windows XP) and notices that none of > the buttons or gauges or anything look native. I downloaded > wxruby-2.0.0-x86-mswin32-60.gem, with Ruby 1.8. What is causing this?* Does this help? : http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html (referenced here: http://wxruby.rubyforge.org/wiki/wiki.pl?Installation) alex From lists at ruby-forum.com Sat May 2 19:30:02 2009 From: lists at ruby-forum.com (Daniel Zepeda) Date: Sun, 3 May 2009 01:30:02 +0200 Subject: [wxruby-users] Drag and Drop help In-Reply-To: <49F1A462.6020907@pressure.to> References: <2c158f4df31caf4cee10ffe3c2904fc0@ruby-forum.com> <49F1A462.6020907@pressure.to> Message-ID: Ok, so first off, thank you for the help Alex, that got me started. Here is what I've come up with so far: http://gist.github.com/105742 It is nowhere near finished, and some things like the return values of on_data, etc. are just there to get it going. I sort of expected the image to be part of the "cursor" when you do the drag-and-drop operation, like what you get when dragging from the OSX Finder, a representation of the file, while dragging. But, all I'm getting is an empty square with a pointer. Is that all you get by default, or am I doing something wrong? I thought maybe the image was too big, so I scaled, resized it down to smaller than the square, but still just got the empty square. I originally thought I was going to use a Wx::DragImage, but it turns out that DropSource#do_drag_drop blocks mouse events, so trying to incorporate the DragImage sample doesn't work because evt_motion doesn't get triggered while do_drag_drop is active. Now I'm thinking of using DropSource#give_feedback in conjunction with DragImage, but give_feedback doesn't give you mouse coordinates, so to do that, I need to find some way of grabbing the mouse coordinates within give_feedback so I can tell the image where to move. At this point, what I'm thinking seems way too complicated and that is usually a signal to me that I'm doing something wrong, so I want a sanity check from the experts. Again, any pointers is the right direction would be appreciated. BTW, if you actually want to run the sample, you'll need wxruby-logo.png found in the samples/drawing directory under the wxRuby distribution. I didn't think it was a good idea to try to post that in the Gist. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon May 4 11:01:11 2009 From: lists at ruby-forum.com (Jonah Dahlquist) Date: Mon, 4 May 2009 17:01:11 +0200 Subject: [wxruby-users] Gauge use In-Reply-To: References: <20090503232134.EF9381858102@rubyforge.org> Message-ID: Sorry, never mind. It was an error in my code. On a side note, how does one loop through a process while moving the gauge, without freezing the program? If I loop through copying some files, it still moves the gauge, but has a waiting cursor and is stuck. Is there a way to make it do the operation, but not freeze? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon May 4 14:45:03 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 04 May 2009 19:45:03 +0100 Subject: [wxruby-users] Gauge use In-Reply-To: References: <20090503232134.EF9381858102@rubyforge.org> Message-ID: <49FF37AF.6050000@pressure.to> Jonah Dahlquist wrote: > how does one loop through a process while moving the gauge, without freezing > the program? If I loop through copying some files, it still moves the > gauge, but has a waiting cursor and is stuck. Is there a way to make it > do the operation, but not freeze? > There are several different ways to deal with long-running background tasks. Probably the easiest one for this situation - where you have a job that breaks down naturally into smaller pieces (individual files) - is to use evt_idle. This is called whenever there is processing time free. It would go something like this: def initialize ... evt_idle :on_idle end def on_idle if have_files_to_copy copy_a_file update_progress_bar end end This should allow the task to progress in chunks while keeping the GUI responsive. A more general approach to dealing with long-running tasks is to run them in a background Thread. But this is considerably more complicated for several reasons - eg you should not make GUI update calls from subordinate threads. There are previous discussions and samples about using Threads in wxRuby if that's the way you want to go. alex From lists at ruby-forum.com Mon May 4 15:41:33 2009 From: lists at ruby-forum.com (Jonah Dahlquist) Date: Mon, 4 May 2009 21:41:33 +0200 Subject: [wxruby-users] Gauge use In-Reply-To: <49FF37AF.6050000@pressure.to> References: <20090503232134.EF9381858102@rubyforge.org> <49FF37AF.6050000@pressure.to> Message-ID: <927ec38eb9b61fe7f89241bb54eb509d@ruby-forum.com> Perfect! It works now. Thanks :) -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue May 5 05:37:21 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 05 May 2009 10:37:21 +0100 Subject: [wxruby-users] Drag and Drop help In-Reply-To: References: <2c158f4df31caf4cee10ffe3c2904fc0@ruby-forum.com> <49F1A462.6020907@pressure.to> Message-ID: <4A0008D1.8030901@pressure.to> Daniel Zepeda wrote: > Ok, so first off, thank you for the help Alex, that got me started. > > Here is what I've come up with so far: > > http://gist.github.com/105742 > I like the way this works so far. > It is nowhere near finished, and some things like the return values of > on_data, etc. are just there to get it going. > > I sort of expected the image to be part of the "cursor" when you do the > drag-and-drop operation, like what you get when dragging from the OSX > Finder, a representation of the file, while dragging. But, all I'm > getting is an empty square with a pointer. Is that all you get by > default, or am I doing something wrong? > No, I think that's all you get. You can use DropSource#set_cursor to set a cursor associated with a particular drag action. You can create a Cursor from an arbitrary Image, but you're limited to 32x32 pixels. > I thought maybe the image was too big, so I scaled, resized it down to > smaller than the square, but still just got the empty square. > > I originally thought I was going to use a Wx::DragImage, but it turns > out that DropSource#do_drag_drop blocks mouse events, so trying to > incorporate the DragImage sample doesn't work because evt_motion doesn't > get triggered while do_drag_drop is active. > http://www.tebyan.net/index.aspx?pid=31159&BookID=22131&PageIndex=94&Language=3 and see next comment > Now I'm thinking of using DropSource#give_feedback in conjunction with > DragImage, but give_feedback doesn't give you mouse coordinates, so to > do that, I need to find some way of grabbing the mouse coordinates > within give_feedback so I can tell the image where to move. > There are the global module functions Wx::get_mouse_position and Wx::get_mouse_state > At this point, what I'm thinking seems way too complicated and that is > usually a signal to me that I'm doing something wrong, so I want a > sanity check from the experts. I'm no expert on this, but I would have expected this not to be too hard. However, other people using WX seem to be wondering the same thing. See the following threads: http://groups.google.com/group/comp.soft-sys.wxwindows/browse_thread/thread/fcc67efa1e6ea29f http://lists.wxwidgets.org/pipermail/wx-dev/2003-February/030914.html hth alex From lists at ruby-forum.com Tue May 12 19:35:40 2009 From: lists at ruby-forum.com (Vk Dee) Date: Wed, 13 May 2009 01:35:40 +0200 Subject: [wxruby-users] HTMLWindow limits? Message-ID: Hi, I'm trying to write a simple email client using wxruby, and using HTMLWindow to display the email contents. But HtmlWindow seems to have a limit of 2362 bytes on the size of the page it would load - which I found emperically by limiting the size of text i passed into the control. Is this a known problem, or am I setting things wrongly? Here's the relevant piece of code:
class ItemDetail < Panel
  def initialize(parent,items,log)
    super(parent)
    @items=items
    @log=log

    @sizer = Wx::BoxSizer.new(Wx::VERTICAL)
      add_from
    add_message
    set_sizer(@sizer)
  end
  def add_from
    @from=TextCtrl.new(self,-1,"",:name=>"fromtxtctrl")
    @sizer.add(@from,1,Wx::ALL|Wx::GROW)
  end

  def add_message
    @message=HtmlWindow.new(self,:name=>"msghtmlwindow")
    @sizer.add(@message,10,Wx::ALL|Wx::GROW)
  end

  def setItem(index)
    begin
      item=@items[index]
      @from.set_value(item.from)
      #@message.set_value(item.body[0..2362]) #emperically found that
this is the limit for page size.
    rescue Exception => err
      @log.write_text('invalid item index: "%d, or err:%s"'
%[index,err.message])
    end
  end
end

-- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue May 12 19:38:50 2009 From: lists at ruby-forum.com (Vk Dee) Date: Wed, 13 May 2009 01:38:50 +0200 Subject: [wxruby-users] HTMLWindow limits? In-Reply-To: References: Message-ID: <4ea8d75670b774ac1b4f013373c94b4f@ruby-forum.com> Vk Dee wrote: Correction: the set_value line is not commented out. It should read like so: > @message.set_value(item.body[0..2362]) #emperically found that -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue May 12 22:13:45 2009 From: lists at ruby-forum.com (Phil Puccio) Date: Wed, 13 May 2009 04:13:45 +0200 Subject: [wxruby-users] ListCtrl.get_selections broken? In-Reply-To: References: Message-ID: Sorry, my original posting omitted most of the method I was referring to. The fixed method as originally posted by Alex was: class Wx::ListCtrl def get_selections selections = [] item = get_next_item(-1, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED) while item >= 0 selections << item item = get_next_item(item, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED) end selections end end My suggestion is that the second Wx::LIST_NEXT_BELOW be changed to Wx::LIST_NEXT_ALL . Phil -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu May 14 08:07:02 2009 From: lists at ruby-forum.com (Phil Puccio) Date: Thu, 14 May 2009 14:07:02 +0200 Subject: [wxruby-users] Timing issue with set_focus? In-Reply-To: References: Message-ID: Thanks, Mario. Yes, I'm really enjoying using wxRuby. I've been away from desktop apps for a very long time, and after a few years of web apps, it's been fun to quickly develop a nice, fast app using Ruby and native widgets. I used your Wx::Timer suggestion Mario Steele wrote: > Hello Phil, > > Welcome to the list, and it's good that you are finding wxRuby useful to > your purposes. As to your question, you are correct in assuming that > ListCtrl's event handling isn't completed when you attempt to switch focus > from the ListCtrl to your TextCtrl. There are two ways in which you can do > this, but you have to understand how Ruby and wxWidgets are handled on the > back side of the system. > > ...snip... > > Wx::Timer.after(500) do > # set_focus your TextCtrl here > end > -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu May 14 09:16:35 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 14 May 2009 14:16:35 +0100 Subject: [wxruby-users] HTMLWindow limits? In-Reply-To: References: Message-ID: <4A0C19B3.2020004@pressure.to> Vk Dee wrote: > I'm trying to write a simple email client using wxruby, and using > HTMLWindow to display the email contents. But HtmlWindow seems to have a > limit of 2362 bytes on the size of the page it would load - which I > found emperically by limiting the size of text i passed into the > control. Is this a known problem, or am I setting things wrongly? > No, there is no such limit on the size of text to be displayed. Does this problem arise with a particular text, or any HTML text? I would check whether the HTML string you are providing is correctly encoded in UTF-8 - if not, you might get this kind of truncation at an invalid byte. > Here's the relevant piece of code: > Thanks for posting code, but it's not possible to check it out unless it's self-contained and runnable. We can't reconstruct and imagine what the rest of the program is doing. Often you will find the process of reducing it to a basic sample illustrating the problem will show up the root cause. a From alex at pressure.to Thu May 14 09:23:09 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 14 May 2009 14:23:09 +0100 Subject: [wxruby-users] ListCtrl.get_selections broken? In-Reply-To: References: Message-ID: <4A0C1B3D.2090509@pressure.to> Phil Puccio wrote: > Hi, > > In a thread back in March, Alex Fenton provided a fix in one line of > ListCtrl.get_selections: > > >class Wx::ListCtrl > > def get_selections > > selections = [] > > item = get_next_item(-1, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED) > > while item >= 0 > > selections << item > > item = get_next_item(item, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED) > > end > > selections > > end > >end > >The only change is Wx::LIST_NEXT_ALL was previously LIST_NEXT_BELOW. > That fix got me past my initial problem, too, but then I found that if I sent get_selections to a ListCtrl with only one row or with no rows (I'm using report mode), the code would go into a loop and hang my CPU. After changing the second reference of Wx::LIST_NEXT_BELOW to Wx::LIST_NEXT_ALL, everything worked fine for me. > Alex, you might want to consider this additional change. Thanks very much Phil, I've committed this change to SVN alex From lists at ruby-forum.com Thu May 14 17:44:58 2009 From: lists at ruby-forum.com (Vk Dee) Date: Thu, 14 May 2009 23:44:58 +0200 Subject: [wxruby-users] HTMLWindow limits? In-Reply-To: <4A0C19B3.2020004@pressure.to> References: <4A0C19B3.2020004@pressure.to> Message-ID: > No, there is no such limit on the size of text to be displayed. ok > > Thanks for posting code, but it's not possible to check it out unless > it's self-contained and runnable. We can't reconstruct and imagine what > the rest of the program is doing. Often you will find the process of > reducing it to a basic sample illustrating the problem will show up the > root cause. > fair enough. i'll try and put in a self-contained sample. and check out the possibility of rogue html. Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu May 14 20:21:26 2009 From: lists at ruby-forum.com (Vk Dee) Date: Fri, 15 May 2009 02:21:26 +0200 Subject: [wxruby-users] HTMLWindow limits? In-Reply-To: References: <4A0C19B3.2020004@pressure.to> Message-ID: <82a56d368cd6207d18594534589f8a82@ruby-forum.com> Update: it does look like a case of bad html. Thanks for the quick response. I'll update this thread if there's anything new to add. >> > fair enough. i'll try and put in a self-contained sample. and check out > the possibility of rogue html. > Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri May 15 07:41:15 2009 From: lists at ruby-forum.com (Vk Dee) Date: Fri, 15 May 2009 13:41:15 +0200 Subject: [wxruby-users] HTMLWindow limits? In-Reply-To: <82a56d368cd6207d18594534589f8a82@ruby-forum.com> References: <4A0C19B3.2020004@pressure.to> <82a56d368cd6207d18594534589f8a82@ruby-forum.com> Message-ID: <3e55bc8bff4221975452bb21097df08b@ruby-forum.com> Vk Dee wrote: Final update: My fix in case anyone has the same problem was to replace all non-printable characters like so: htmlstring.gsub(/[^[:print:]]/, '') > Update: it does look like a case of bad html. > Thanks for the quick response. I'll update this thread if there's > anything new to add. > -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon May 18 21:00:26 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 19 May 2009 02:00:26 +0100 Subject: [wxruby-users] Segmentation fault on exiting program In-Reply-To: <7b071a2e0905160556v7f4abc63p279ef1e110a37e17@mail.gmail.com> References: <7b071a2e0905160556v7f4abc63p279ef1e110a37e17@mail.gmail.com> Message-ID: <4A1204AA.6050106@pressure.to> Hi Peter Peter Lane wrote: > I have been using wxRuby for a while now, but hit a problem on > upgrading. I have ruby1.9.1p129 installed, along with wxruby 2.0.0. > My system is Ubuntu 8.10, with wxWidgets 2.8-0 from the repository. > > Whenever I exit an application, I get an error message. My programs > seem to work fine, it's just the error as you exit which is > irritating. I've not noticed this with any non-wxruby ruby programs. > Has anyone else come across the same problem? Is there a fix? Thanks for the report. I'm seeing the same thing with Ruby 1.9 on my Ubuntu machine, haven't quite figured out why yet. I will definitely want to fix this for the upcoming 2.0.1 release. alex From chauk.mean at gmail.com Tue May 19 03:28:34 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Tue, 19 May 2009 09:28:34 +0200 Subject: [wxruby-users] Segmentation fault on exiting program In-Reply-To: <4A1204AA.6050106@pressure.to> References: <7b071a2e0905160556v7f4abc63p279ef1e110a37e17@mail.gmail.com> <4A1204AA.6050106@pressure.to> Message-ID: Hi, On Tue, May 19, 2009 at 3:00 AM, Alex Fenton wrote: > Peter Lane wrote: >> >> I have been using wxRuby for a while now, but hit a problem on upgrading. >> ?I have ruby1.9.1p129 installed, along with wxruby 2.0.0. ?My system is >> Ubuntu 8.10, with wxWidgets 2.8-0 from the repository. >> >> Whenever I exit an application, I get an error message. ?My programs seem >> to work fine, it's just the error as you exit which is irritating. ?I've not >> noticed this with any non-wxruby ruby programs. ?Has anyone else come across >> the same problem? ?Is there a fix? > > Thanks for the report. I'm seeing the same thing with Ruby 1.9 on my Ubuntu > machine, haven't quite figured out why yet. I will definitely want to fix > this for the upcoming 2.0.1 release. > I suspect a binary incompatibility introduced by the ruby1.9.1p129 related with native extensions. With ruby1.9.1p0, I haven't noticed such kind of problems on Ubuntu 8.10 and wxRuby-2.0. I have upgraded to Ubuntu 9.04 recently, and I just run the test case still with ruby1.9.1p0 and wxRuby-2.0 without any problem. Conversely, on my MinGW installation, I have upgraded to ruby1.9.1p129 and I've noticed that the corresponding wxRuby-2.0 binary gem (built with ruby1.9.1p0) does not work at all. I've just rebuilt the wxRuby-2.0 lib with ruby1.9.1p129 and then everything works again. Can you try to rebuild wxRuby ? Anyway, I will check soon what I suspect on Ubuntu 9.10 : - upgrade to ruby1.9.1p129 then try your test case with the wxRuby-2.0 binary gem : the error at the exit should occur - rebuild wxRuby-2.0 for ruby1.9.1p129 and see if the error doesn't occur any more. Cheers. Chauk-Mean. From lists at ruby-forum.com Tue May 19 18:25:53 2009 From: lists at ruby-forum.com (Jonah Dahlquist) Date: Wed, 20 May 2009 00:25:53 +0200 Subject: [wxruby-users] Scroll Area Message-ID: Hello, world! Is there a way to make a smaller part of a window scroll? Scrolling is required for what I'm making, but I don't want the whole window to scroll. It will contain buttons and stuff. -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Tue May 19 19:26:28 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Wed, 20 May 2009 01:26:28 +0200 Subject: [wxruby-users] Segmentation fault on exiting program In-Reply-To: References: <7b071a2e0905160556v7f4abc63p279ef1e110a37e17@mail.gmail.com> <4A1204AA.6050106@pressure.to> Message-ID: On Tue, May 19, 2009 at 9:28 AM, Chauk-Mean Proum wrote: > I suspect a binary incompatibility introduced by the ruby1.9.1p129 > related with native extensions. I was wrong ... > Anyway, I will check soon what I suspect on Ubuntu 9.10 : > - upgrade to ruby1.9.1p129 then try your test case with the wxRuby-2.0 > binary gem : the error at the exit should occur No error at the exit. Alex has more luck than me :-) Cheers. Chauk-Mean. From alex at pressure.to Tue May 19 19:48:07 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 20 May 2009 00:48:07 +0100 Subject: [wxruby-users] Scroll Area In-Reply-To: References: Message-ID: <4A134537.50503@pressure.to> Hi Jonah Dahlquist wrote: > Is there a way to make a smaller part of a window scroll? Scrolling is > required for what I'm making, but I don't want the whole window to > scroll. It will contain buttons and stuff. > Look into Wx::ScrolledWindow http://wxruby.rubyforge.org/doc/scrolledwindow.html Also see the samples in samples/bigdemo/wxScrolledWindow. Really ugly but it shows one way to use it. a From lists at ruby-forum.com Wed May 20 16:58:42 2009 From: lists at ruby-forum.com (Peter Lane) Date: Wed, 20 May 2009 22:58:42 +0200 Subject: [wxruby-users] Segmentation fault on exiting program In-Reply-To: References: <7b071a2e0905160556v7f4abc63p279ef1e110a37e17@mail.gmail.com> <4A1204AA.6050106@pressure.to> Message-ID: Chauk-Mean Proum wrote: > On Tue, May 19, 2009 at 9:28 AM, Chauk-Mean Proum > wrote: > >> I suspect a binary incompatibility introduced by the ruby1.9.1p129 >> related with native extensions. > > I was wrong ... > >> Anyway, I will check soon what I suspect on Ubuntu 9.10 : >> - upgrade to ruby1.9.1p129 then try your test case with the wxRuby-2.0 >> binary gem : the error at the exit should occur > > No error at the exit. > Alex has more luck than me :-) > > Cheers. > > Chauk-Mean. So the key could be to upgrade Ubuntu ? Thanks for exploring this. I tried the binary gem when I upgraded ruby to 1.9.1, and I got the same problem on both p129 and an earlier release. cheers, Peter. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed May 20 19:01:36 2009 From: lists at ruby-forum.com (Jonah Dahlquist) Date: Thu, 21 May 2009 01:01:36 +0200 Subject: [wxruby-users] Scroll Area In-Reply-To: <4A134537.50503@pressure.to> References: <4A134537.50503@pressure.to> Message-ID: <97e6be80e54a5b40e2216c3b041485fe@ruby-forum.com> Cool. Got it. Thanks! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat May 23 11:46:57 2009 From: lists at ruby-forum.com (Daniel Zepeda) Date: Sat, 23 May 2009 17:46:57 +0200 Subject: [wxruby-users] Drag and Drop help In-Reply-To: <4A0008D1.8030901@pressure.to> References: <2c158f4df31caf4cee10ffe3c2904fc0@ruby-forum.com> <49F1A462.6020907@pressure.to> <4A0008D1.8030901@pressure.to> Message-ID: <2a052ccba1a8ba58e280da4b9ae3ac6e@ruby-forum.com> Hello, I've worked on the original sample and updated the gist: http://gist.github.com/105742 With some exceptions, this works on OS X, but running it in Windows produces disappointing results. I'll point out where I'm having problems. Would you let me know if I'm doing something wrong, or if these are bugs in wxRuby? I'm just going to go through the file line by line and comment. Lines 6-26: This isn't so important, but is at the top of the file, so gets commented on first. I've worked up a basic DragResultHandler, it would be nice if some form of this were included in wxRuby. Line 49: I don't get a sunken border on Windows. It looks nice on OS X, but Windows just has a flat featureless plane for the drop targets. Lines 89,95: I don't have to call refresh on OS X for the backgrounds to light up, but Windows doesn't do anything unless I call refresh. Is this expected? Line 131: This doesn't work on Windows or OS X. I get a "Wrong Argument" error. It looks like the documentation says you should be able to do this, but I've tried several permutations, and none of them works. Lines 155-158: On Windows, the give_feedback method is only called consistently when the pointer is over the drop targets during a drag operation. It is called intermittently when over the drop sources, and not at all anywhere else. This works perfectly on OS X. Line 179: This is like trying to create a new image on line 131. The documentation seems to say I should be able to do this, but it gives me an argument error as well. Resorting to setting the alpha pixel-by-pixel as I do on 181-185 works, but it is ugly. Lines 189-195: I expected to just set the hotspot to half the width of the image, and the full height of the image to get the image floating above the cursor. This just doesn't work. I have to use these non-sensical values to get the effect I want on OS X. On Windows, the result is inconsistent, sometimes I more-or-less get the effect I want, and other times the image is way off to the side and down from where it should be, and other times it is way off to the side and up from where it should be. Line 202: Works perfectly on OS X. On Windows, after I drag/drop one image, and I then attempt to drag another image, if I move the pointer around "too much" the program segfaults at this line. I can drag the image around all I want on the first drag operation, but the second one always segfaults when I move the pointer around "too much". Line 209: As with the other mention of refresh above, I only have to call this on Windows. Seems like I shouldn't have to call it at all. Lastly, a problem on OS X is that after a drag/drop operation, and clearing the dialog, I have to click once anywhere in the window before I can initiate another drag/drop. I thought it might be a focus problem, so I tried different methods of resetting the focus, but it doesn't seem to make a difference. If I don't use the MessageDialog, that is, I just replace the dialog with a 'puts' in the event handler, I don't have that problem. This is only a problem on OS X. Again, I'm unsure if I'm doing something wrong, or if these are bugs in wxRuby, any pointers would be much appreciated. Just a quick note on the Gist, you may notice I've included the image in it now so you don't have to go grab it from somewhere else. Also, if this helps, on OS X, I'm using wxRuby 2.0.0, ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9], built from ports, and on Windows I'm using the same version of wxRuby and ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32], which I downloaded from the Ruby website. Since I'm going to use my template for packaging/distribution, using a different ruby version wouldn't be that much of a problem. Oh, and I'm running Windows under Parallels 4 on OS X for these tests, if that makes a difference. Thanks! DZ -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue May 26 10:22:25 2009 From: lists at ruby-forum.com (=?utf-8?Q?Marvin_G=c3=bclker?=) Date: Tue, 26 May 2009 16:22:25 +0200 Subject: [wxruby-users] Unable to use wxruby-ruby19 in Ruby 1.9.1-p129 on Windows Message-ID: <2a71bf63b4d6cad27b777ae11227122f@ruby-forum.com> Hello, I'm using wxRuby as my favourite GUI toolkit with Ruby 1.9. But after I updated my Ruby installation from Ruby 1.9.1-p0 to Ruby 1.9.1-p129, I cannot do a require "wx" anymore. Every time I try I get an error that says that Windows isn't able to find some procedure. I have a German Windows XP installation, so I don't know the English equivalent of this error (sorry): irb(main):001:0> require "rubygems" => false irb(main):002:0> require "wx" LoadError: 127: Die angegebene Prozedur wurde nicht gefunden. - C:/ruby19/ruby -1.9.1-p129-i386-mingw32/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.0-x86-mingw3 2/lib/wxruby2.so from C:/ruby19/ruby-1.9.1-p129-i386-mingw32/lib/ruby/gems/1.9.1/gems/wxr uby-ruby19-2.0.0-x86-mingw32/lib/wx.rb:12:in `require' from C:/ruby19/ruby-1.9.1-p129-i386-mingw32/lib/ruby/gems/1.9.1/gems/wxr uby-ruby19-2.0.0-x86-mingw32/lib/wx.rb:12:in `' from (irb):2:in `require' from (irb):2 from C:/ruby19/ruby-1.9.1-p129-i386-mingw32/bin/irb:12:in `
' I would translate it this way: "The given procedure wasn't found". At the same time I get a Windows error window, saying: Der Prozedureinsprungpunkt "DLLMain at 12" wurde in der DLL "msvcrt-ruby191.dll" nicht gefunden. I don't know how to translate "Prozedureinsprungpunkt", but it must be something like "procedure definition point", so I would say: The procedure definition point "DLLMain at 12" wasn't found in the "msvcrt-ruby19.dll" DLL file. I'm using the mingw version of ruby from http://rubyinstaller.org/downloads/. My full ruby -v: ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32] -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Tue May 26 13:51:35 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Tue, 26 May 2009 19:51:35 +0200 Subject: [wxruby-users] Unable to use wxruby-ruby19 in Ruby 1.9.1-p129 on Windows In-Reply-To: <2a71bf63b4d6cad27b777ae11227122f@ruby-forum.com> References: <2a71bf63b4d6cad27b777ae11227122f@ruby-forum.com> Message-ID: Hi Marvin, On Tue, May 26, 2009 at 4:22 PM, Marvin G?lker wrote: > Hello, > > I'm using wxRuby as my favourite GUI toolkit with Ruby 1.9. But after I > updated my Ruby installation from Ruby 1.9.1-p0 to Ruby 1.9.1-p129, I > cannot do a require "wx" anymore. Every time I try I get an error that > says that Windows isn't able to find some procedure. I had exactly the same problem when I upgraded my MinGW ruby-1.9.1 from p0 to p129. I suspected a general binary incompatibility between these two versions of ruby (see http://rubyforge.org/pipermail/wxruby-users/2009-May/004862.html). But this seems to be specific to MinGW. The solution is to rebuild wxRuby-2.0 for the ruby-1.9.1-p129. If you can't rebuild the gem yourself, please wait for the upcoming wxRuby-2.0.1 release. The MinGW wxRuby-2.0.1 gem will be built for ruby-1.9.1-p129. Cheers. Chauk-Mean. From lists at ruby-forum.com Wed May 27 14:37:23 2009 From: lists at ruby-forum.com (=?utf-8?Q?Marvin_G=c3=bclker?=) Date: Wed, 27 May 2009 20:37:23 +0200 Subject: [wxruby-users] Unable to use wxruby-ruby19 in Ruby 1.9.1-p129 on Windows In-Reply-To: References: <2a71bf63b4d6cad27b777ae11227122f@ruby-forum.com> Message-ID: <106e7be54df5da3083a7e4a39c54e7d2@ruby-forum.com> Chauk-Mean Proum wrote: > The solution is to rebuild wxRuby-2.0 for the ruby-1.9.1-p129. > > If you can't rebuild the gem yourself, please wait for the upcoming > wxRuby-2.0.1 release. > The MinGW wxRuby-2.0.1 gem will be built for ruby-1.9.1-p129. OK, so I'm going to wait for that release. I thought, I made something wrong with updating my Ruby installation... :-) Thanks! Marvin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat May 30 11:56:11 2009 From: lists at ruby-forum.com (Daniel Zepeda) Date: Sat, 30 May 2009 17:56:11 +0200 Subject: [wxruby-users] Drag and Drop help In-Reply-To: References: <2c158f4df31caf4cee10ffe3c2904fc0@ruby-forum.com> <49F1A462.6020907@pressure.to> <4A0008D1.8030901@pressure.to> <2a052ccba1a8ba58e280da4b9ae3ac6e@ruby-forum.com> Message-ID: <88f50c5debefaeb7332cd63fc7b1f4de@ruby-forum.com> Just wanted to make sure this was the final word. I guess the workaround is to only use drag images in OSX. Kind of disappointing, but oh well, everything seems harder in Windows, and it's not the fault of Wx. I wonder what GTK is like. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun May 31 11:41:52 2009 From: lists at ruby-forum.com (Daniel Zepeda) Date: Sun, 31 May 2009 17:41:52 +0200 Subject: [wxruby-users] MacRuby Message-ID: Anybody seen this? http://merbist.com/2009/05/27/macruby-changing-the-ruby-ecosystem/ The interesting thing is that if Cocoa is not used, it is technically possible to have it run on any platform. Would that mean that wxRuby could run on MacRuby, and we could get real compiled applications, obviating the need for crappy frameworks like mine (http://github.com/duskhacker/ruby_on_skis/tree) for distributing ruby applications? That would be a great improvement, since "collection" frameworks like Ruby on Skis, Script2Exe and others still don't address the code obfuscation that most companies would require to sell applications. DZ -- Posted via http://www.ruby-forum.com/.