From wconrad at yagni.com Sun Nov 5 12:27:58 2006 From: wconrad at yagni.com (Wayne Conrad) Date: Sun, 5 Nov 2006 10:27:58 -0700 Subject: [fxruby-users] Getting fewer paints per second than I expected Message-ID: <20061105172758.GA12208@yagni.com> I've got a program that puts 20 text labels in the main window. Each label updates itself to a global counter on SEL_UPDATE. The counter increments 10 times a second. To my surprise, the labels skip counter updates. I expected to see each label painting a new timer value 10 times per second. Instead, each label paints about 3 times per second. CPU is about 100% idle when the program is running. Have I made a newbie mistake? Is this a question for the regular Fox list? Fox 1.4.34, FXRuby 1.4.7, Debian testing. Program follows. #!/usr/bin/ruby1.8 require 'fox14' include Fox class Main def initialize @i = 0 end def run @app = FXApp.new main = FXMainWindow.new(@app, File.basename(__FILE__)) FXButton.new(main, "&Quit") do |button| button.layoutHints = LAYOUT_CENTER_X button.connect(SEL_COMMAND) do exit end end 20.times do FXLabel.new(main, format_count) do |label| label.connect(SEL_UPDATE) do label.text = format_count end end end main.show(PLACEMENT_SCREEN) start_timer @app.create @app.run end private def format_count "%04d" % @i end def start_timer @app.addTimeout(100, method(:timer)) end def timer(sender, sel, data) @i += 1 start_timer end end Main.new.run if $0 == __FILE__ From vjoel at path.berkeley.edu Sun Nov 5 18:22:06 2006 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sun, 05 Nov 2006 15:22:06 -0800 Subject: [fxruby-users] Getting fewer paints per second than I expected In-Reply-To: <20061105172758.GA12208@yagni.com> References: <20061105172758.GA12208@yagni.com> Message-ID: <454E721E.50907@path.berkeley.edu> Wayne Conrad wrote: > I've got a program that puts 20 text labels in the main window. Each > label updates itself to a global counter on SEL_UPDATE. The counter > increments 10 times a second. > > To my surprise, the labels skip counter updates. I expected to see > each label painting a new timer value 10 times per second. Instead, > each label paints about 3 times per second. CPU is about 100% idle > when the program is running. > > Have I made a newbie mistake? Is this a question for the regular Fox > list? I verified your observations with fox16 (fxruby): updates skip and cpu < 1%. In addition I checked that the timer is really called 10 times per second (it turns out to be between 9 and 10 times per second, actually, probably due to the time it takes to re-register the timer). It may be that using SEL_UPDATE works better in pure fox than in fxruby, but in my experience it's better to take control of the updates yourself if you want them done promptly. You can do this by setting up an observer relationship and using that to set the label text when the variable changes. This is part of the reason I wrote the observable[1] and foxtails[2] libraries. Here's a modification of your code that updates about 10 times per second. I had to use a text field in this example instead of a label because I had never thought of making label text connect to a variable, but it would not be hard to do. It still runs with <1% cpu, though probably a bit more than using SEL_UPDATE. FoxTails won't scale up to huge numbers of widgets as well as pure fox, of course, because (a) it has an extra layer of ruby code on top of fxruby and (b) is it eager rather than lazy about updates. (I feel that the laziness of updates in fxruby, especially menu items, is a serious problem.) require 'foxtails' include Fox include FoxTails class Main extend Observable observable :i def initialize self.i = 0 end def run @app = FXApp.new main = FXMainWindow.new(@app, File.basename(__FILE__)) FXButton.new(main, "&Quit") do |button| button.layoutHints = LAYOUT_CENTER_X button.connect(SEL_COMMAND) do exit end end 20.times do FTTextField.new(main, 10, self, :i) end main.show(PLACEMENT_SCREEN) start_timer @app.create @app.run end private def start_timer @app.addTimeout(100, method(:timer)) end def timer(sender, sel, data) self.i += 1 start_timer end end Main.new.run if $0 == __FILE__ That example didn't do any formatting, but there is a #field method that lets you use various %-escapes to do formatting and also to line things up using a FXMartix, perform validation, group radio buttons, add check buttons, and so on. These are all connected (in both directions) to ruby attrs using the observable mechanism. In this case, just add your fields using the following code instead of the above: main.extend FTField # normally, you define a window class and include FTField 20.times do main.field "current value is %04d", [self, :i] end The static text "current value os" is displayed as a label, and the dynamic text is displayed in a text field (but it could be a label with a little work). Check out foxtails/examples/fields.rb for more. [1] http://raa.ruby-lang.org/project/observable/ [2] http://raa.ruby-lang.org/project/foxtails/ -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From vjoel at path.berkeley.edu Sun Nov 5 19:32:48 2006 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sun, 05 Nov 2006 16:32:48 -0800 Subject: [fxruby-users] Getting fewer paints per second than I expected In-Reply-To: <454E721E.50907@path.berkeley.edu> References: <20061105172758.GA12208@yagni.com> <454E721E.50907@path.berkeley.edu> Message-ID: <454E82B0.7090301@path.berkeley.edu> Joel VanderWerf wrote: ... > That example didn't do any formatting, but there is a #field method that > lets you use various %-escapes to do formatting and also to line things > up using a FXMartix, perform validation, group radio buttons, add check > buttons, and so on. These are all connected (in both directions) to ruby > attrs using the observable mechanism. ... > [1] http://raa.ruby-lang.org/project/observable/ > [2] http://raa.ruby-lang.org/project/foxtails/ Sourceforge seems to be down so just for the heck of it here is another example (going a bit OT) of fields with the matrix, validation, radio/check, and observable features. The output of the program, after entering data as shown in the attached PNG, is as follows: $ ruby ship-fields.rb [#, #] The full program is attached, but this is the heart of it: matrix = FXMatrix.new(self, 8, MATRIX_BY_COLUMNS|FRAME_THICK|LAYOUT_FILL_X) # The %| character separates fields into different cells of the matrix. field(matrix, " %| name %| x %| y %| speedboat %| sailboat %| steamer %| enabled") # this just adds some header labels ships = [Ship.new, Ship.new] ships.each_with_index do |ship, i| f = field(matrix, "#{i} %| %s %| %6.2f %| %6.2f %| %r %| %r %| %r %| %v", # %r is radio, %v is check [ship, :name], [ship, :x], [ship, :y], [[ship, :kind], "speedboat"], [[ship, :kind], "sailboat"], [[ship, :kind], "steamer"], [ship, :enabled] ) f.valid([ship, :x]) {|x| x >= 0 and x < 100} f.valid([ship, :y]) {|y| y >= 0 and y < 100} -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 -------------- next part -------------- A non-text attachment was scrubbed... Name: ship-fields.png Type: image/png Size: 5529 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20061105/075759e4/attachment.png -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ship-fields.rb Url: http://rubyforge.org/pipermail/fxruby-users/attachments/20061105/075759e4/attachment.pl From gerard.menochet at wanadoo.fr Tue Nov 7 08:35:09 2006 From: gerard.menochet at wanadoo.fr (=?iso-8859-1?Q?G=E9rard_M=E9nochet?=) Date: Tue, 7 Nov 2006 14:35:09 +0100 Subject: [fxruby-users] FXScintilla - SC_MASK_FOLDERS References: <453E73E1.2060008@free.fr> <8E952A3C-5A11-4AC5-86B5-C4ABCD490718@knology.net> Message-ID: <003501c70271$8c14c580$011c7b52@gerard56z3982r> Hi, I wonder if there's a problem with SC_MASK_FOLDERS. self.markerDefine( SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS) self.markerDefine(SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS) ............ #~ Toggle Fold self.setMarginWidthN( MARGIN_FOLDER , 20 ) self.setMarginTypeN( MARGIN_FOLDER , SC_MARGIN_SYMBOL ) self.setMarginMaskN( MARGIN_FOLDER , -1 ) # , SC_MASK_FOLDERS) Nothing Happens !!!. With the Mask sets to -1 (all the symbols ), that works. Some ideas ? Thanks for your help G?rard M?nochet From wconrad at yagni.com Tue Nov 7 10:07:00 2006 From: wconrad at yagni.com (Wayne Conrad) Date: Tue, 7 Nov 2006 08:07:00 -0700 Subject: [fxruby-users] Getting fewer paints per second than I expected In-Reply-To: <454E82B0.7090301@path.berkeley.edu> References: <20061105172758.GA12208@yagni.com> <454E721E.50907@path.berkeley.edu> <454E82B0.7090301@path.berkeley.edu> Message-ID: <20061107150700.GA5021@yagni.com> Joel, Thanks for the thoughtful replies. I likely won't be able to give them any real attention until the weekend, but wanted to reply now so you knew they were appreciated. Wayne Conrad From erne at powernav.com Mon Nov 20 23:56:58 2006 From: erne at powernav.com (Ernest Ellingson) Date: Mon, 20 Nov 2006 23:56:58 -0500 Subject: [fxruby-users] FXPNGIcon.new not working Message-ID: <4562871A.90607@powernav.com> Hi: I am running Ubuntu 6.06 on an AMD64 box. I'm running Ruby 1.85 I downloaded and compiled and installed Fox-1.6.20. In the test directory I ran several of the test programs successfully. I used gems to install fxruby-1.6.2 I went to the examples directory and tried running hello.rb. This generated lots of warnings. I found a solution on the web. Basically it called for removing all the require 'fox16' lines in the programs in gem lib directory. I did this and ran hello.rb without warnings. I then tried running iconlist.rb. The program ran but the folder icons did not display. Instead of the icons there was a box with PNG inside. I added the following code. if FXPNGIcon.supported? puts "SUPPORTED" else puts "NOT SUPPORTED" end The code yielded NOT SUPPORTED I also tried adding icon.create() before returning icon from the loadIcon method. What am I doing wrong? and How do I fix it? Thanks, Ernie From erne at powernav.com Tue Nov 21 00:03:09 2006 From: erne at powernav.com (Ernest Ellingson) Date: Tue, 21 Nov 2006 00:03:09 -0500 Subject: [fxruby-users] FXPNGIcon.new is now working Message-ID: <4562888D.5020206@powernav.com> Hi: After strugling trying to get an email to this formum, I discovered that I had to add png support before compiling fox-1.6.20. Once I downloaded the library compiled and installed it, everything worked fine. By the way the url on the link at the fox tool-kit site for the png library is incorrect. The right url is: http://www.fox-toolkit.org/ftp/libpng-1.2.8.tar.bz2 Thanks, Ernie From philippe.lang at attiksystem.ch Fri Nov 24 05:13:05 2006 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Fri, 24 Nov 2006 11:13:05 +0100 Subject: [fxruby-users] Small typo in keys.rb Message-ID: <6C0CF58A187DA5479245E0830AF84F421D1533@poweredge.attiksystem.ch> Hi Lyle, I found a small typo in keys.rb file: Instead of... KEY_KP_Subtract = 0xFFAD ... I guess we should have KEY_KP_Substract = 0xFFAD Bye --------------- Philippe Lang Attik System -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3125 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20061124/8ca34231/attachment-0001.bin From philippe.lang at attiksystem.ch Fri Nov 24 13:07:36 2006 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Fri, 24 Nov 2006 19:07:36 +0100 Subject: [fxruby-users] Fox Calendar class starting on Monday? Message-ID: <6C0CF58A187DA5479245E0830AF84F421D1535@poweredge.attiksystem.ch> Hi, Has anyone already modified the great calendar class provided with Fox, in order to make the calendar start on Monday? Thanks! --------------- Philippe Lang Attik System -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3125 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20061124/b453ca9b/attachment.bin From gerard.menochet at wanadoo.fr Fri Nov 24 17:52:32 2006 From: gerard.menochet at wanadoo.fr (=?iso-8859-1?Q?G=E9rard_M=E9nochet?=) Date: Fri, 24 Nov 2006 23:52:32 +0100 Subject: [fxruby-users] datatarget.rb program does not Handle interrupts to quit application gracefully wit accelTable.addAccel + Ctrl+q Message-ID: <000b01c7101b$3a0906e0$9d39ca53@youra289dd5720> Any explanations ????? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20061124/b5cdef68/attachment.html From jeroen at fox-toolkit.org Sat Nov 25 09:30:32 2006 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Sat, 25 Nov 2006 08:30:32 -0600 Subject: [fxruby-users] Fox Calendar class starting on Monday? In-Reply-To: <6C0CF58A187DA5479245E0830AF84F421D1535@poweredge.attiksystem.ch> References: <6C0CF58A187DA5479245E0830AF84F421D1535@poweredge.attiksystem.ch> Message-ID: <200611250830.32670.jeroen@fox-toolkit.org> On Friday 24 November 2006 12:07, Philippe Lang wrote: > Hi, > > Has anyone already modified the great calendar class provided with Fox, in order to make the calendar start on Monday? This is comparatively simple to do: FXCalendar=new FXCalendar(...); calendar->setFirstDay(1); Cheers, - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 08:20 11/25/2006 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From sander at knology.net Sat Nov 25 11:51:40 2006 From: sander at knology.net (Sander Jansen) Date: Sat, 25 Nov 2006 10:51:40 -0600 Subject: [fxruby-users] Fox Calendar class starting on Monday? In-Reply-To: <200611250830.32670.jeroen@fox-toolkit.org> References: <6C0CF58A187DA5479245E0830AF84F421D1535@poweredge.attiksystem.ch> <200611250830.32670.jeroen@fox-toolkit.org> Message-ID: <200611251051.40896.sander@knology.net> I think he meant the FXRuby Calendar class, not the new one in FOX 1.7.x. Sander On Saturday 25 November 2006 08:30, Jeroen van der Zijp wrote: > On Friday 24 November 2006 12:07, Philippe Lang wrote: > > Hi, > > > > Has anyone already modified the great calendar class provided with Fox, > > in order to make the calendar start on Monday? > > This is comparatively simple to do: > > FXCalendar=new FXCalendar(...); > > calendar->setFirstDay(1); > > > Cheers, > > > - Jeroen From lyle at knology.net Sat Nov 25 17:12:28 2006 From: lyle at knology.net (Lyle Johnson) Date: Sat, 25 Nov 2006 16:12:28 -0600 Subject: [fxruby-users] Small typo in keys.rb In-Reply-To: <6C0CF58A187DA5479245E0830AF84F421D1533@poweredge.attiksystem.ch> References: <6C0CF58A187DA5479245E0830AF84F421D1533@poweredge.attiksystem.ch> Message-ID: <878F4DF7-E052-4D43-976A-71C9FDA39B3D@knology.net> On Nov 24, 2006, at 4:13 AM, Philippe Lang wrote: > I found a small typo in keys.rb file: > > Instead of... > > KEY_KP_Subtract = 0xFFAD > > ... I guess we should have > > KEY_KP_Substract = 0xFFAD I don't believe that's a typo... From jeroen at fox-toolkit.org Sat Nov 25 20:55:02 2006 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Sat, 25 Nov 2006 19:55:02 -0600 Subject: [fxruby-users] Small typo in keys.rb In-Reply-To: <878F4DF7-E052-4D43-976A-71C9FDA39B3D@knology.net> References: <6C0CF58A187DA5479245E0830AF84F421D1533@poweredge.attiksystem.ch> <878F4DF7-E052-4D43-976A-71C9FDA39B3D@knology.net> Message-ID: <200611251955.03305.jeroen@fox-toolkit.org> On Saturday 25 November 2006 16:12, Lyle Johnson wrote: > > On Nov 24, 2006, at 4:13 AM, Philippe Lang wrote: > > > I found a small typo in keys.rb file: > > > > Instead of... > > > > KEY_KP_Subtract = 0xFFAD > > > > ... I guess we should have > > > > KEY_KP_Substract = 0xFFAD > > I don't believe that's a typo... I looked it up in the Oxford English dictionary. Subtract is correct, but it could be that American English Webster has a different opinion; it may be that old Yanks v.s. the Brits kind of thing... Regards, - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 19:50 11/25/2006 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From philippe.lang at attiksystem.ch Sun Nov 26 12:01:01 2006 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Sun, 26 Nov 2006 18:01:01 +0100 Subject: [fxruby-users] Fox Calendar class starting on Monday? Message-ID: <6C0CF58A187DA5479245E0830AF84F421D1536@poweredge.attiksystem.ch> fxruby-users-bounces at rubyforge.org wrote: > On Saturday 25 November 2006 08:30, Jeroen van der Zijp wrote: >> On Friday 24 November 2006 12:07, Philippe Lang wrote: >>> Hi, >>> >>> Has anyone already modified the great calendar class provided with >>> Fox, in order to make the calendar start on Monday? >> >> This is comparatively simple to do: >> >> FXCalendar=new FXCalendar(...); >> >> calendar->setFirstDay(1); Hi, Yes, sorry, for the misunderstanding, but I meant the FXCalendar class provided with FXRuby... --------------- Philippe Lang Attik System -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3125 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20061126/4160c68d/attachment.bin From stevenq1967 at gmail.com Tue Nov 28 18:59:08 2006 From: stevenq1967 at gmail.com (Steven Quinones-Colon) Date: Tue, 28 Nov 2006 15:59:08 -0800 Subject: [fxruby-users] Problems Message-ID: <73800bf00611281559x4c0fac03se4660ac75d5b1b8@mail.gmail.com> KDE version: 3.5.1-0.1.fc4 Red Hat System: Linux Release: 2.6.16-1.2069_FC4smp Machine: x86_64 ruby 1.8.5 (2006-08-25) [x86_64-linux] fox-1.6.20 I installed FOX to ~/Applications therefore libFOX-1.6.so is at ~/Applications/lib and fox-1.6 is at ~/Applications/include Fox works fine, but... I installed fxruby-1.6.3 and when I do: require 'fox16' I get a ton of these: /usr/people/stevenq/Applications/lib/ruby/site_ruby/1.8/x86_64-linux/fox16.so: warning: already initialized constant ID_SORT_CASE /usr/people/stevenq/Applications/lib/ruby/site_ruby/1.8/x86_64-linux/fox16.so: warning: already initialized constant ID_REFRESH /usr/people/stevenq/Applications/lib/ruby/site_ruby/1.8/x86_64-linux/fox16.so: warning: already initialized constant ID_LAST and fxRuby seems broken, Any ideas? Steven From lyle at knology.net Tue Nov 28 22:24:54 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 28 Nov 2006 21:24:54 -0600 Subject: [fxruby-users] Problems In-Reply-To: <73800bf00611281559x4c0fac03se4660ac75d5b1b8@mail.gmail.com> References: <73800bf00611281559x4c0fac03se4660ac75d5b1b8@mail.gmail.com> Message-ID: On Nov 28, 2006, at 5:59 PM, Steven Quinones-Colon wrote: > I installed fxruby-1.6.3 and when I do: require 'fox16' I get a > ton of these: This bug has been discussed to death on the mailing list; please check the mailing list archives for more information. There's also an open bug report about it, here: http://rubyforge.org/tracker/index.php? func=detail&aid=5633&group_id=300&atid=1223 -- Lyle From brianwisti at yahoo.com Wed Nov 29 02:30:55 2006 From: brianwisti at yahoo.com (Brian Wisti) Date: Tue, 28 Nov 2006 23:30:55 -0800 (PST) Subject: [fxruby-users] Problems Message-ID: <20061129073056.82254.qmail@web53606.mail.yahoo.com> ----- Original Message ---- From: Lyle Johnson To: fxruby-users at rubyforge.org Sent: Tuesday, November 28, 2006 7:24:54 PM Subject: Re: [fxruby-users] Problems On Nov 28, 2006, at 5:59 PM, Steven Quinones-Colon wrote: > I installed fxruby-1.6.3 and when I do: require 'fox16' I get a > ton of these: This bug has been discussed to death on the mailing list; please check the mailing list archives for more information. There's also an open bug report about it, here: http://rubyforge.org/tracker/index.php? func=detail&aid=5633&group_id=300&atid=1223 -- Lyle Hi Lyle, I only found out about this a couple of days ago by digging through the archives myself. I know that this isn't your fault (when _is_ ruby 1.8.6 due out, anyhow?), but would it be possible to make a more prominent mention of it on the fxruby.org site? Maybe just a straight link to the latest release announcement (http://rubyforge.org/forum/forum.php?forum_id=9834) on the front and/or download page? I usually don't worry about announcements or issues, since FXRuby has "just worked" for years, and is continuing to do so now that I've downgraded to Ruby 1.8.4. Keep up the good work, and please be patient with those of us who forget to read the announcements and bug lists when downloading the latest release. :) Kind Regards, Brian Wisti http://coolnamehere.com/