fxruby-users Mailing List for FXRuby (Page 36)
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-06-10 04:53:07
|
Lyle Johnson wrote: > All, > > I've completed the first pass through the FXRuby API documentation, > which is posted here: > > http://www.fxruby.org/doc/api Is this more or less the same as the downloadable api-docs file on the sourceforge site? |
From: Joel V. <vj...@PA...> - 2003-06-10 04:50:25
|
Hugh Sasse Staff Elec Eng wrote: >>what facilities, if any, RDoc provides for a more general solution to >>the challenge of cross-referencing related ideas. You all probably know this, but rdoc will automatically link things like #method Class#method Class.class_method |
From: Lyle J. <ly...@kn...> - 2003-06-10 02:45:06
|
Hugh Sasse Staff Elec Eng wrote: > Good point. I have to explore [FreeRIDE's class browser]. Is it very tied to Scite, or > can I use it with Vim? No, I think it's pretty heavily tied into its integrated editor based on Scintilla (the same source code editing component used by SciTE). |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-06-10 00:24:04
|
On Mon, 9 Jun 2003, Lyle Johnson wrote: > Hugh Sasse Staff Elec Eng wrote: > > > true or false. Does this affect the return value for <a method>?.... > > OK, just made a note of this. But to answer the question, no, the return Thank you. > > > seems, from looking at the draw methods, that you don't draw on an > > FXCanvas, you draw on an FXDC. [cf "How do you get down from an > > elephant?"] The media independence is good, but for someone coming > > Your point is well taken. A lot of the more interesting information > about classes like FXDC is not their API in isolation, but rather how > they plug into the surrounding framework and interact with other classes Yes, that's better expressed than I put it. > (like FXCanvas). At the least, I should be able to link to other classes > and methods that RDoc knows about (i.e. a "see also" approach). Not sure Thanks. > what facilities, if any, RDoc provides for a more general solution to > the challenge of cross-referencing related ideas. I know it can have cross references, but I don't think it can genrate them. > > By the way, thanks for making me look up the answer to the riddle. I > will let others google for the answer as I did ;) ! I thought it had been around a while, so it would be well known. :-) > > > I find myself wondering if this flexibility should be exposed > > to every programmer, or whether a simpler wrapper might be useful > > for the neophyte or the writer of the quick, throwaway bit of code. > > Which flexibility are you talking about? Attaching a device context (DC) > to a canvas before you can draw into it? Yes, for that particular case. I'm not sure what others there are. > > > [...]creating FXRdoc, [...] > > Have you seen the class browser from FreeRIDE? It doesn't work exactly Good point. I have to explore that. Is it very tied to Scite, or can I use it with Vim? > > Thank you Hugh |
From: Lyle J. <jl...@cf...> - 2003-06-09 19:44:34
|
Hugh Sasse Staff Elec Eng wrote: > Yes, this is really nice. Concise and informative. Also it may > help to add information about what happens when block_given?() is > true or false. Does this affect the return value for <a method>?.... OK, just made a note of this. But to answer the question, no, the return value of FXClass.new is always a reference to the new instance, and is not affected by the presence or absence of a block. > Links to examples that are shipped with FXRuby might be good. You > have a few that rely on the FXCanvas for example, but I found > reading the code too confusing to learn from, and the API > documentation is rather obscure about how to draw on a canvas. It > seems, from looking at the draw methods, that you don't draw on an > FXCanvas, you draw on an FXDC. [cf "How do you get down from an > elephant?"] The media independence is good, but for someone coming > from Tk this is odd :-) So how to connect this related semantic > information? Maybe have a "See also:" item at the end? "Keywords"? > "CategoryCategories" as per Wiki? Interesting problem.... Your point is well taken. A lot of the more interesting information about classes like FXDC is not their API in isolation, but rather how they plug into the surrounding framework and interact with other classes (like FXCanvas). At the least, I should be able to link to other classes and methods that RDoc knows about (i.e. a "see also" approach). Not sure what facilities, if any, RDoc provides for a more general solution to the challenge of cross-referencing related ideas. By the way, thanks for making me look up the answer to the riddle. I will let others google for the answer as I did ;) > I find myself wondering if this flexibility should be exposed > to every programmer, or whether a simpler wrapper might be useful > for the neophyte or the writer of the quick, throwaway bit of code. Which flexibility are you talking about? Attaching a device context (DC) to a canvas before you can draw into it? > Drifting off topic a bit: Thinking about the different ways people > look at code, and changing viewpoint dynamically, I wondered about > the difficulties of creating FXRdoc, a graphical explorer of code > which allows one to see trees of classes, expose all the constants a > class inherits at once, or just its own, toggle showing of method > code, ..... Have you seen the class browser from FreeRIDE? It doesn't work exactly as you described, but it's a pretty nifty tool for working with Ruby code. It could perhaps be extended to do some of the kinds of the things you're describing. |
From: Jacobs, D. <Dee...@Dy...> - 2003-06-09 18:41:18
|
Thanks again, Lyle. This is helpful. Generic examples, like your foo example are extremely helpful. I guess most of my questions will be of the specifics as in the mirror item. I know you will do a fine job. Dee A. Jacobs -----Original Message----- From: Lyle Johnson [mailto:jl...@cf...] Sent: Monday, June 09, 2003 1:37 PM To: fxr...@li... Subject: Re: [Fxruby-users] [ANN] Updated API Documentation Jacobs, Dee wrote: > This is the sort of changes I asked you about back in May. > This is very helpful for newbies to the GUI. Great! > I still see trouble in my understanding of some of the interfaces. > An example below from FXImage - Public functions. > > mirror(horizontal, vertical) > > Mirror image horizontally and/or vertically > > Does this indicate need for values here for each or is > it a choice of options? What are the expected values? This indicates a need for both values. If a method has some optional argument(s), its declaration will look something like this: foo(x, y, z=1) where the "z=1" notation means that the third argument to the "foo" method is optional and, if not specified, assumes a default value of 1. For your specific question: the FXImage#mirror method takes two arguments of boolean type (i.e. true or false). Neither has a default value, so you must specify both of them. If the first argument (horizontal) is true, the image will be mirrored from left-to-right. If the second argument (vertical) is true, the image will be mirrored from top-to-bottom. If both are true it's flipped in both directions. > Please check other places for ambiguities. I will do my best, but things which are ambiguous to you (or others) are not necessarily ambiguous to me. It's going to be a very iterative process, but I hope that you and others will help me to improve the docs as we go along. Thanks, Lyle ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Fxruby-users mailing list Fxr...@li... https://lists.sourceforge.net/lists/listinfo/fxruby-users |
From: Lyle J. <jl...@cf...> - 2003-06-09 17:28:10
|
Jacobs, Dee wrote: > This is the sort of changes I asked you about back in May. > This is very helpful for newbies to the GUI. Great! > I still see trouble in my understanding of some of the interfaces. > An example below from FXImage - Public functions. > > mirror(horizontal, vertical) > > Mirror image horizontally and/or vertically > > Does this indicate need for values here for each or is > it a choice of options? What are the expected values? This indicates a need for both values. If a method has some optional argument(s), its declaration will look something like this: foo(x, y, z=1) where the "z=1" notation means that the third argument to the "foo" method is optional and, if not specified, assumes a default value of 1. For your specific question: the FXImage#mirror method takes two arguments of boolean type (i.e. true or false). Neither has a default value, so you must specify both of them. If the first argument (horizontal) is true, the image will be mirrored from left-to-right. If the second argument (vertical) is true, the image will be mirrored from top-to-bottom. If both are true it's flipped in both directions. > Please check other places for ambiguities. I will do my best, but things which are ambiguous to you (or others) are not necessarily ambiguous to me. It's going to be a very iterative process, but I hope that you and others will help me to improve the docs as we go along. Thanks, Lyle |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-06-09 17:26:39
|
On Mon, 9 Jun 2003, Lyle Johnson wrote: > All, > > I've completed the first pass through the FXRuby API documentation, > which is posted here: > > http://www.fxruby.org/doc/api > Thank you for this work.... > More can and should be done. On the "second pass", I want to do a better > job of documenting the types of the method arguments. For example, take > a look at the documentation for FX4Splitter's initialize method: > > http://www.fxruby.org/doc/api/classes/Fox/FX4Splitter.html > > Here, the individual method arguments and their types are listed in a > sort of table, similar to the format used for JavaDoc. I'd like to use > this approach throughout the documentation. Yes, this is really nice. Concise and informative. Also it may help to add information about what happens when block_given?() is true or false. Does this affect the return value for <a method>?.... > > Another goal is to add short code examples, where appropriate. I'm > trying to decide what is the right balance between reference > documentation -- which is the intent -- and the more expositional style Links to examples that are shipped with FXRuby might be good. You have a few that rely on the FXCanvas for example, but I found reading the code too confusing to learn from, and the API documentation is rather obscure about how to draw on a canvas. It seems, from looking at the draw methods, that you don't draw on an FXCanvas, you draw on an FXDC. [cf "How do you get down from an elephant?"] The media independence is good, but for someone coming from Tk this is odd :-) So how to connect this related semantic information? Maybe have a "See also:" item at the end? "Keywords"? "CategoryCategories" as per Wiki? Interesting problem.... I find myself wondering if this flexibility should be exposed to every programmer, or whether a simpler wrapper might be useful for the neophyte or the writer of the quick, throwaway bit of code. > that you will see in the FXRuby book, due out in approximately the year > 2020 ;) > > Anyways, hope this is useful and please give me some feedback about what > other kinds of information we can show here. Drifting off topic a bit: Thinking about the different ways people look at code, and changing viewpoint dynamically, I wondered about the difficulties of creating FXRdoc, a graphical explorer of code which allows one to see trees of classes, expose all the constants a class inherits at once, or just its own, toggle showing of method code, ..... > > Thanks, > > Lyle > Hugh |
From: Jacobs, D. <Dee...@Dy...> - 2003-06-09 16:24:36
|
Thanks Lyle, This is the sort of changes I asked you about back in May. This is very helpful for newbies to the GUI. I still see trouble in my understanding of some of the interfaces. An example below from FXImage - Public functions. mirror(horizontal, vertical) Mirror image horizontally and/or vertically Does this indicate need for values here for each or is it a choice of options? What are the expected values? Please check other places for abiguities. I very much appreciate your help to us who are new to API interfaces. Can't get along without them. Dee A. Jacobs -----Original Message----- From: Lyle Johnson [mailto:jl...@cf...] Sent: Monday, June 09, 2003 12:12 PM To: fxr...@li... Subject: [Fxruby-users] [ANN] Updated API Documentation All, I've completed the first pass through the FXRuby API documentation, which is posted here: http://www.fxruby.org/doc/api By first pass, I simply mean that I think all of the classes and their methods and attributes are at least *listed* here. IMO this is now a much better choice than reading the C++ API documentation and trying to "translate" that from C++ to Ruby. For example, all of the messages that various widgets can send to their targets are documented. More can and should be done. On the "second pass", I want to do a better job of documenting the types of the method arguments. For example, take a look at the documentation for FX4Splitter's initialize method: http://www.fxruby.org/doc/api/classes/Fox/FX4Splitter.html Here, the individual method arguments and their types are listed in a sort of table, similar to the format used for JavaDoc. I'd like to use this approach throughout the documentation. Another goal is to add short code examples, where appropriate. I'm trying to decide what is the right balance between reference documentation -- which is the intent -- and the more expositional style that you will see in the FXRuby book, due out in approximately the year 2020 ;) Anyways, hope this is useful and please give me some feedback about what other kinds of information we can show here. Thanks, Lyle ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Fxruby-users mailing list Fxr...@li... https://lists.sourceforge.net/lists/listinfo/fxruby-users |
From: Lyle J. <jl...@cf...> - 2003-06-09 16:03:37
|
All, I've completed the first pass through the FXRuby API documentation, which is posted here: http://www.fxruby.org/doc/api By first pass, I simply mean that I think all of the classes and their methods and attributes are at least *listed* here. IMO this is now a much better choice than reading the C++ API documentation and trying to "translate" that from C++ to Ruby. For example, all of the messages that various widgets can send to their targets are documented. More can and should be done. On the "second pass", I want to do a better job of documenting the types of the method arguments. For example, take a look at the documentation for FX4Splitter's initialize method: http://www.fxruby.org/doc/api/classes/Fox/FX4Splitter.html Here, the individual method arguments and their types are listed in a sort of table, similar to the format used for JavaDoc. I'd like to use this approach throughout the documentation. Another goal is to add short code examples, where appropriate. I'm trying to decide what is the right balance between reference documentation -- which is the intent -- and the more expositional style that you will see in the FXRuby book, due out in approximately the year 2020 ;) Anyways, hope this is useful and please give me some feedback about what other kinds of information we can show here. Thanks, Lyle |
From: Joel V. <vj...@PA...> - 2003-06-09 04:06:58
|
This is resolved, thanks to Jeroen's reminder to make the context current. I will post a link to some sample code to read .bmp files and use them as textures, if there is any interest. |
From: Joel V. <vj...@PA...> - 2003-06-08 16:09:51
|
Lyle Johnson wrote: > Joel VanderWerf wrote: > >> I ran into this problem too, and never understood it. So I always >> append other shapes (such as a very narrow rectangle, instead of a line). > > > Sounds like a bug to me, Peter and Joel. > > I can't check it out right this minute, but I think I see the problem. I > don't think we ever call the base class version of initialize for > FXGLLine. See what happens if you modify lib/fox/glshapes.rb and add > this as the first line of FXGLLine's initialize method: > > super() > > At any rate, I've added this to the bug list and will investigate for > myself as soon as possible. That almost does it. You also need to define #bounds like this: def bounds FXRange.new([@fm.pos[0], @to.pos[0]].min, [@fm.pos[0], @to.pos[0]].max, [@fm.pos[1], @to.pos[1]].min, [@fm.pos[1], @to.pos[1]].max, [@fm.pos[2], @to.pos[2]].min, [@fm.pos[2], @to.pos[2]].max) end |
From: Lyle J. <ly...@kn...> - 2003-06-08 14:28:50
|
Joel VanderWerf wrote: > I ran into this problem too, and never understood it. So I always append > other shapes (such as a very narrow rectangle, instead of a line). Sounds like a bug to me, Peter and Joel. I can't check it out right this minute, but I think I see the problem. I don't think we ever call the base class version of initialize for FXGLLine. See what happens if you modify lib/fox/glshapes.rb and add this as the first line of FXGLLine's initialize method: super() At any rate, I've added this to the bug list and will investigate for myself as soon as possible. Thanks for the bug report, Lyle |
From: Joel V. <vj...@PA...> - 2003-06-08 06:14:43
|
Hi. Does anyone have any experience using textures in Fox or FXRuby? I've played around with the texbind.rb example in the opengl distribution, and that works fine, but it's not Fox. Now I'm trying to load the BMP file using FXBMPImage, and then use the GL calls as in texbind.rb to attach the texture to my object (a square). However, the very first GL call after initializing the FXBMPImage segfaults. I never even get to the point of actually handing over the image data to any GL routine. I've got a slightly modifed version of the glviewer.rb example that shows what I'm trying to do: http://PATH.Berkeley.EDU/~vjoel/ruby/bug.rb (27k) http://PATH.Berkeley.EDU/~vjoel/ruby/roadway_surface1.bmp (272k) Put these in your FXRuby/examples dir to run them. |
From: Joel V. <vj...@PA...> - 2003-06-08 05:21:49
|
Peter J. Puchyr wrote: > Hi, > > I'm just trying to learn how to use OpenGL in FXRuby. I tried > to add the drawing of a line to the glviewer example, using a > statement completely analogous to the other objects in the scene, > namely, > > gp2.append(FXGLLine.new(-1.0,-1.0,-1.0, 1.0,1.0,1.0)) > > placed after the FXGLCylinder statement, and this produces the > error message: > > in `append': This FXGLObject * already released (RuntimeError). > > It makes no difference if I create and name the object in a separate > statement, and then append it to the group of FXGLObjects; the error > still occurs with exactly the same message. > > Have I done something completely stupid, or is this a bug? > > Peter > I ran into this problem too, and never understood it. So I always append other shapes (such as a very narrow rectangle, instead of a line). Joel |
From: Peter J. P. <PJP...@Sp...> - 2003-06-08 04:47:48
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <font><tt><font color="#000000"><tt> <pre>Hi, I'm just trying to learn how to use OpenGL in FXRuby. I tried to add the drawing of a line to the glviewer example, using a statement completely analogous to the other objects in the scene, namely, gp2.append(FXGLLine.new(-1.0,-1.0,-1.0, 1.0,1.0,1.0)) placed after the FXGLCylinder statement, and this produces the error message: in `append': This FXGLObject * already released (RuntimeError). It makes no difference if I create and name the object in a separate statement, and then append it to the group of FXGLObjects; the error still occurs with exactly the same message. Have I done something completely stupid, or is this a bug? Peter</pre> </tt></font></tt></font> <pre class="moz-signature" cols="120">-- ************************************************* Peter J. Puchyr, M.Sc., P.Eng. SpaceTime Simulation Corp. #302, 112 - 34 Street N.W. Calgary, Alberta Canada T2N 2X5 (403) 270-0489 </pre> </body> </html> |
From: Peter J. P. <PJP...@UC...> - 2003-06-08 04:20:41
|
Hi, I'm just trying to learn how to use OpenGL in FXRuby. I tried to add the drawing of a line to the glviewer example, using a statement completely analogous to the other objects in the scene, namely, gp2.append(FXGLLine.new(-1.0,-1.0,-1.0, 1.0,1.0,1.0)) placed after the FXGLCylinder statement, and this produces the error message: in `append': This FXGLObject * already released (RuntimeError). It makes no difference if I create and name the object in a separate statement, and then append it to the group of FXGLObjects; the error still occurs with exactly the same message. Have I done something completely stupid, or is this a bug? Peter -- ************************************************************** Peter J. Puchyr, M. Sc., P. Eng. University of Calgary Dept. of Chemical & Petroleum Engineering 2500 University Drive NW Calgary, Alberta T2N 1N4 (403) 210-9772 |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-06-05 16:27:11
|
On Thu, 5 Jun 2003, ly...@kn... wrote: > > On Thu, 5 Jun 2003 16:20:45 +0100 (BST), Hugh Sasse Staff Elec Eng > <hg...@dm...> wrote : > > > Could one apply the Mediator Pattern to this, and provide direct links > > to where people need to go, rather than telling them to poke around > > such and such websites? I think that would be useful provided we [...] > > I'm not sure I follow what you mean by applying the Mediator pattern. Do you > mean that our FXRuby FAQ might duplicate some of the questions found in > other FAQ lists, but the answers to those questions would be hyperlinked to > the other FAQ lists' answers? Yes. By saying "mediator pattern" I mean to take the concept of linking directly to the disparate information sources in such a way that it is effortless for the user of the FAQ (mediator) to access them. This amy be an analogy too far, || I may have misunderstood the mediator pattern :-). There could be a little supporting text at our end, in the spirit of "Least Surprise". > > > http://www.fxruby.org/doc/api > > > > Yes, that's a nice job, coming along well. Thanks. Can this be > > downloaded as a tgz, or zip file for browsing off-line please? > > Yes, I actually just uploaded a snapshot of those pages to the SourceForge > site the other day: > > http://sourceforge.net/project/showfiles.php?group_id=20243 Right. I think I have enough links for my FXRuby stuff to become a new page. Thanks > > > When I tried to run Rdoc on the FXRuby I'd downloaded I didn't get > > so much documentation embedded. If your using different/newer [...] > There are some instructions here about how to check out the CVS sources > (anonymously, with read-only access): [...] Great. I'll try this out. Thanks > Hugh |
From: <ly...@kn...> - 2003-06-05 16:25:51
|
On Thu, 5 Jun 2003 16:20:45 +0100 (BST), Hugh Sasse Staff Elec Eng <hg...@dm...> wrote : > Could one apply the Mediator Pattern to this, and provide direct links > to where people need to go, rather than telling them to poke around > such and such websites? I think that would be useful provided we > can frame the questions so they are not brittle WRT version changes > in FOX. I think there may well be FXRubyists who never program FOX > directly w/o ruby, so this would seem to be sensible from this > viewpoint. I'm not sure I follow what you mean by applying the Mediator pattern. Do you mean that our FXRuby FAQ might duplicate some of the questions found in other FAQ lists, but the answers to those questions would be hyperlinked to the other FAQ lists' answers? > > > > Also, your first stop for reference documentation on the Ruby API should be > > the docs found here: > > > > http://www.fxruby.org/doc/api > > Yes, that's a nice job, coming along well. Thanks. Can this be > downloaded as a tgz, or zip file for browsing off-line please? Yes, I actually just uploaded a snapshot of those pages to the SourceForge site the other day: http://sourceforge.net/project/showfiles.php?group_id=20243 > When I tried to run Rdoc on the FXRuby I'd downloaded I didn't get > so much documentation embedded. If your using different/newer > sources it would be nice to get hold of those so I can send you > patches when I feel able to contribute. There are some instructions here about how to check out the CVS sources (anonymously, with read-only access): http://www.fxruby.org/doc/cvs.html Those should have the very latest sources that I'm using (under the rdoc-sources subdirectory). |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-06-05 15:42:31
|
On Thu, 5 Jun 2003, ly...@kn... wrote: > Yes. The list was only created the day before yesterday ;) Oh! Thanks. > [...] Thanks for the Faq links. > but you are correct that we don't have a FAQ list dedicated specifically to > FXRuby. I guess part of the challenge will be figuring out which questions > are FXRuby-specific and which questions are more in the domain of FOX Yes, but then metaquestions can go in as well, "where should I look for questions about ..." > programming in general. For example, the FAQ about calling create() on > windows, icons, etc. after the application's already running is a problem > that any FOX programmer will confront at some point, whether he's using > FXRuby, FXPy, EiffelFOX or, worst case, C++ ;) Could one apply the Mediator Pattern to this, and provide direct links to where people need to go, rather than telling them to poke around such and such websites? I think that would be useful provided we can frame the questions so they are not brittle WRT version changes in FOX. I think there may well be FXRubyists who never program FOX directly w/o ruby, so this would seem to be sensible from this viewpoint. > > > And onto FXRuby itself: Most of the API calls wrap C++ pretty [...] > > FXinteger, or does one have to create the objects explicitly? I > > don't think I'd be able to infer this from looking at C++ docs. > > Yes, for the most part it should be a very obvious mapping from C++ to Ruby. > If the C++ function expects a signed or unsigned integer type (i.e. FXshort, > FXushort, FXint or FXuint) the Ruby method probably expects an Integer. If Thank you. I think this is something worth adding to a FAQ, since it is implementation dependent (you *could* have chosen to make FXushort construction explicit; I'm glad you didn't). [...] > well, such as how arrays of values are passed back and forth. For a good > summary of the kinds of differences to expect, see this chapter from the > FXRuby documentation: > > http://www.fxruby.org/doc/differences.html Thanks, hadn't found that. > > Also, your first stop for reference documentation on the Ruby API should be > the docs found here: > > http://www.fxruby.org/doc/api Yes, that's a nice job, coming along well. Thanks. Can this be downloaded as a tgz, or zip file for browsing off-line please? When I tried to run Rdoc on the FXRuby I'd downloaded I didn't get so much documentation embedded. If your using different/newer sources it would be nice to get hold of those so I can send you patches when I feel able to contribute. [I'd actually rather not have write access to cvs, because I'm not confident about using it, and would hate to trash your CVS tree!] > > The problem is that those are still under construction (although I'm getting > closer!). Use the C++ library's reference documentation as a fallback. > > Hope this helps, > > Lyle > Thank you. Hugh |
From: <ly...@kn...> - 2003-06-05 14:47:27
|
On Thu, 5 Jun 2003 11:06:00 +0100 (BST), Hugh Sasse Staff Elec Eng <hg...@dm...> wrote : > My questions that I have now are: > > The archive for the list seems to have only 2 messages in it. Is > that correct? Yes. The list was only created the day before yesterday ;) > There seems to be no FAQ for the list, and no FXRuby FAQ on the > fxruby site. Since I'm trying to learn this stuff I'm happy to > create one. Most of the FAQ tools I've heard of seem to be > perlisms, so the obvious question is: What ruby ones exist? There is a general FOX FAQ at the FOX web site: http://www.fox-toolkit.org/faq.html as well as the FAQ at the FOX Community Wiki: http://www.fifthplanet.net/cgi-bin/wiki.pl?FAQ but you are correct that we don't have a FAQ list dedicated specifically to FXRuby. I guess part of the challenge will be figuring out which questions are FXRuby-specific and which questions are more in the domain of FOX programming in general. For example, the FAQ about calling create() on windows, icons, etc. after the application's already running is a problem that any FOX programmer will confront at some point, whether he's using FXRuby, FXPy, EiffelFOX or, worst case, C++ ;) > And onto FXRuby itself: Most of the API calls wrap C++ pretty > closely, so that they are often FXThingy.method(*args). I can > explore (and will do) the FOX docs some more, but are there mappings > within the ruby so that Ruby "types" like integer get converted to > FXinteger, or does one have to create the objects explicitly? I > don't think I'd be able to infer this from looking at C++ docs. Yes, for the most part it should be a very obvious mapping from C++ to Ruby. If the C++ function expects a signed or unsigned integer type (i.e. FXshort, FXushort, FXint or FXuint) the Ruby method probably expects an Integer. If the C++ function expects a floating point type, you should be able to pass in *any* Ruby number. If the C++ function expects an FXString, you should be able to pass in a Ruby String. Of course, there are some differences as well, such as how arrays of values are passed back and forth. For a good summary of the kinds of differences to expect, see this chapter from the FXRuby documentation: http://www.fxruby.org/doc/differences.html Also, your first stop for reference documentation on the Ruby API should be the docs found here: http://www.fxruby.org/doc/api The problem is that those are still under construction (although I'm getting closer!). Use the C++ library's reference documentation as a fallback. Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2003-06-05 14:43:50
|
brett wrote: > You are correct , I missed the install phase !! because it was not in the > install instructions ?? -- It depends upon which version you read. > The text file "install" misses the "ruby install.rb install" command. Oops, you're right. I just updated the INSTALL file to include this last step. > So I unzipped all the files again and ran the following commands > as user BRETT --should I be ROOT ? You should be able to do the 'config' and 'setup' steps as any user, but you will usually need to be logged in as root to do the 'install' step. > In any case it did not work -- again. > > By the way just what files, and where should they be?, are Ruby actually > looking for with the > > require 'fox' command ?? When you do: require 'fox' from Ruby, it is looking for the Ruby extension module named "fox.so". On your system, I'm pretty sure that would get installed as: /usr/lib/ruby/site_ruby/1.6/i686-linux/fox.so Some *.rb files should also get installed under this directory: /usr/lib/ruby/site_ruby/1.6/fox > > ===================== > Konsole output below. > <... snip output from config, setup and install phases ...> OK, this doesn't look right at all. I don't see any indication during the 'setup' phase that it's actually *doing* anything. This should be the longest part of the process, where it's compiling the C++ extension code. That also seems to be confirmed during the 'install' phase, since it installs all of the "pure Ruby" parts of FXRuby but it never installs the extension module part (fox.so). I think the best thing to do is to start over from scratch with FXRuby: 1. Completely wipe out the FXRuby-1.0.21 directory under your user account that you used to build the code. Leave no traces ;) 2. Also wipe out whatever might have been installed to /usr/lib/ruby/site_ruby/1.6/fox, and the fox.so file if it did actually get installed. Might be good to do a 'find' to see if it's hiding down there under /usr/lib/ruby/site_ruby somewhere. 3. Start over. Unpack FXRuby-1.0.x.tar.gz under your user account, then follow the instructions to configure, setup and install the software. The 'config' step should take a few seconds to complete. The 'setup' step should take much longer, depending on fast your system is (count on 10-15 minutes I would guess). The 'install' step should only take a few seconds. Hope this helps, Lyle P.S. I am Cc'ing this reply to the newly-formed fxruby-users mailing list. It might be useful to you to subscribe to that list, as others may be able to advise you as well on these kinds of problems. For more information, see http://lists.sourceforge.net/lists/listinfo/fxruby-users. |
From: Hugh S. S. E. E. <hg...@dm...> - 2003-06-05 10:16:57
|
I have just joined this list, and have a number of rather general questions, but I hope to be able to contribute useful info myself soon. What I'm interested in doing is writing a GUI builder for FXRuby which will do most of the management of the new(), create() and other initialisation calls, so that code gets written in the right order for things to work. But this is a way down the road yet, as I need to understand more to be able to write this correcly. My questions that I have now are: The archive for the list seems to have only 2 messages in it. Is that correct? There seems to be no FAQ for the list, and no FXRuby FAQ on the fxruby site. Since I'm trying to learn this stuff I'm happy to create one. Most of the FAQ tools I've heard of seem to be perlisms, so the obvious question is: What ruby ones exist? And onto FXRuby itself: Most of the API calls wrap C++ pretty closely, so that they are often FXThingy.method(*args). I can explore (and will do) the FOX docs some more, but are there mappings within the ruby so that Ruby "types" like integer get converted to FXinteger, or does one have to create the objects explicitly? I don't think I'd be able to infer this from looking at C++ docs. Thank you, Hugh |
From: Lyle J. <ly...@us...> - 2003-06-03 13:34:28
|
John Reed wrote: > I'm trying to test if a combo box field in FXRuby has changed, to warn > the user if they hit the Cancel button without saving their changes. > Here's the code: > > def cancelentry(sender, sel, ptr) > > @@stacbo.connect(SEL_CHANGED) do > if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, > "Cancel Update", "Changes made, cancel update?") > handle(nil, MKUINT(ID_CANCEL, SEL_COMMAND), nil) > return 1 > end > end > > end > > The problem is that the code never displays the message box. What is > the proper way to code for a SEL_CHANGED event? The combo box sends a SEL_CHANGED message to its message target immediately after the change takes place. For what you're trying to accomplish, I think you just want to save the original state of the combo box when the dialog box is first initialized: def setup(originalValue) @originalValue = originalValue @stackbo = FXComboBox.new(...) @stackbo.setText(originalValue) end and then compare the combo box's current state to this value when they click Cancel: def cancelentry(sender, sel, ptr) if @stackbo.getText() != @originalValue if MBOX_CLICKED_NO == FXMessageBox.question(...) handle(nil, MKUINT(ID_CANCEL, SEL_COMMAND), nil) return 1 end end end You could, alternately, catch the SEL_CHANGED message and set some state variable: def setup(originalValue) @theValueChanged = false @stackbo = FXComboBox.new(...) @stackbo.connect(SEL_CHANGED) { @theValueChanged = true } end def cancelentry(sender, sel, ptr) if @theValueChanged if MBOX_CLICKED_NO == FXMessageBox.question(...) handle(nil, MKUINT(ID_CANCEL, SEL_COMMAND), nil) return 1 end end end The problem with this approach (IMO) is that if they change the combo box's value from its original value to some new value, then change it *back* again before clicking Cancel, it will still show up as a "change". So for this kind of situation I prefer to just clone the original data the dialog box or form was initialized with, and then compare it against the form's current values at the end to decide if it's really been changed. Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2003-06-02 19:08:12
|
Can you hear me now? |