From stuart_clarke86 at yahoo.com Mon Dec 1 08:00:48 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Mon, 1 Dec 2008 13:00:48 +0000 (GMT) Subject: [fxruby-users] Styled text on arrays Message-ID: <846888.26085.qm@web86611.mail.ird.yahoo.com> I have a few questions with FX colors for styling text. I have a GUI with a FXText frame which upon running my programs is populated with the contents of an array in a separate method using the @evtrievefindings.join("\n"). This array is populated in a method with quite a lot of information throughout the running of the program eg. if 100 @evtrievefindings.push "info" end if 200 @evtrievefindings.push "different info" end I was wondering can I use styled text to assign one occurance of @evtrievefindings.push as being in the colour red, eg. if 100 @evtrievefindings.push "info" end if 200 @evtrievefindings.push.changestyle "different info" end Does this make sense? Basically I want my program to write the contents of the array to the text frame as normal but when data meets one criteria I want the data written to the array to be a colour. I know you can use FX to colour specified text, however I do not know what the text is. Thanks in adavnce. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Mon Dec 1 11:16:04 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 1 Dec 2008 10:16:04 -0600 Subject: [fxruby-users] Styled text on arrays In-Reply-To: <846888.26085.qm@web86611.mail.ird.yahoo.com> References: <846888.26085.qm@web86611.mail.ird.yahoo.com> Message-ID: <1B2D900B-6E77-44C1-A1CB-F5E8A2B0562A@lylejohnson.name> On Dec 1, 2008, at 7:00 AM, Stuart Clarke wrote: > I was wondering can I use styled text to assign one occurance of > @evtrievefindings.push as being in the colour red, eg. > > if 100 > @evtrievefindings.push "info" > end > if 200 > @evtrievefindings.push.changestyle "different info" > end > > Does this make sense? Basically I want my program to write the > contents of the array to the text frame as normal but when data > meets one criteria I want the data written to the array to be a > colour. If what you're asking is whether you can embed some sort of markup in the text itself to change the text style (e.g. as you do with HTML), and the answer to that question is no. What you might want to investigate is appending text to the FXText window incrementally (instead of setting the content in one fell swoop), e.g. @evtrievefindings.each do |finding| text_widget.appendText(finding + "\n") end And then once you've got that working, switch over to using styled text. You would still need to keep some sort of indicator in the @etrievefindings array (or a parallel array), but you could at least know which style to apply: @etrievefindings.each do |finding| if condition1 text_widget.appendStyledText(finding + "\n", style1) else text_widget.appendStyledText(finding + "\n", style2) end end Hope this helps, Lyle -------------- next part -------------- An HTML attachment was scrubbed... URL: From linuxnooby at yahoo.com.au Tue Dec 2 00:32:14 2008 From: linuxnooby at yahoo.com.au (dave newby) Date: Mon, 1 Dec 2008 21:32:14 -0800 (PST) Subject: [fxruby-users] full screen? Message-ID: <96791.90785.qm@web58605.mail.re3.yahoo.com> Hi? I have developed a Kiosk application in Visual Basic but I would like to rewrite using another language. I am interested in using fxruby. 2 questions. 1) Can a window be made in full screen mode? 2) Can a window be always on top? Thanks Dave Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Tue Dec 2 11:56:33 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Tue, 2 Dec 2008 16:56:33 +0000 (GMT) Subject: [fxruby-users] Styled text on arrays In-Reply-To: <1B2D900B-6E77-44C1-A1CB-F5E8A2B0562A@lylejohnson.name> Message-ID: <83068.64636.qm@web86611.mail.ird.yahoo.com> Oh that is a shame, it would be useful if somone could figure that out. Thanks for your suggestion though I will give it a go. ? Many thanks --- On Mon, 1/12/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] Styled text on arrays To: fxruby-users at rubyforge.org Date: Monday, 1 December, 2008, 4:16 PM On Dec 1, 2008, at 7:00 AM, Stuart Clarke wrote: I was wondering can I use styled text to assign one occurance of @evtrievefindings.push as being in the colour red, eg. if 100 @evtrievefindings.push "info" end if 200 @evtrievefindings.push.changestyle "different info" end Does this make sense? Basically I want my program to write the contents of the array to the text frame as normal but when data meets one criteria I want the data written to the array to be a colour. If what you're asking is whether you can embed some sort of markup in the text itself to change the text style (e.g. as you do with HTML), and the answer to that question is no. What you might want to investigate is appending text to the FXText window incrementally (instead of setting the content in one fell swoop), e.g. @evtrievefindings.each do |finding| text_widget.appendText(finding + "\n") end And then once you've got that working, switch over to using styled text. You would still need to keep some sort of indicator in the @etrievefindings array (or a parallel array), but you could at least know which style to apply: @etrievefindings.each do |finding| if condition1 text_widget.appendStyledText(finding + "\n", style1) else text_widget.appendStyledText(finding + "\n", style2) end end Hope this helps, Lyle_______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas_s at hotmail.com Wed Dec 3 20:50:47 2008 From: andreas_s at hotmail.com (Andreas S) Date: Thu, 4 Dec 2008 01:50:47 +0000 Subject: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class Message-ID: Hi, I'm writing a custom SplashScreen because I can't convey loading status with FXSplashWindow. While FXSplashScreen does that, it has that OK button to close it. I want it to close by itself when my process is done. The following code works fine, but when it is wrapped in a class, I get segmentation fault. Did I make a mistake in the start up sequence? But the fact that it doesn't seg-fault when it is outside of a class, makes it looks like a bug to me. Any idea how to work around it? -andre require 'fox16' include Fox class Splash < FXDialogBox def action Thread.new do yield handle nil, FXSEL(SEL_COMMAND,ID_ACCEPT), nil end end end #class App # uncomment this to see segmentation fault # def self.start app = FXApp.new('a', 'b') splash = Splash.new app, 'splash', :width => 300, :height => 200 splash.action do sleep 1 # Simulating data loading end app.create splash.show PLACEMENT_SCREEN puts "RUN" app.runModalWhileShown splash puts "Begin real" win = FXMainWindow.new app, 'joe', :width => 500, :height => 400 win.show PLACEMENT_SCREEN win.create puts "App run" app.run # end #end #App.start _________________________________________________________________ Suspicious message? There?s an alert for that. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Dec 4 15:27:44 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 4 Dec 2008 14:27:44 -0600 Subject: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class In-Reply-To: References: Message-ID: On Dec 3, 2008, at 7:50 PM, Andreas S wrote: > I'm writing a custom SplashScreen because I can't convey loading > status with FXSplashWindow. While FXSplashScreen does that, it has > that OK button to close it. I want it to close by itself when my > process is done. > > The following code works fine, but when it is wrapped in a class, I > get segmentation fault. Did I make a mistake in the start up > sequence? But the fact that it doesn't seg-fault when it is outside > of a class, makes it looks like a bug to me. > > Any idea how to work around it? Your code runs fine for me (i.e. without crashing) when I uncomment the lines that "wrap" the main code with the App class. I wonder if it's just a timing thing; what happens if you make it sleep a couple of seconds (sleep 2 or more) instead of just one? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Dec 4 15:34:24 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 4 Dec 2008 14:34:24 -0600 Subject: [fxruby-users] full screen? In-Reply-To: <96791.90785.qm@web58605.mail.re3.yahoo.com> References: <96791.90785.qm@web58605.mail.re3.yahoo.com> Message-ID: <1B91967C-2D38-404E-AB3D-9AB6AABCC88C@lylejohnson.name> On Dec 1, 2008, at 11:32 PM, dave newby wrote: > I have developed a Kiosk application in Visual Basic but I would > like to rewrite using another language. I am interested in using > fxruby. 2 questions. > > 1) Can a window be made in full screen mode? > 2) Can a window be always on top? I believe that FOX 1.8 will provide these features, but FOX 1.6 (on which the current release of FXRuby is based) doesn't have those features. So unfortunately the answer is "not yet". -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas_s at hotmail.com Thu Dec 4 16:48:40 2008 From: andreas_s at hotmail.com (Andreas S) Date: Thu, 4 Dec 2008 21:48:40 +0000 Subject: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class In-Reply-To: References: Message-ID: Hi Lyle, Thanks for looking at this. I forgot to mention that I was using ruby 1.8.7-p72 (also tried 1.8.7-p22). Since you didn't have the problem, I re-installed 1.8.6+p114 and tried again. Everything went smoothly. I can only conclude the problem is with ruby 1.8.7. Did you try it with 1.8.6? I'm jumping ahead here, but suppose that is the case, then herewith I'm reporting fxruby seg-faulting with ruby 1.8.7. I'm not sure how important this case is for you to spend time on it. For now I can go back and use 1.8.6 to avoid this problem. Thanks again, Lyle -andre _________________________________________________________________ Suspicious message? There?s an alert for that. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Dec 4 19:36:56 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 4 Dec 2008 18:36:56 -0600 Subject: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class In-Reply-To: References: Message-ID: <1C38EAF0-7B0D-4F76-A01D-10A98233CA52@lylejohnson.name> Actually, I was running it with Ruby 1.9.1. I will try again tomorrow with 1.8.7, but I'd recommend sticking with 1.8.6. Hope this helps, Lyle On Dec 4, 2008, at 3:48 PM, Andreas S wrote: > Hi Lyle, > > Thanks for looking at this. I forgot to mention that I was using > ruby 1.8.7-p72 (also tried 1.8.7-p22). Since you didn't have the > problem, I re-installed 1.8.6+p114 and tried again. Everything went > smoothly. I can only conclude the problem is with ruby 1.8.7. Did > you try it with 1.8.6? > > I'm jumping ahead here, but suppose that is the case, then herewith > I'm reporting fxruby seg-faulting with ruby 1.8.7. > > I'm not sure how important this case is for you to spend time on it. > For now I can go back and use 1.8.6 to avoid this problem. > > Thanks again, Lyle > -andre > > Suspicious message? There?s an alert for that. Get your Hotmail? > account now. > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeroen at fox-toolkit.org Thu Dec 4 20:45:53 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 4 Dec 2008 19:45:53 -0600 Subject: [fxruby-users] full screen? In-Reply-To: <1B91967C-2D38-404E-AB3D-9AB6AABCC88C@lylejohnson.name> References: <96791.90785.qm@web58605.mail.re3.yahoo.com> <1B91967C-2D38-404E-AB3D-9AB6AABCC88C@lylejohnson.name> Message-ID: <200812041945.53388.jeroen@fox-toolkit.org> On Thursday 04 December 2008, Lyle Johnson wrote: > > On Dec 1, 2008, at 11:32 PM, dave newby wrote: > > > I have developed a Kiosk application in Visual Basic but I would > > like to rewrite using another language. I am interested in using > > fxruby. 2 questions. > > > > 1) Can a window be made in full screen mode? > > 2) Can a window be always on top? > > I believe that FOX 1.8 will provide these features, but FOX 1.6 (on > which the current release of FXRuby is based) doesn't have those > features. So unfortunately the answer is "not yet". Lyle is correct, FOX 1.8 will indeed have these features! - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 19:40 12/ 4/2008 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From andreas_s at hotmail.com Fri Dec 5 02:54:09 2008 From: andreas_s at hotmail.com (Andreas S) Date: Fri, 5 Dec 2008 07:54:09 +0000 Subject: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class In-Reply-To: <1C38EAF0-7B0D-4F76-A01D-10A98233CA52@lylejohnson.name> References: <1C38EAF0-7B0D-4F76-A01D-10A98233CA52@lylejohnson.name> Message-ID: 1.9? That's interesting. Actually I wanted to try 1.9 to speed things up a little bit, but didn't know fxruby already supports 1.9. I just tried to install it with the latest 1.9.1-preview2, but it won't build. Something with 'len' is not a member of RArray struct anymore. 'len' is a union member now in 1.9. I regret that my C is not good enough to understand whether this is the problem or not. Just FYI. -andre From: lyle at lylejohnson.name To: fxruby-users at rubyforge.org Date: Thu, 4 Dec 2008 18:36:56 -0600 Subject: Re: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class Actually, I was running it with Ruby 1.9.1. I will try again tomorrow with 1.8.7, but I'd recommend sticking with 1.8.6. Hope this helps, Lyle On Dec 4, 2008, at 3:48 PM, Andreas S wrote: Hi Lyle, Thanks for looking at this. I forgot to mention that I was using ruby 1.8.7-p72 (also tried 1.8.7-p22). Since you didn't have the problem, I re-installed 1.8.6+p114 and tried again. Everything went smoothly. I can only conclude the problem is with ruby 1.8.7. Did you try it with 1.8.6? I'm jumping ahead here, but suppose that is the case, then herewith I'm reporting fxruby seg-faulting with ruby 1.8.7. I'm not sure how important this case is for you to spend time on it. For now I can go back and use 1.8.6 to avoid this problem. Thanks again, Lyle -andre Suspicious message? There?s an alert for that. Get your Hotmail? account now. _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _________________________________________________________________ Send e-mail anywhere. No map, no compass. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Fri Dec 5 08:57:47 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Fri, 5 Dec 2008 07:57:47 -0600 Subject: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class In-Reply-To: References: <1C38EAF0-7B0D-4F76-A01D-10A98233CA52@lylejohnson.name> Message-ID: <29890C87-3CE1-4B55-B944-D6A3AE892BE8@lylejohnson.name> On Dec 5, 2008, at 1:54 AM, Andreas S wrote: > 1.9? That's interesting. Actually I wanted to try 1.9 to speed > things up a little bit, but didn't know > fxruby already supports 1.9. > > I just tried to install it with the latest 1.9.1-preview2, but it > won't build. Yes, I was running against my development version (which has fixes for Ruby 1.9.1). As soon as Ruby 1.9.1 goes final, I'll do another FXRuby release for that. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vjoel at path.berkeley.edu Fri Dec 5 19:31:04 2008 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Fri, 05 Dec 2008 16:31:04 -0800 Subject: [fxruby-users] FXTextField and number of digits after decimal point In-Reply-To: References: <20E8E531-19DB-4F35-BAC3-294D1EC555D3@gmail.com> Message-ID: <4939C7C8.9090007@path.berkeley.edu> Lyle Johnson wrote: > > On Nov 11, 2008, at 11:25 AM, Mich?le Garoche wrote: > >> My question is: Is there a way to use either a TEXTFIELD_INTEGER or a >> TEXTFIELD_REAL without losing digits after the decimal point? > > The lack of display precision has to do with the fact that you're using > an FXDataTarget to update the value of the text field. > > When the FXTextField sets its text from the double-precision float value > that it gets from the FXDataTarget, it uses a fixed format like: > > sprintf(str, "%.*G", 6, value); > > To use a custom formatting, you'd need to stop using FXDataTarget and > instead use a combination of SEL_COMMAND and SEL_UPDATE, e.g. > > @value_value.connect(SEL_COMMAND) do > @value = @value_value.text.to_f > end > > @value_value.connect(SEL_UPDATE) do > @value_value.text = @value.to_s # or however you want to format it > end > > Hope this helps, > > Lyle Sorry, this is a late response, but for the record: If you don't want to give up the functionality of data targets, you could do this using FoxTails (http://redshift.sourceforge.net/foxtails/). The "observable" attribute and the #field method combine to give you similar functionality: attrs that sync with their gui representation, and which can be observed by your own handlers. Specifying precision is just a bonus. Here's an example and screenshot: require 'foxtails' include Fox include FoxTails class Thing extend Observable observable :x, :y end class FieldsWindow < FXMainWindow include FTField observable :z, :msg def initialize(*args) super thing = Thing.new thing.x = 1.23456 thing.y = 1.23456789 self.z = 1.23456789 field("x = %6.2f and y = %12.8f and z = %f", [thing, :x], [thing, :y], :z) field("message: %60s", :msg) thing.when_y CHANGES do |val, old_val| if old_val self.msg = "You changed y from #{old_val} to #{val}" end end end def create super show end end class FieldsApp < FTApp def initialize super("Fields", "TEST") FieldsWindow.new(self, "Fields") end end FieldsApp.new.run -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 -------------- next part -------------- A non-text attachment was scrubbed... Name: fields.png Type: image/png Size: 14333 bytes Desc: not available URL: From migatine at gmail.com Sat Dec 6 01:55:33 2008 From: migatine at gmail.com (=?ISO-8859-1?Q?Mich=E8le_Garoche?=) Date: Sat, 6 Dec 2008 07:55:33 +0100 Subject: [fxruby-users] FXTextField and number of digits after decimal point In-Reply-To: <4939C7C8.9090007@path.berkeley.edu> References: <20E8E531-19DB-4F35-BAC3-294D1EC555D3@gmail.com> <4939C7C8.9090007@path.berkeley.edu> Message-ID: Le 6 d?c. 2008 ? 01:31, Joel VanderWerf a ?crit : > Lyle Johnson wrote: >> On Nov 11, 2008, at 11:25 AM, Mich?le Garoche wrote: >>> My question is: Is there a way to use either a TEXTFIELD_INTEGER >>> or a TEXTFIELD_REAL without losing digits after the decimal point? >> The lack of display precision has to do with the fact that you're >> using an FXDataTarget to update the value of the text field. >> When the FXTextField sets its text from the double-precision float >> value that it gets from the FXDataTarget, it uses a fixed format >> like: >> sprintf(str, "%.*G", 6, value); >> To use a custom formatting, you'd need to stop using FXDataTarget >> and instead use a combination of SEL_COMMAND and SEL_UPDATE, e.g. >> @value_value.connect(SEL_COMMAND) do >> @value = @value_value.text.to_f >> end >> @value_value.connect(SEL_UPDATE) do >> @value_value.text = @value.to_s # or however you want to >> format it >> end >> Hope this helps, >> Lyle > > Sorry, this is a late response, but for the record: > > If you don't want to give up the functionality of data targets, you > could do this using FoxTails (http://redshift.sourceforge.net/ > foxtails/). > > The "observable" attribute and the #field method combine to give > you similar functionality: attrs that sync with their gui > representation, and which can be observed by your own handlers. > Specifying precision is just a bonus. Here's an example and > screenshot: > > require 'foxtails' > > include Fox > include FoxTails > > class Thing > extend Observable > observable :x, :y > end > > class FieldsWindow < FXMainWindow > include FTField > observable :z, :msg > > def initialize(*args) > super > > thing = Thing.new > thing.x = 1.23456 > thing.y = 1.23456789 > > self.z = 1.23456789 > > field("x = %6.2f and y = %12.8f and z = %f", > [thing, :x], [thing, :y], :z) > > field("message: %60s", :msg) > > thing.when_y CHANGES do |val, old_val| > if old_val > self.msg = "You changed y from #{old_val} to #{val}" > end > end > end > > def create > super > show > end > end > > class FieldsApp < FTApp > def initialize > super("Fields", "TEST") > FieldsWindow.new(self, "Fields") > end > end > > FieldsApp.new.run Thank you very much. Cheers, Mich?le -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Sat Dec 13 05:39:10 2008 From: angico at angico.org (angico) Date: Sat, 13 Dec 2008 07:39:10 -0300 Subject: [fxruby-users] message handlers Message-ID: <1229164750.10956.51.camel@caipora> Hi! When does a window send SEL_ENTER, SEL_MOVE, SEL_LEAVE messages to its target? I can see those messages sent by a widget, like FXButton, but not from an FXDialogBox, FXMainWindow or the like. So, how can I know the mouse entered or left a window? TIA, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I Coopera??o ? muito melhor que competi??o! ------ contatos: email: angico at angico.org skype: angico00 ------ From stuart_clarke86 at yahoo.com Wed Dec 17 16:51:52 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Wed, 17 Dec 2008 21:51:52 +0000 (GMT) Subject: [fxruby-users] Directory listing query Message-ID: <936915.70148.qm@web86601.mail.ird.yahoo.com> Hi, I am trying to write a small GUI to glue onto the front of some other code. The purpose of the GUI is to allow the user to select a text file full of word lists, then to select a directory for the data to be output to and finally for the user to enter a name for the job in a text field. Thus far I have created the directory dialogs and relevant text fields, however I would like some assistance with the remainder. Firstly when a user selects a file (word list file) I would like the full path and file name to be displayed in a text box (I would like the same for the directory selection also). How would I go about this? This is my most of my code this far which shows my ideas but this is not working: Thanks in advance. require 'fox16' include Fox class GUI < FXMainWindow #SUBCLASS FOR CREATING A WINDOW, CONTAINS ALL THE CUSTOMISATION INFORMATION ? def initialize(app) ??? super(app, "GUI", :width => 300, :height => 250) ??? frame = FXVerticalFrame.new(self, LAYOUT_FILL_X) ??? inputFile = FXButton.new(frame, "Input Phrase File") ??? inputFile.connect(SEL_COMMAND) do ????? dialog = FXFileDialog.new(self, "Select input file") ????? dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] ????? dialog.selectMode = SELECTFILE_EXISTING ????? if dialog.execute != 0 #display the box and wait fot user response ??????? loadinput(dialog.filename) #if the user selects a file it calls the openevtfile method ????? end ??? end ??? @inputfield = FXTextField.new(frame, 30, :opts => FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X) ??? ??? FXHorizontalSeparator.new(frame, :opts => LAYOUT_FILL_X|SEPARATOR_GROOVE) ??? FXLabel.new(frame, "Classifcation name:", :opts => JUSTIFY_LEFT) ??? tagfield = FXTextField.new(frame, 30, :opts => FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X) ??? ??? FXButton.new(frame, "Run") ??? FXButton.new(frame, "Cancel", nil, getApp(), FXApp::ID_QUIT) ? end ? ? def loadinput(filename) ??? inputfile = [] ??? inputfile.push "(#{filename})" ??? @inputfield = inputfile.join("\n") ? end -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Dec 18 10:50:05 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 18 Dec 2008 09:50:05 -0600 Subject: [fxruby-users] Directory listing query In-Reply-To: <936915.70148.qm@web86601.mail.ird.yahoo.com> References: <936915.70148.qm@web86601.mail.ird.yahoo.com> Message-ID: <59CAD8FF-5A85-4267-B24C-CE2AD9D49999@lylejohnson.name> On Dec 17, 2008, at 3:51 PM, Stuart Clarke wrote: > Firstly when a user selects a file (word list file) I would like the > full path and file name to be displayed in a text box (I would like > the same for the directory selection also). How would I go about this? I don't see in your program (or at least the part that you included in your e-mail) where you've attempted to do this, so it's hard to guess what's wrong. But since the FXFileDialog#filename returns the selected file's name, it seems like you'd want to assign that to the appropriate text field, e.g. @inputfield.text = dialog.filename Hope this helps, Lyle -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Thu Dec 18 11:53:38 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Thu, 18 Dec 2008 16:53:38 +0000 (GMT) Subject: [fxruby-users] Directory listing query In-Reply-To: <59CAD8FF-5A85-4267-B24C-CE2AD9D49999@lylejohnson.name> Message-ID: <520491.98565.qm@web86606.mail.ird.yahoo.com> Apologies I was sending a chunk of the wrong coding. This is more useful I would imagine: ??? inputFile = FXButton.new(frame, "Input Phrase File") ??? inputFile.connect(SEL_COMMAND) do #the connect will ensure the following block is performed ????? dialog = FXFileDialog.new(self, "Select input file") ????? dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] ????? dialog.selectMode = SELECTFILE_EXISTING ????? if dialog.execute != 0 #display the box and wait fot user response ??????? inputfield.text = dialog.filename ????? end ??? end ??? #create a text field to insert file path in ??? inputfield = FXTextField.new(frame, 30, :opts => FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X) This throws errors. Do I need a to_s? Thanks in advance! --- On Thu, 18/12/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] Directory listing query To: fxruby-users at rubyforge.org Date: Thursday, 18 December, 2008, 3:50 PM On Dec 17, 2008, at 3:51 PM, Stuart Clarke wrote: Firstly when a user selects a file (word list file) I would like the full path and file name to be displayed in a text box (I would like the same for the directory selection also). How would I go about this? I don't see in your program (or at least the part that you included in your e-mail) where you've attempted to do this, so it's hard to guess what's wrong. But since the FXFileDialog#filename returns the selected file's name, it seems like you'd want to assign that to the appropriate text field, e.g. @inputfield.text = dialog.filename Hope this helps, Lyle_______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Dec 18 15:30:30 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 18 Dec 2008 14:30:30 -0600 Subject: [fxruby-users] Directory listing query In-Reply-To: <520491.98565.qm@web86606.mail.ird.yahoo.com> References: <520491.98565.qm@web86606.mail.ird.yahoo.com> Message-ID: On Dec 18, 2008, at 10:53 AM, Stuart Clarke wrote: > This throws errors. Do I need a to_s? That depends. What kind of error does it throw? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Thu Dec 18 15:59:29 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Thu, 18 Dec 2008 20:59:29 +0000 (GMT) Subject: [fxruby-users] Directory listing query In-Reply-To: Message-ID: <4088.79362.qm@web86606.mail.ird.yahoo.com> to_s worked and its up and running. I do have one other question which is completely unrelated but again to do with FX. I have a program which carves out data from a structured file (Windows event log). Each struct holds a chunk of data with the exception of the last struct which holds a lot more data and requires regular expressions to get the relevant data out. I was wondering is there a way in FX that when the program encounters this struct, it passes a hyperlink type thing or button so when the user clicks on it they can view the entire contents of the complex struct for example data a????????? data b????????? data c????????? data d???????????? button for clicking Regards Stuart --- On Thu, 18/12/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] Directory listing query To: fxruby-users at rubyforge.org Date: Thursday, 18 December, 2008, 8:30 PM On Dec 18, 2008, at 10:53 AM, Stuart Clarke wrote: This throws errors. Do I need a to_s? That depends. What kind of error does it throw?_______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Mon Dec 22 05:39:22 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Mon, 22 Dec 2008 10:39:22 +0000 (GMT) Subject: [fxruby-users] (no subject) Message-ID: <886940.9070.qm@web86611.mail.ird.yahoo.com> Hi, I would like to ask a few questions about the 'charts' example which is included with the newest release of FX. I like the idea of producing a chart like this however this one appears to need an internet connection to work (i assume to gather formating?). I have a large array full of data and I would like to plot a graph based on two of the fields in the array e.g. date againist vs event. Is there a way I can do this similar to the example given in charts.rb. I would like it to work offline and simply draw a line or bar graph based on two sets on data (date along the botton and event frequency up the side). Can this be done. I look forward to your response. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Mon Dec 22 09:01:14 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 22 Dec 2008 08:01:14 -0600 Subject: [fxruby-users] (no subject) In-Reply-To: <886940.9070.qm@web86611.mail.ird.yahoo.com> References: <886940.9070.qm@web86611.mail.ird.yahoo.com> Message-ID: <1B2662B9-7F2B-4813-9330-3CCF9821CFCE@lylejohnson.name> On Dec 22, 2008, at 4:39 AM, Stuart Clarke wrote: > I would like to ask a few questions about the 'charts' example which > is included with the newest release of FX. I like the idea of > producing a chart like this however this one appears to need an > internet connection to work (i assume to gather formating?). Right. It uses the Google Chart API, which depends on being able to access the network-based Google Chart service. > I have a large array full of data and I would like to plot a graph > based on two of the fields in the array e.g. date againist vs event. > Is there a way I can do this similar to the example given in > charts.rb. I would like it to work offline and simply draw a line or > bar graph based on two sets on data (date along the botton and event > frequency up the side). Can this be done? I hope some others on the list will chime in on this one. There's no built-in charting library for FXRuby, but if there are any existing Ruby libraries that can be used to produce chart graphics, we can probably find a way to feed their output into an FXRuby image. Hope this helps, Lyle -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Mon Dec 22 10:45:18 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Mon, 22 Dec 2008 15:45:18 +0000 (GMT) Subject: [fxruby-users] (no subject) In-Reply-To: <1B2662B9-7F2B-4813-9330-3CCF9821CFCE@lylejohnson.name> Message-ID: <172638.20809.qm@web86606.mail.ird.yahoo.com> Thanks for your response. Right now I have written some test code which uses the ruport/util library in Ruby. I am able to output an SVG graph from the code, if we can glue this into FX I will look to integrate the ruport graphs class. I will try and get this into FX now but if anyone has any suggestions I look forward to a response. Many thanks --- On Mon, 22/12/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] (no subject) To: fxruby-users at rubyforge.org Date: Monday, 22 December, 2008, 2:01 PM On Dec 22, 2008, at 4:39 AM, Stuart Clarke wrote: I would like to ask a few questions about the 'charts' example which is included with the newest release of FX. I like the idea of producing a chart like this however this one appears to need an internet connection to work (i assume to gather formating?). Right. It uses the Google Chart API, which depends on being able to access the network-based Google Chart service. I have a large array full of data and I would like to plot a graph based on two of the fields in the array e.g. date againist vs event. Is there a way I can do this similar to the example given in charts.rb. I would like it to work offline and simply draw a line or bar graph based on two sets on data (date along the botton and event frequency up the side). Can this be done? I hope some others on the list will chime in on this one. There's no built-in charting library for FXRuby, but if there are any existing Ruby libraries that can be used to produce chart graphics, we can probably find a way to feed their output into an FXRuby image. Hope this helps, Lyle_______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Mon Dec 22 11:38:23 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 22 Dec 2008 10:38:23 -0600 Subject: [fxruby-users] (no subject) In-Reply-To: <172638.20809.qm@web86606.mail.ird.yahoo.com> References: <172638.20809.qm@web86606.mail.ird.yahoo.com> Message-ID: <7816FDF4-6EA8-481B-AE36-7D3B1F55D747@lylejohnson.name> On Dec 22, 2008, at 9:45 AM, Stuart Clarke wrote: > Thanks for your response. Right now I have written some test code > which uses the ruport/util library in Ruby. I am able to output an > SVG graph from the code, if we can glue this into FX I will look to > integrate the ruport graphs class. > > I will try and get this into FX now but if anyone has any > suggestions I look forward to a response. I don't know of a way to (directly) use SVG in FOX, but maybe you could use some sort of intermediary library (like RMagick) to convert it to one of the supported image file formats, like GIF, PNG, JPEG or TIFF. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Dec 23 16:06:50 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 23 Dec 2008 15:06:50 -0600 Subject: [fxruby-users] [ANN] FXRuby 1.6.17 Now Available Message-ID: <358CD7A9-1AF9-4A74-896D-80488FCB40E6@lylejohnson.name> All, FXRuby version 1.6.17 is now available for download from this page: http://rubyforge.org/frs/?group_id=300&release_id=29822 For a summary of the changes in this release of FXRuby, please see this page: http://www.fxruby.org/doc/changes.html The code is provided in source form, along with binaries for Win32 and OS X. For instructions on compiling FXRuby from source, please see: http://www.fxruby.org/doc/build.html And as always, the FXRuby home page is here: http://www.fxruby.org Enjoy, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From lcl at tarazed.demon.co.uk Tue Dec 23 19:34:05 2008 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Wed, 24 Dec 2008 00:34:05 +0000 Subject: [fxruby-users] fxruby-1.6.17 failure to compile Message-ID: <4951837D.2040607@tarazed.demon.co.uk> Downloaded fxruby-1.6.17.gem Switched to root gem install --local ./fxruby-1.6.17.gem Extracts from the error reports: In file included from include/FXRuby.h:825, from include/FXRbCommon.h:93, from FXRuby.cpp:31: include/inlinestubs.h: In function ?void FXApp_init(FX::FXApp*, VALUE, bool)?: include/inlinestubs.h:20: warning: deprecated conversion from string constant to ?char*? FXRuby.cpp: In function ?void FXRbRegisterRubyObj(VALUE, const void*)?: FXRuby.cpp:253: error: cast from ?const void*? to ?unsigned int? loses precision FXRuby.cpp: In function ?ID FXRbLookupHandler(FX::FXObject*, FX::FXSelector)?: FXRuby.cpp:1194: error: cast from ?FX::FXObject*? to ?unsigned int? loses precision FXRuby.cpp: In function ?long int FXRbHandleMessage(FX::FXObject*, ID, FX::FXObject*, FX::FXSelector, void*)?: FXRuby.cpp:1265: error: cast from ?FX::FXObject*? to ?unsigned int? loses precision FXRuby.cpp: At global scope: FXRuby.cpp:1852: warning: deprecated conversion from string constant to ?char*? and FXRuby.cpp:1852: warning: deprecated conversion from string constant to ?char*? FXRuby.cpp: In function ?void FXRbRegisterAppSensitiveObject(FX::FXObject*)?: FXRuby.cpp:1888: error: cast from ?FX::FXObject*? to ?unsigned int? loses precision FXRuby.cpp: In function ?void FXRbRegisterAppSensitiveObject(FX::FXDC*)?: FXRuby.cpp:1895: error: cast from ?FX::FXDC*? to ?unsigned int? loses precision FXRuby.cpp: In function ?void FXRbUnregisterAppSensitiveObject(FX::FXObject*)?: FXRuby.cpp:1902: error: cast from ?FX::FXObject*? to ?unsigned int? loses precision FXRuby.cpp: In function ?void FXRbUnregisterAppSensitiveObject(FX::FXDC*)?: FXRuby.cpp:1909: error: cast from ?FX::FXDC*? to ?unsigned int? loses precision make: *** [FXRuby.o] Error 1 Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/fxruby-1.6.17 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/fxruby-1.6.17/ext/fox16/gem_make.out Does this mean that there is something wrong with my environment or are these genuine errors? Len From lyle at lylejohnson.name Wed Dec 24 10:26:25 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 24 Dec 2008 09:26:25 -0600 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: <4951837D.2040607@tarazed.demon.co.uk> References: <4951837D.2040607@tarazed.demon.co.uk> Message-ID: On Dec 23, 2008, at 6:34 PM, Len Lawrence wrote: > Downloaded fxruby-1.6.17.gem > Switched to root > gem install --local ./fxruby-1.6.17.gem > > Extracts from the error reports: > FXRuby.cpp: In function ?void FXRbRegisterRubyObj(VALUE, const > void*)?: > FXRuby.cpp:253: error: cast from ?const void*? to ?unsigned int? > loses precision > Does this mean that there is something wrong with my environment or > are these genuine errors? Are you compiling with a 64-bit compiler? I mean, it looks that way. Ugh. I wish the compiler treated those as warnings and not errors, but oh well. What's happening is that we're trying to cast a void * (pointer-to- void) to an unsigned int. And on 32-bit platforms, those two types are the same size (32 bits), and so there's no error. That's why I didn't see this error at compile time (and why most folks probably won't). On a 64-bit OS, however, a pointer is 64 bits long, while an unsigned int is still just 32 bits long. (Aren't you glad you program in Ruby and don't have to worry about arcane stuff like this?). So we're getting a compile error for those casts. Let me work-up a patch and post back here when I've got something (hopefully, soon). I don't want to do a 1.6.18 release until we're sure it's compiling properly on your machine, so this make take an iteration or two. Thanks for the heads-up, Lyle From lyle at lylejohnson.name Wed Dec 24 10:53:05 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 24 Dec 2008 09:53:05 -0600 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: <4951837D.2040607@tarazed.demon.co.uk> References: <4951837D.2040607@tarazed.demon.co.uk> Message-ID: Len, On further inspection, I'm a little confused. Can you tell me what version of Ruby you're compiling against? The reason I'm asking is that based on the Ruby source code that I'm looking at (for Ruby 1.8.6- p287) this ought not be an issue. Thanks, Lyle From lcl at tarazed.demon.co.uk Wed Dec 24 17:05:25 2008 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Wed, 24 Dec 2008 22:05:25 +0000 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: References: <4951837D.2040607@tarazed.demon.co.uk> Message-ID: <4952B225.9040105@tarazed.demon.co.uk> Lyle Johnson wrote: > Len, > > On further inspection, I'm a little confused. Can you tell me what > version of Ruby you're compiling against? The reason I'm asking is > that based on the Ruby source code that I'm looking at (for Ruby > 1.8.6-p287) this ought not be an issue. > > Thanks Lyle. ruby -v shows: ruby 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux] I moved to 1.8.7 because I also use rubytk which appeared to be broken in 1.8.6 (caused core dumps all the time). Because I rely on rubytk so heavily moving back to 1.8.6 is not a viable option. Have a good Christmas and let's hope you take some time off. Len From lyle at lylejohnson.name Mon Dec 29 14:37:25 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 29 Dec 2008 13:37:25 -0600 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: <4952B225.9040105@tarazed.demon.co.uk> References: <4951837D.2040607@tarazed.demon.co.uk> <4952B225.9040105@tarazed.demon.co.uk> Message-ID: <00336058-EBBD-40F5-9ECC-B0C393EFBC22@lylejohnson.name> On Dec 24, 2008, at 4:05 PM, Len Lawrence wrote: > Thanks Lyle. > ruby -v shows: > ruby 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux] > > I moved to 1.8.7 because I also use rubytk which appeared to be > broken in 1.8.6 (caused core dumps all the time). Because I rely on > rubytk so heavily moving back to 1.8.6 is not a viable option. > > Have a good Christmas and let's hope you take some time off. Len, Could you download this updated gem (sort of a pre-release version) and see if it compiles OK on your 64-bit system? I don't have any way to test here, so it may take another round or so to get it right. http://dl-client.getdropbox.com/u/60906/fxruby-1.6.18.gem Thanks, Lyle From lyle at lylejohnson.name Mon Dec 29 15:51:14 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 29 Dec 2008 14:51:14 -0600 Subject: [fxruby-users] [ANN] FXRuby 1.6.18 Now Available Message-ID: <26820E22-8EB0-4B8E-8E62-EE291F21BEB0@lylejohnson.name> All, Hot on the heels of the previous release, FXRuby version 1.6.18 is now available for download from this page: http://rubyforge.org/frs/?group_id=300&release_id= 29923 This is a really minor release that just fixes a few build issues on 64-bit systems; no other bug fixes or changes. For a summary of the changes in this release of FXRuby, please see this page: http://www.fxruby.org/doc/changes.html The code is provided in source form, along with binaries for Win32 and OS X. For instructions on compiling FXRuby from source, please see: http://www.fxruby.org/doc/build.html And as always, the FXRuby home page is here: http://www.fxruby.org Enjoy, Lyle From lcl at tarazed.demon.co.uk Mon Dec 29 15:56:40 2008 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Mon, 29 Dec 2008 20:56:40 +0000 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: <00336058-EBBD-40F5-9ECC-B0C393EFBC22@lylejohnson.name> References: <4951837D.2040607@tarazed.demon.co.uk> <4952B225.9040105@tarazed.demon.co.uk> <00336058-EBBD-40F5-9ECC-B0C393EFBC22@lylejohnson.name> Message-ID: <49593988.7020900@tarazed.demon.co.uk> Lyle Johnson wrote: > Len, > > Could you download this updated gem (sort of a pre-release version) > and see if it compiles OK on your 64-bit system? I don't have any way > to test here, so it may take another round or so to get it right. > > http://dl-client.getdropbox.com/u/60906/fxruby-1.6.18.gem > > Thanks, > > Lyle > Done. Partially successful as you can see. Thanks for taking the trouble. #gem install -l ./fxruby-1.6.18.gem Building native extensions. This could take a while... Successfully installed fxruby-1.6.18 1 gem installed Installing ri documentation for fxruby-1.6.18... ERROR: While executing gem ... (TypeError) can't convert Regexp into String #locate fox16.so | grep "1.6.18" /usr/lib64/ruby/gems/1.8/gems/fxruby-1.6.18/ext/fox16/fox16.so I tried an fxruby program but I see that the system is littered with older versions of fxruby so I hope that it is picking up the latest library; it runs anyway. All the best for 2009 Len From lyle at lylejohnson.name Mon Dec 29 17:14:18 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 29 Dec 2008 16:14:18 -0600 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: <49593988.7020900@tarazed.demon.co.uk> References: <4951837D.2040607@tarazed.demon.co.uk> <4952B225.9040105@tarazed.demon.co.uk> <00336058-EBBD-40F5-9ECC-B0C393EFBC22@lylejohnson.name> <49593988.7020900@tarazed.demon.co.uk> Message-ID: <2C8638B2-EC96-410E-84FB-DC48FD05BA7D@lylejohnson.name> On Dec 29, 2008, at 2:56 PM, Len Lawrence wrote: > Done. Partially successful as you can see. Thanks for taking the > trouble. > > #gem install -l ./fxruby-1.6.18.gem > Building native extensions. This could take a while... > Successfully installed fxruby-1.6.18 > 1 gem installed > Installing ri documentation for fxruby-1.6.18... > ERROR: While executing gem ... (TypeError) > can't convert Regexp into String Hmmm. I don't know what to make of that (other than it's coming from RubyGems during the installation process). Needless to say, it's not happening here when I try to install. > I tried an fxruby program but I see that the system is littered with > older versions of fxruby > so I hope that it is picking up the latest library; it runs anyway. It's probably getting the right version, but you can confirm by putting a print statement (or whatever) in your FXRuby program that prints the result of calling "Fox.fxrubyversion". This should return the string "1.6.18". Hope this helps, Lyle From kwicher at gmail.com Mon Dec 29 19:34:50 2008 From: kwicher at gmail.com (kwicher) Date: Mon, 29 Dec 2008 16:34:50 -0800 (PST) Subject: [fxruby-users] FXText and FXDataTarget Message-ID: <77581ef0-8ea2-417e-9454-0f328aae9ac4@a29g2000pra.googlegroups.com> Hi, I'd like to ask if it is possible to control the length of the text displayed in FXText via the FXDataTarget object? I tried something like that but it did not work: require "rubygems" require "fox16" include Fox class MyProject < FXMainWindow def initialize (app, title) super(app,title, :opts=>DECOR_ALL^(DECOR_SHRINKABLE| DECOR_STRETCHABLE|DECOR_RESIZE)| LAYOUT_EXPLICIT,:width=>400,:height=>300) @target=FXDataTarget.new("jkjkjk") do |cmd| cmd.connect(SEL_CHANGED) do |sender, sel, data| if data.length>10 FXApp.instance.beep sender.value=data[0..9] end end end @text=FXText.new (self,:x=>2, :y=>2,:width=>216, :height=>60,:target => @target, :selector => FXDataTarget::ID_VALUE,:opts=>LAYOUT_EXPLICIT) end def create super show(PLACEMENT_SCREEN) end end app = FXApp.new MyProject.new(app, "test") app.create app.run thanks Krzys From lcl at tarazed.demon.co.uk Tue Dec 30 02:26:58 2008 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Tue, 30 Dec 2008 07:26:58 +0000 Subject: [fxruby-users] fxruby-1.6.17 failure to compile In-Reply-To: <2C8638B2-EC96-410E-84FB-DC48FD05BA7D@lylejohnson.name> References: <4951837D.2040607@tarazed.demon.co.uk> <4952B225.9040105@tarazed.demon.co.uk> <00336058-EBBD-40F5-9ECC-B0C393EFBC22@lylejohnson.name> <49593988.7020900@tarazed.demon.co.uk> <2C8638B2-EC96-410E-84FB-DC48FD05BA7D@lylejohnson.name> Message-ID: <4959CD42.8020108@tarazed.demon.co.uk> Lyle Johnson wrote: > > On Dec 29, 2008, at 2:56 PM, Len Lawrence wrote: > >> Done. Partially successful as you can see. Thanks for taking the >> trouble. >> >> #gem install -l ./fxruby-1.6.18.gem >> Building native extensions. This could take a while... >> Successfully installed fxruby-1.6.18 >> 1 gem installed >> Installing ri documentation for fxruby-1.6.18... >> ERROR: While executing gem ... (TypeError) >> can't convert Regexp into String > > Hmmm. I don't know what to make of that (other than it's coming from > RubyGems during the installation process). Needless to say, it's not > happening here when I try to install. > >> I tried an fxruby program but I see that the system is littered with >> older versions of fxruby >> so I hope that it is picking up the latest library; it runs anyway. > > It's probably getting the right version, but you can confirm by > putting a print statement (or whatever) in your FXRuby program that > prints the result of calling "Fox.fxrubyversion". This should return > the string "1.6.18". > > Hope this helps, > > Lyle > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > Yep, it does, and 1.6.18 it is. Thanks again. Len From vjoel at path.berkeley.edu Wed Dec 31 11:58:22 2008 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Wed, 31 Dec 2008 08:58:22 -0800 Subject: [fxruby-users] [OT] rubytk In-Reply-To: <4952B225.9040105@tarazed.demon.co.uk> References: <4951837D.2040607@tarazed.demon.co.uk> <4952B225.9040105@tarazed.demon.co.uk> Message-ID: <495BA4AE.6000108@path.berkeley.edu> Len Lawrence wrote: > I moved to 1.8.7 because I also use rubytk which appeared to be broken > in 1.8.6 (caused core dumps all the time). Because I rely on rubytk so > heavily moving back to 1.8.6 is not a viable option. Did you make sure that your ruby and tk builds both enable (or disable) pthreads? A mismatch can cause problems (but you should also get warnings in configure, IIRC). -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From philippe.lang at attiksystem.ch Wed Dec 31 08:35:30 2008 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 31 Dec 2008 14:35:30 +0100 Subject: [fxruby-users] How to disable warnings? Message-ID: Hi Lyle, I have just upgraded to FXRuby 1.6.18 - I was using version 1.6.14 before -, and I have noticed that a lot more warnings have appeared on my windows console since then. I have tried to launch my program with -W0, but it does not help. I can read a change that goes in that direction with version 1.6.17. Is there a way disable warnings completely maybe? By the way, thanks for your work Lyle, and happy new year to everyone! Best regards, Philippe Lang From lcl at tarazed.demon.co.uk Wed Dec 31 14:45:36 2008 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Wed, 31 Dec 2008 19:45:36 +0000 Subject: [fxruby-users] [OT] rubytk In-Reply-To: <495BA4AE.6000108@path.berkeley.edu> References: <4951837D.2040607@tarazed.demon.co.uk> <4952B225.9040105@tarazed.demon.co.uk> <495BA4AE.6000108@path.berkeley.edu> Message-ID: <495BCBE0.4040702@tarazed.demon.co.uk> Joel VanderWerf wrote: > Len Lawrence wrote: >> I moved to 1.8.7 because I also use rubytk which appeared to be >> broken in 1.8.6 (caused core dumps all the time). Because I rely on >> rubytk so heavily moving back to 1.8.6 is not a viable option. > > Did you make sure that your ruby and tk builds both enable (or > disable) pthreads? A mismatch can cause problems (but you should also > get warnings in configure, IIRC). > I had wondered about that but was unable to determine if a mismatch was the cause or not. Cannot remember if the final 1.8.7 system depended on RPMs or tarballs. Mandriva 2009 Spring will soon be out with the latest edition of tcl/tk. That may bring its own problems so I shall shelve any recompilations/investigations until then. Happy New Year Len From lyle at lylejohnson.name Wed Dec 31 15:42:41 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 31 Dec 2008 14:42:41 -0600 Subject: [fxruby-users] How to disable warnings? In-Reply-To: References: Message-ID: On Dec 31, 2008, at 7:35 AM, Philippe Lang wrote: > I have just upgraded to FXRuby 1.6.18 - I was using version 1.6.14 > before -, and I have noticed that a lot more warnings have appeared on > my windows console since then. I have tried to launch my program with > -W0, but it does not help. > > I can read a change that goes in that direction with version 1.6.17. > Is > there a way disable warnings completely maybe? If you can file a bug report about the specific warning messages you're seeing, I can try to do something to suppress them. I don't know of a good way to do it globally though (without turning off legitimate warning messages that you'd *want* to see). > By the way, thanks for your work Lyle, and happy new year to everyone! Thanks, and Happy New Year to you too. From lyle at lylejohnson.name Wed Dec 31 15:58:58 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 31 Dec 2008 14:58:58 -0600 Subject: [fxruby-users] FXText and FXDataTarget In-Reply-To: <77581ef0-8ea2-417e-9454-0f328aae9ac4@a29g2000pra.googlegroups.com> References: <77581ef0-8ea2-417e-9454-0f328aae9ac4@a29g2000pra.googlegroups.com> Message-ID: <18ACE1C5-7086-4674-AB6C-4FA7EAE2FB8E@lylejohnson.name> On Dec 29, 2008, at 6:34 PM, kwicher wrote: > I'd like to ask if it is possible to control the length of the text > displayed in FXText via the FXDataTarget object? > I tried something like that but it did not work: If I understand your question correctly, the answer is no. The FXDataTarget only sends a SEL_CHANGED message in response to receiving SEL_CHANGED from some other object. So in your example, the block that checks the data length will only get triggered if someone tries to edit the text in the FXText window. Now, the block won't get exercised if you change the FXDataTarget's value directly. But if your goal is to limit the length of the text, you can presumably (?) just do that check whenever you change the value of the data target in the first place. Hope this helps. Please follow up if I've misunderstood the question. -- Lyle