fxruby-users Mailing List for FXRuby (Page 30)
Status: Inactive
Brought to you by:
lyle
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(75) |
Jul
(90) |
Aug
(61) |
Sep
(56) |
Oct
(56) |
Nov
(39) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(56) |
Feb
(45) |
Mar
(61) |
Apr
(40) |
May
(95) |
Jun
(79) |
Jul
(63) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: Joel V. <vj...@PA...> - 2003-08-11 00:26:44
|
Lyle Johnson wrote: > Joel VanderWerf wrote: > >> >> I'm trying to debug a fxerror message that my ruby program generates. >> The message is "FXDCWindow::drawIcon: illegal icon specified." The >> icon works fine in other contexts, so I'm suspecting FXRuby. > > > Are you sure that you've called create() on the icon before using it? Ah. That seems to be it. Apologies to FXRuby. In my other code, I was specifying the icon before calling the main window's #create, so the icons were created recursively. I'll learn eventually... There's no cost in calling create twice on an icon or other widget is there? Thanks! |
From: Lyle J. <ly...@kn...> - 2003-08-10 23:48:44
|
Joel VanderWerf wrote: > > I'm trying to debug a fxerror message that my ruby program generates. > The message is "FXDCWindow::drawIcon: illegal icon specified." The > icon works fine in other contexts, so I'm suspecting FXRuby. Are you sure that you've called create() on the icon before using it? > I'd like to be able to step into the routines that generate the > message, to see what the problem is, but I'm not able to 'list' from > gdb, even after selecting the correct frame. The listing just shows > the main() of ruby. I guess the obvious question is, did you compile FOX & FXRuby with debugging info (-g)? Also, I can't remember if the extconf.rb or install.rb scripts try to strip the shared object file of its symbols before they install it; you might need to check for that. > The 'sharedlibrary fox' command tells me that symbols for fox.so have > already been loaded. OK. > Any suggestions? Not right offhand. As I noted earlier, if you're sure the icon file itself is OK, I'd double check to see if it has been create-ed yet. That is pretty much always the source of the error message you're describing... |
From: Joel V. <vj...@PA...> - 2003-08-09 19:59:20
|
I'm trying to debug a fxerror message that my ruby program generates. The message is "FXDCWindow::drawIcon: illegal icon specified." The icon works fine in other contexts, so I'm suspecting FXRuby. I'd like to be able to step into the routines that generate the message, to see what the problem is, but I'm not able to 'list' from gdb, even after selecting the correct frame. The listing just shows the main() of ruby. The 'sharedlibrary fox' command tells me that symbols for fox.so have already been loaded. Any suggestions? |
From: <ly...@kn...> - 2003-08-08 19:08:37
|
On Thu, 7 Aug 2003 23:52:48 -0300, "Allen Mitchell" <aj...@nb...> wrote : > Lyle, I'm stilling trying to narrow down the issue I was having. I > downloaded your latest copy of FXRuby 1.0.25 and have rebuilt with that, but > the problem still exists. OK. > It is consistent, when I manipulate the list on the left, I use a thread to > populate the table on the right and just by moving the selection on the > left, I can cause the access violation. It always points to the same > location .... 21 bytes into the rb_newobj. I'm guessing, but maybe I'm > doing something wrong in the FXRuby code that causes objects to be marked > incorrectly and this causes the corruption in the GC. You should not be able to do anything wrong in your Ruby code to cause this to happen ;) That is to say, the fact that this crash is happening to you indicates a bug in my code; worst case, if you've done something "wrong", FXRuby should be smart enough to raise an exception or something more graceful than just dumping core. There is of course a remote chance that there's a bug in Ruby's GC code, but I think someone else would have caught that. > I'm going to simplify the application and attempt to get it down to > something I can easly send to you, but I'm not there yet. OK. Yes, this seems like the best path. > Disabling GC solves the problem, but isn't practical. Yes, I completely agree. > Maybe you can answer another question for me. I'm used to a windows > environment where events handlers receive only one event and no further > events are handled until the first event handler finishes. I have > demonstrated that in my application, when I get the sel_selected event and > start to handle it, I can receive a second one while I am still in the > handler. Is this normal behavior? If so, is there a way to force the > messages to be handled only one at a time? If not, any suggestions where to > look for it? True Windows events (i.e. those generated by the operating system) should be dispatched synchronously, one at a time, as you described. There may be some of those that are asynchronous, but it's not too many. But what you are /probably/ seeing is that some FOX messages get sent as a side effect of certain method calls. For example, if you consider the FXList class: http://www.fxruby.org/doc/api/classes/Fox/FXList.html you'll see that when a list item is selected, the FXList can send a SEL_SELECTED message to its target, and so you might write a handler for that: aList.connect(SEL_SELECTED) { |theList, sel, ptr| ... do something ... } Now suppose that your handler code wants to select some /other/ item as a result of this first item being selected. Your handler might look like this: aList.connect(SEL_SELECTED) { |theList, sel, ptr| # Also select the sixth item in the list... theList.selectItem(5, true) } Now if you check the documentation for FXList#selectItem, you'll see that when the second argument (notify) is true, that this causes a SEL_SELECTED message to be fired. This happens *immediately*. As you scan the documentation, you'll see similar notes for other methods. So this is a possible explanation for what you're seeing. If that doesn't seem to explain it, and if you can point out a specific example of what you're talking about, maybe I can come up with a different explanation ;) Hope this helps, Lyle |
From: Richard K. <ri...@in...> - 2003-08-07 23:42:56
|
On Thursday, August 7, 2003, at 03:04 PM, ly...@kn... wrote: > FYI: > > The recently published "Jabber Developer's Guide", by Dana Moore and > William > Wright, includes an example program written in Ruby and using FXRuby > (the > Ruby binding to FOX) for its graphical user interface. > > The program is, I think, a modified version of the imageviewer.rb > example > program from the FXRuby distribution, which in turn is based on the > imageviewer.cpp example program from the regular FOX distribution. I > didn't It is...sorry if there is not attribution.... > study the example too closely, but I think it was basically > transferring > data about images between different instances of the application using > the > Jabber (http://www.jabber.org) protocol. I am pretty sure that Rich > Kilmer > (author of the jabber4r extension, as well as one of the primary > FreeRIDE > developers) was the author of this example program -- so thanks, Rich! I did...it literally took 10 minutes. They asked me at work one day if I could write an image transfer app in Ruby over Jabber. I said "sure...no problem", and 10 minutes later I stunned them. As you can see from the example, with Fox being as easy as it is (and the Imageviewer providing a lot of code) and Jabber4r is really simple too...it was cake (just base64 encode the image data and send in a jabber IM). But the thanks go to you Lyle for all your work on FXRuby! -rich |
From: <ly...@kn...> - 2003-08-07 19:03:57
|
FYI: The recently published "Jabber Developer's Guide", by Dana Moore and William Wright, includes an example program written in Ruby and using FXRuby (the Ruby binding to FOX) for its graphical user interface. The program is, I think, a modified version of the imageviewer.rb example program from the FXRuby distribution, which in turn is based on the imageviewer.cpp example program from the regular FOX distribution. I didn't study the example too closely, but I think it was basically transferring data about images between different instances of the application using the Jabber (http://www.jabber.org) protocol. I am pretty sure that Rich Kilmer (author of the jabber4r extension, as well as one of the primary FreeRIDE developers) was the author of this example program -- so thanks, Rich! |
From: <ly...@kn...> - 2003-08-05 21:05:58
|
On Tue, 05 Aug 2003 22:56:48 +0200, meinrad recheis <mei...@gm...> wrote : > hope you are not angry for mailing directly to you, istead of posting on > the mailing list. No, that's no problem! > [FXRuby] aliasing FXComboBox's methods: > i want to change the combo's behavior so i aliased some of its interesting > methods. > unfortunately the strings won't be printed (no matter what i do with the > combobox) > that is, the alias-methods don_t get called. > got an idea why? I'm not sure I understand what you're trying to do. If you want to set up an alias for, say, FXComboBox#onListClicked, you can certainly do so with this code: class FXComboBox alias onListClicked click end With this alias in place, a call to 'click' is the same as a call to 'onListClicked', i.e. comboBox = FXComboBox.new(...) comboBox.onListClicked(x, y, z) comboBox.click(x, y, z) # same result as previous But this is just standard Ruby stuff. Now, if you are trying to catch the messages sent from an FXComboBox widget when one of its items is clicked, you want to instead use the connect() method to map the appropriate message to some handler method or block. According to the documentation for FXComboBox: http://www.fxruby.org/doc/api/classes/Fox/FXComboBox.html The combo box widget sends a SEL_COMMAND message when a new item is selected, so that's the one you want to catch: comboBox = FXComboBox.new(...) comboBox.connect(SEL_COMMAND) { |sender, sel, data| puts "click! new text = #{data}" } Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2003-08-04 15:31:07
|
Recheis Meinrad wrote: > ok i found out now, but have annother problem now. below i filled in my > code. <snip> Please see my reply to your previous message about the correct way to do this... |
From: Lyle J. <jl...@cf...> - 2003-08-04 15:30:15
|
Recheis Meinrad wrote: > i have not fully understood the fox api yet, and it is not easy to tell > from the doxygen-FOX docu what to do here: > i want to have a popup menu (with menu entries and submenus) that > becomes only visible when i rightclick on my fxglcanvas. There is an example of how to do this in the glviewer.rb example program that is distributed with FXRuby. Look at the code inside the onQueryMenu() method for that example program as a model for what to do in your application. Note that I usually like to tie this to the SEL_RIGHTBUTTONRELEASE event (as opposed to the SEL_LEFTBUTTONPRESS event). > 1) do i need a FXPopup or a FXMenuPane A menu pane (which is of course a subclass of FXPopup). > 2) what should be the parent for mypopup? glcanvas or application. The canvas window. |
From: Recheis M. <Mei...@av...> - 2003-08-04 09:27:01
|
ok i found out now, but have annother problem now. below i filled in my = code. it works (somehow): the popupmenu shows up on the mouseevent. if i move = on the menu with my mouse i can click on the "cancel" entry and it = disappeares. but if i move my mouse out of the popupmenu on the canvas the whole = application blocks. what s the problem here?=20 =20 here ist the documentation of the FXPopup.popup method: =20 <FOX doc> virtual void=20 popup (FXWindow *grabto, FXint x, FXint y, FXint w=3D0, FXint h=3D0) Popup the menu and grab to the given owner. </FOX doc> =20 i dont know what "grab to" means. w what went wrong here??? =20 > enhanced original message here: i have not fully understood the fox api yet, and it is not easy to tell = from the doxygen-FOX docu what to do here:=20 i want to have a popup menu (with menu entries and submenus) that = becomes only visible when i rightclick on my fxglcanvas. popup =3D FXPopup.new(parent ) cancel =3D FXMenuCommand.new(popup, "cancel") cancel.connect(SEL_COMMAND) { popup.popdown } =20 @glcanvas.connect( SEL_RIGHTBUTTONPRESS ) { | sender, sel, event | =20 popup.popup( @glcanvas, event.rootx, event.rooty) # mypopup.create=20 }=20 still, any help will be very appreciated, Meinrad=20 |
From: Recheis M. <Mei...@av...> - 2003-08-04 07:33:15
|
> hi > i have not fully understood the fox api yet, and it is not easy to = tell from the doxygen-FOX docu what to do here: > i want to have a popup menu (with menu entries and submenus) that = becomes only visible when i rightclick on my fxglcanvas. >=20 > @glcanvas.connect( SEL_RIGHTBUTTONPRESS ) { ...=20 > ... > ... >=20 > mypopup.create > } >=20 > 1) do i need a FXPopup or a FXMenuPane > 2) what should be the parent for mypopup? glcanvas or application. >=20 >=20 > any help will be very appreciated, Meinrad |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-30 01:30:32
|
On Tue, 29 Jul 2003, ly...@kn... wrote: > > I have always been able to just install over the previous files (without > first uninstalling the old version). No resultant problems that I have observed. OK, thanks, I'll do that. Hugh > |
From: <ly...@kn...> - 2003-07-29 22:19:20
|
On Tue, 29 Jul 2003 20:36:53 +0100 (BST), Hugh Sasse Staff Elec Eng <hg...@dm...> wrote : > OK, I have the FXRuby-1.0.24-ruby168.exe. Do I need to uninstall > the previous files, or will this installer sort all that out? (It > might be worth putting the info on the site itself, as well.) The > installer may explain this, but I won't know if it doesn't until > it's too late :-) I have always been able to just install over the previous files (without first uninstalling the old version). No resultant problems that I have observed. |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 20:28:55
|
On Tue, 29 Jul 2003, Lyle Johnson wrote: > Yes (see Dalibor's response). Follow the "Downloads" link from the > FXRuby home page at http://www.fxruby.org. For anyone else reading this OK, I have the FXRuby-1.0.24-ruby168.exe. Do I need to uninstall the previous files, or will this installer sort all that out? (It might be worth putting the info on the site itself, as well.) The installer may explain this, but I won't know if it doesn't until it's too late :-) Thank you, Hugh |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 17:45:17
|
On Tue, 29 Jul 2003, Lyle Johnson wrote: > I'm not exactly sure what you mean. In the C++ library, there is an Well, my discovering its existence was due to reading C++ docs.... > FXRuby, you create a timeout event by calling FXApp#addTimeout and, if > necessary, destroy it by calling FXApp#removeTimeout. ...so that's fine. Thanks > > When you call FXApp#addTimeout to register a timeout event, it adds a > new record to the application's internally-maintained list of timeout So it is not tied into the individual object. OK. [...] > those timeouts have expired. When a timeout comes due, the application > sends a SEL_TIMEOUT message to the appropriate target (the one that you > specificed when you added the timeout). And when it came back from storage the event would have gone. I suspected that might be the case. > > None of the FXRuby objects are serializable via Marshal or YAML, so I'm > not quite sure how to answer the last part of your question... Fair enough, it won't be possible to do it that way. I'll have to write code for the (simpler) data I can marshal to do this. Thank you. Hugh |
From: Lyle J. <jl...@cf...> - 2003-07-29 17:33:48
|
Hugh Sasse Staff Elec Eng wrote: > I see that FXTimer is not used in the Ruby side of FXRuby. Instead > I see addTimeout() and removeTimeout methods of FXApp. I think I'm > fairly clear about how to use this (though I'll have to brush up on > define my own selectors). I'm not exactly sure what you mean. In the C++ library, there is an FXTimer class (or struct?) but it just acts as "handle" to a particular registered timeout event. In other words, it has no publically accessible methods or data, and you cannot create or destroy FXTimer objects directly. As you've already noted, for both the C++ library and FXRuby, you create a timeout event by calling FXApp#addTimeout and, if necessary, destroy it by calling FXApp#removeTimeout. > My question is: What does adding a timeout do to the object, and > should I be able to see the timeout when I marshal/yaml it? I'm > wondering if it would be prorgrammatically simpler to store the > timeouts with objects that I save to disk, so that if they are > restored "too late" then action is taken, just as if they never went > into persistant storage and the timeout happened normally. It may > bulk up the data, but if it means I write less code, that is > probably good. When you call FXApp#addTimeout to register a timeout event, it adds a new record to the application's internally-maintained list of timeout events. During the application's event loop, in addition to checking for mouse motion, button clicks, etc. it's also checking to see if any of those timeouts have expired. When a timeout comes due, the application sends a SEL_TIMEOUT message to the appropriate target (the one that you specificed when you added the timeout). None of the FXRuby objects are serializable via Marshal or YAML, so I'm not quite sure how to answer the last part of your question... |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 15:54:09
|
I see that FXTimer is not used in the Ruby side of FXRuby. Instead I see addTimeout() and removeTimeout methods of FXApp. I think I'm fairly clear about how to use this (though I'll have to brush up on define my own selectors). My question is: What does adding a timeout do to the object, and should I be able to see the timeout when I marshal/yaml it? I'm wondering if it would be prorgrammatically simpler to store the timeouts with objects that I save to disk, so that if they are restored "too late" then action is taken, just as if they never went into persistant storage and the timeout happened normally. It may bulk up the data, but if it means I write less code, that is probably good. Hugh |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 13:48:59
|
On Tue, 29 Jul 2003, Lyle Johnson wrote: > > (http://www.fox-toolkit.org). I would give you a direct URL for the page > I'm talking about, but the FOX site is temporarily down while Jeroen > awaits a new network router ;) I've got a copy local to me at: http://www.eng.cse.dmu.ac.uk/~hgs/ruby/FXRuby/ well, more precisely at http://www.eng.cse.dmu.ac.uk/~hgs/ruby/FXRuby/fox-1.0.40/doc/doc.html > Hugh |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 13:27:39
|
On Tue, 29 Jul 2003, Lyle Johnson wrote: > Recheis Meinrad wrote: > > > where can i look up a list of all possible events a FXGLCanvas can produce? > > the FXRuby doc is not very helpful with events. > > the event. And as Hugh Sasse has pointed out in a separate reply, it is > /generally/ the case that a widget of some derived class (like > FXGLCanvas) will also send the messages that its superclass sends. Gavin Sinclair and others on the Ruby-Doc list are working on an extended ri which will include libraries, or at least the standard library. It won't cover FOX events which are too specific, but it's something to watch. At the moment it is called "rj". ("ri".succ) I've not figured out how rdoc's formatters work, but I think it would be useufl to be able to produce docs where this inheritance information is "unrolled". Hugh |
From: Lyle J. <jl...@cf...> - 2003-07-29 13:12:53
|
Recheis Meinrad wrote: > yeah, thats exactly what i was looking for. great help lyle! > > last question: > can i ignore the selector(type and id) in every case? In many cases, yes. For a case like this: canvas.connect(SEL_MOUSEWHEEL) { |sender, sel, evt| ... } You obviously already know what the message type is, so there's no point in decoding the selector (sel) to identify it. Similarly, unless the same message handler method is handling messages from a lot of different senders, it's unlikely that you'll need to check the message identifier part. For a little more background, you might want to check out Jeroen's documentation on FOX's message-target system at the FOX home page (http://www.fox-toolkit.org). I would give you a direct URL for the page I'm talking about, but the FOX site is temporarily down while Jeroen awaits a new network router ;) I'd also recommend checking the archives of this mailing list (fxruby-users) for a long discussion that Hugh Sasse and I had about how to interpret/use the message types and identifiers. Hope this helps, Lyle |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 13:00:06
|
On Tue, 29 Jul 2003, Lyle Johnson wrote: > Yes (see Dalibor's response). Follow the "Downloads" link from the > FXRuby home page at http://www.fxruby.org. For anyone else reading this > response, please note that I'll probably drop support for the 1.7.3 > build of Ruby "real soon now", especially since Ruby 1.8.0 is about to > become the new stable release. I will probably continue to support Ruby > 1.6.8 for some time. Thank you. That strategy would be the most helpful to your users AFAICS. Thank you for your continuing support. Hugh > > |
From: Lyle J. <jl...@cf...> - 2003-07-29 12:56:12
|
Recheis Meinrad wrote: > i managed to catch the mousewheelevent of the FXGLCanvas. > i get the sender, selector and data. > > how is the selector to be interpreted? According to the documentation here: http://www.fxruby.org/doc/api/classes/Fox/FXWindow.html the message data for a SEL_MOUSEWHEEL message is an FXEvent object. If you're getting a 'nil' value for the message data, you must be using a very old version of FXRuby (this bug was fixed in FXRuby version 1.0.19). At any rate, your handler for a SEL_MOUSEWHEEL message from the FXGLCanvas should look something like this: canvas = FXGLCanvas.new(...) canvas.connect(SEL_MOUSEWHEEL) { |sender, sel, evt| delta = evt.code/120 } The 'code' attribute of the FXEvent instance for SEL_MOUSEWHEEL messages should contain some integer value that is a multiple of 120. The code may be positive (for spinning "up") or negative (for spinning "down"). Hope this helps, Lyle |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-07-29 12:49:24
|
On Tue, 29 Jul 2003, Dalibor Sramek wrote: > Quoting Hugh Sasse Staff Elec Eng <hg...@dm...>: > > Can I install FXRuby 1.0.24 on top of the Pragmatic Programmers > I do it regulary without any problem. As FXRuby tends to be updated more > frequently than Ruby it is a good way to keep your Fox and FXRuby up to date. > When a newer version is available you can safely remove the older FXRuby using > standard Windows tools and then install the new version. OK, thanks. I'll give that a go later. > > > requires some access to X from Windows so I can see the widgets on > > Few years ago I used Labtam X Server at the university I don't know the price > but it was good. As the last resort - would VNC help you? I'd forgotten about VNC, I'll take another look at that. Thank you. > > Regards, > > Dalibor Sramek > Hugh |
From: Lyle J. <jl...@cf...> - 2003-07-29 12:46:20
|
Recheis Meinrad wrote: > where can i look up a list of all possible events a FXGLCanvas can produce? > the FXRuby doc is not very helpful with events. Well, the FXRuby API documentation for events is about as good as it's going to be. Each class lists all of the events that it might send to its message target, as well as the message data that's sent along with the event. And as Hugh Sasse has pointed out in a separate reply, it is /generally/ the case that a widget of some derived class (like FXGLCanvas) will also send the messages that its superclass sends. So for FXGLCanvas, you'd start at its documentation page: http://www.fxruby.org/doc/api/classes/Fox/FXGLCanvas.html Now, as it turns out, FXGLCanvas doesn't add anything, in terms of messages sent, to its superclass, so no events are listed here. But if you jump up to the documentation for its superclass: http://www.fxruby.org/doc/api/classes/Fox/FXCanvas.html you see that FXCanvas forwards the SEL_KEYPRESS, SEL_KEYRELEASE, SEL_MOTION and SEL_PAINT messages to its target. Jumping further up the inheritance chain to FXCanvas' superclass: http://www.fxruby.org/doc/api/classes/Fox/FXWindow.html Things really get interesting. Since FXWindow is the base class for all windows (widgets), most of the core functionality (and its documentation) starts here. Hope this helps, Lyle |
From: Lyle J. <ly...@kn...> - 2003-07-29 12:03:39
|
Hugh Sasse Staff Elec Eng wrote: > Can I install FXRuby 1.0.24 on top of the Pragmatic Programmers > Ruby-1.6.8 distribution (of 07-JAN-2003) that I have on the Winxp > machine? I fairly sure the answer is yes, but can't remember where > I saw this. Yes (see Dalibor's response). Follow the "Downloads" link from the FXRuby home page at http://www.fxruby.org. For anyone else reading this response, please note that I'll probably drop support for the 1.7.3 build of Ruby "real soon now", especially since Ruby 1.8.0 is about to become the new stable release. I will probably continue to support Ruby 1.6.8 for some time. |