fxruby-users Mailing List for FXRuby (Page 6)
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...> - 2004-06-15 01:15:46
|
Fredrik Jagenheim wrote: > Hi, > > I tried using connect like this: > > 8< > > j = 0 > 3.times { |i| > FXButton.new(self, "Button#{j}").connect(SEL_COMMAND) { > puts "#{j} pressed" > } > j += 1 > } > > >>8 > > > This doesn't work as intended, but if I use the 'i' variable, it does. > I figured it had to do with global/local scope, but I don't grok it > fully. As you guessed, it's not particularly an effect of #connect. It has to do with the way ruby associates bindings with code blocks. Your code generates three closures (closure=code+binding) of the block { puts "#{j} pressed" } and all three of them refer to the same j variable. The string isn't interpolated until you execute the code. By the time the code executes (when you press a button), the value of j is 3. So a "3" gets interpolated in all three strings. I didn't run the code (so I may be completely wrong ;) ), but I've been bitten by this before. Using just "i" instead of "j" is one way around, as you noticed. Another way is to assign the value of j to a new local variable ("k", say) inside the #times block, and use that in the string interpolation. HTH. |
From: Evaldo G. <ev...@ga...> - 2004-06-14 16:38:48
|
Hi! Traditionally, on *nix systems, Display Availability is defined by a target and authentication. the default target display you can get from variable DISPLAY. if its not set, you are probably out of a GUI environment. Another issue is checking authentication, which I will not cover here, but you can read the manpage for Xsecurity(7) :) Cya Evaldo Gardenali - UdontKnow Em Dom, 2004-06-13 =E0s 23:25, Ashley Reed escreveu: > Hi all, >=20 > I'm writing an application using Ruby that has both a text interface and > a GUI (using FXRuby). Can anyone tell me how to know at runtime if > there is no display to use. It seems that when I call FXApp.new(), > control never returns to my code. An error message is printed to the > console, and the program exits. >=20 > Here's the error message. It's not even an exception. > FXRbApp::openDisplay: unable to open display :10 >=20 > If there is no display available, I want to switch to my text interface. >=20 > Thanks, > Ashley |
From: Fredrik J. <fr...@po...> - 2004-06-14 13:23:24
|
Hi, I tried using connect like this: 8< j = 0 3.times { |i| FXButton.new(self, "Button#{j}").connect(SEL_COMMAND) { puts "#{j} pressed" } j += 1 } >8 This doesn't work as intended, but if I use the 'i' variable, it does. I figured it had to do with global/local scope, but I don't grok it fully. It's not really a problem, as a I have a workaround for it; but if someone could please explain the behavour to me, I'd appreciate it. Br, //F |
From: Ashley R. <Ash...@co...> - 2004-06-14 02:25:55
|
Hi all, I'm writing an application using Ruby that has both a text interface and a GUI (using FXRuby). Can anyone tell me how to know at runtime if there is no display to use. It seems that when I call FXApp.new(), control never returns to my code. An error message is printed to the console, and the program exits. Here's the error message. It's not even an exception. FXRbApp::openDisplay: unable to open display :10 If there is no display available, I want to switch to my text interface. Thanks, Ashley |
From: Rich <ri...@li...> - 2004-06-11 01:19:04
|
http://raa.ruby-lang.org/project/ezexerb/ <snippet from the RAA entry> After Exerb (3.2.0) is installed this tool makes the creation of EXE files easier. Support for referencing a Ruby install directory other than the default. EXR and MAK files deleted automatically. User can define a 32x32 4 bit icon to use as the application icon. Nullsoft NSIS packaged installer/uninstaller. Tested on: 98, NT, 2000, and XP 2.0.0 - Release date: 10.06.04 1.1.0 - Release date: 14.05.04 1.0.0 - Release date: 18.02.04 0.9.0 - Release date: 15.02.04 -Richard |
From: Hal F. <ha...@hy...> - 2004-06-07 19:09:54
|
Jordan, Tom wrote: > Hi All: > > Does anyone have a reference for an example on how to do > a simple reordering of TreeItems within a TreeList using the > mouse. > > I really don't need to DND between applications, just > with in a tree itself. Tom, Sorry replying so late. I can't help with this, but I'm also interested in a solution. My uneducated guess is that it could (only) be done currently by handcoding it, and it would require good knowledge of both the TreeList and fxruby's DND. My impression is that f(ox|xruby) doesn't know that intra-app DND is a simpler special case. I think it's all one paradigm. It seems to me it should be possible to design a drop-in replacement for the tree list that enabled the manual moving of items. In fact (waves checkbook), I'd donate $100 to anyone who could do that for me. Ha, this is in the spirit of rentacoder.com, ever seen that site? :) Thanks, Hal |
From: Nigel W. <ni...@wa...> - 2004-06-07 18:57:43
|
Thanks everyone Nigel |
From: TOGoS <chu...@ya...> - 2004-06-07 00:20:53
|
Hi all. I'm trying to use Fox to make a chat program. I want to have a list that displayes messages as they come in. Unfortunately, I'm having trouble getting the FXList to scroll down. Using makeItemVisible doesn't seem to do the trick, and neither does anything else I've tried (setCurrentItem, updateItem, etc). The following script shows the problem by periodically inserting data into a FXText and a FXList, and attempting to scroll to the bottom of each. Works for the text, but not the list. Can anyone help me out? #~/usr/bin/ruby require 'fox' app = Fox::FXApp.new() mainwin = Fox::FXMainWindow.new( app, "FoxTest", NIL,NIL, Fox::DECOR_ALL,128,128,128,64 ) frame = Fox::FXHorizontalFrame.new( mainwin, Fox::LAYOUT_FILL_X| Fox::LAYOUT_FILL_Y ) list = Fox::FXList.new( frame, 0, NIL, 0, Fox::LIST_NORMAL| Fox::LAYOUT_FILL_X| Fox::LAYOUT_FILL_Y, 0,0,64,64 ) textbox = Fox::FXText.new( frame, NIL, 0, Fox::TEXT_READONLY| Fox::LAYOUT_FILL_X| Fox::LAYOUT_FILL_Y ) app.create() mainwin.show() Thread.abort_on_exception = TRUE Thread.new do listendpos = 0 textendpos = 0 while TRUE listendpos = list.appendItem( "foonly #{listendpos}" ) list.makeItemVisible( listendpos ) textbox.appendText( "foonly #{textendpos}\n" ) textendpos = textbox.lineEnd( textbox.getBottomLine() ) textbox.makePositionVisible( textendpos ) sleep(1) end end app.run() __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
From: Lyle J. <ly...@kn...> - 2004-06-06 21:52:13
|
On Jun 6, 2004, at 6:47 AM, Nigel Wilkinson wrote: > Thanks, I've now got it working. Out of curiosity what class does > theDialog.textField return as I have had to use > theDialog.textField.to_s to use it as a string. When you define an attr_accessor for a Ruby class, e.g. class MyClass attr_accessor :foo end it creates a new instance method named "foo" that will allow clients to get or set the value of that instance variable, e.g. anObject = MyClass.new anObject.foo = Bar.new x = anObject.foo So for the dialog box class from your previous example, we had an attr_accessor named "textField", and in the class' initialize method we assigned an FXTextField object to it: @textField = FXTextField.new(...) So when you call: anAddItemDialog.textField it returns a reference to the FXTextField object. To find out about what methods you can call on an FXTextField (or any other FXRuby class), you can consult the on-line documentation at http://www.fxruby.org. For example, here's a direct link to the FXTextField class docs: http://www.fxruby.org/doc/api/classes/Fox/FXTextField.html As shown in the "Attributes" section, the "text" method returns a String containing the FXTextField's text. Because FXTextField is so smart, it also does this when you call the text field's to_s() method. ;) Hope this helps, Lyle |
From: Nigel W. <ni...@wa...> - 2004-06-06 11:47:51
|
--On Sunday, June 06, 2004 03:51:52 +0900 Lyle Johnson <ly...@kn...> wrote: > > On Jun 5, 2004, at 12:41 PM, Nigel Wilkinson wrote: > >> I'm trying to use a dialog box in FXRuby. > > <snip> > > Umm, no. You don't call execute() on the dialog box while you're still > constructing it. Try something like this instead: > > class AddItemDialog < FXDialogBox > # Add an accessor so we can get to the text field later > attr_accessor :textField > > def initialize(owner) > ... as before, but... > @textField = FXTextField.new(...) > end > def create > ... as before ... > end > end > > and then invoke it like this: > > theDialog = AddItemDialog.new(someWindow) > if theDialog.execute != 0 > puts theDialog.textField > end > > Hope this helps, > > Lyle > Thanks, I've now got it working. Out of curiosity what class does theDialog.textField return as I have had to use theDialog.textField.to_s to use it as a string. Cheers Nigel |
From: Lyle J. <ly...@kn...> - 2004-06-05 18:51:48
|
On Jun 5, 2004, at 12:41 PM, Nigel Wilkinson wrote: > I'm trying to use a dialog box in FXRuby. OK. > I have a class set up as follows <snip> > When invoked I get the dialog that closes when either of the buttons > is pressed and return a 1 or a 0 depending on which button is pressed. Yes, looks good. > What I want to do is capture the text in the text field so i tried <snip> Umm, no. You don't call execute() on the dialog box while you're still constructing it. Try something like this instead: class AddItemDialog < FXDialogBox # Add an accessor so we can get to the text field later attr_accessor :textField def initialize(owner) ... as before, but... @textField = FXTextField.new(...) end def create ... as before ... end end and then invoke it like this: theDialog = AddItemDialog.new(someWindow) if theDialog.execute != 0 puts theDialog.textField end Hope this helps, Lyle |
From: Steve T. <STU...@MU...> - 2004-06-02 13:37:46
|
Oops my mistake, I guess I just posted this too fast..... > -----Original Message----- > From: RLMuller [mailto:RLM...@Co...] > Sent: Tuesday, June 01, 2004 9:26 PM > To: fxr...@li... > Subject: Re: [Fxruby-users] FXScrollArea > > > How'd you get Steve's code to work. I tried it and it barfed > on require > "myfoxcal". > > I searched Google for myfoxcal and got nothing. I searched > my Ruby 1.8 > installation: again, nothing. > > Regards, > Richard > > ----- Original Message ----- > From: "Fredrik Jagenheim" <fr...@po...> > To: <fxr...@li...> > Sent: Tuesday, June 01, 2004 4:52 PM > Subject: Re: [Fxruby-users] FXScrollArea > > > > On Tue, Jun 01, 2004 at 03:04:10PM -0500, Steve Tuckner wrote: > > > Here is a sample of a scroll area that adds and deletes controls. > Hope > this > > > helps. > > > > It did, without answering my question. :) > > > > I thought that I had to use FXScrollArea, and FXScrollWindow was for > > toplevel windows. But after looking at your code, I realized that it > > was FXScrollWindow I really wanted. > > > > Thanks, > > //F > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by the new InstallShield X. > > From Windows to Linux, servers to mobile, InstallShield X is the one > > installation-authoring solution that does it all. Learn more and > > evaluate today! http://www.installshield.com/Dev2Dev/0504 > > _______________________________________________ > > Fxruby-users mailing list > > Fxr...@li... > > https://lists.sourceforge.net/lists/listinfo/fxruby-users > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users |
From: RLMuller <RLM...@Co...> - 2004-06-02 05:03:41
|
Hi Fredrik, > However, just remove the <require 'myfoxcal'> line and > the line with <MyDateTime> and it will run. > > HTH, It certainly did! Thanks, a lot. Regards, Richard --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 |
From: Fredrik J. <fr...@po...> - 2004-06-02 04:49:07
|
On Tue, Jun 01, 2004 at 10:25:38PM -0400, RLMuller wrote: > How'd you get Steve's code to work. I tried it and it barfed on require > "myfoxcal". > It wasn't so much the running of the code, but seeing that he used FXScrollWindow instead of FXScrollArea. However, just remove the <require 'myfoxcal'> line and the line with <MyDateTime> and it will run. HTH, //F |
From: RLMuller <RLM...@Co...> - 2004-06-02 02:28:52
|
How'd you get Steve's code to work. I tried it and it barfed on require "myfoxcal". I searched Google for myfoxcal and got nothing. I searched my Ruby 1.8 installation: again, nothing. Regards, Richard ----- Original Message ----- From: "Fredrik Jagenheim" <fr...@po...> To: <fxr...@li...> Sent: Tuesday, June 01, 2004 4:52 PM Subject: Re: [Fxruby-users] FXScrollArea > On Tue, Jun 01, 2004 at 03:04:10PM -0500, Steve Tuckner wrote: > > Here is a sample of a scroll area that adds and deletes controls. Hope this > > helps. > > It did, without answering my question. :) > > I thought that I had to use FXScrollArea, and FXScrollWindow was for > toplevel windows. But after looking at your code, I realized that it > was FXScrollWindow I really wanted. > > Thanks, > //F > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 |
From: Fredrik J. <fr...@po...> - 2004-06-01 20:53:06
|
On Tue, Jun 01, 2004 at 03:04:10PM -0500, Steve Tuckner wrote: > Here is a sample of a scroll area that adds and deletes controls. Hope this > helps. It did, without answering my question. :) I thought that I had to use FXScrollArea, and FXScrollWindow was for toplevel windows. But after looking at your code, I realized that it was FXScrollWindow I really wanted. Thanks, //F |
From: Steve T. <STU...@MU...> - 2004-06-01 20:04:25
|
Here is a sample of a scroll area that adds and deletes controls. Hope this helps. Steve Tuckner -------------------------------------------- require "fox" require "myfoxcal" include Fox class FxTestWindow < FXMainWindow TIMER_INTERVAL = 20 def initialize(app) # Invoke base class initialize first super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, 600, 600) i = 1 @buttons = [] outsideFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) horzFrame = FXHorizontalFrame.new(outsideFrame, LAYOUT_FILL_X|LAYOUT_FILL_Y) FXButton.new(horzFrame, "Add Control").connect(SEL_COMMAND) do $stdout.print "button pressed\n" $stdout.flush v = FXButton.new(@contentFrame, "Button #{i}") v.create @contentFrame.recalc @buttons.push(v) $stdout.print "v = #{v}\n" $stdout.flush i += 1 @timer = getApp().addTimeout(TIMER_INTERVAL, method(:onTimeout)) end FXButton.new(horzFrame, "Remove Control").connect(SEL_COMMAND) do button = @buttons[0] @buttons = @buttons[1..@buttons.size-1] @contentFrame.removeChild(button) end @scrollFrame = FXScrollWindow.new(outsideFrame, LAYOUT_FILL_X|LAYOUT_FILL_Y) @contentFrame = FXVerticalFrame.new(@scrollFrame, LAYOUT_FILL_X|LAYOUT_FILL_Y) FXText.new(@contentFrame, nil, 0, LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, 0, 0, 200, 100) dtzone=MyDateTime.new(@contentFrame, 100,100); end def onTimeout(*args) @scrollFrame.setPosition(0,-(@scrollFrame.contentHeight)) end # Start def create super show(PLACEMENT_SCREEN) end end def runGUI puts "before FXApp.new" # Make an application $application = FXApp.new("Dialog", "FxWorld") # Open the display $application.init(ARGV) # Construct the application's main window FxTestWindow.new($application) # Create the application $application.create # Run the application $application.run end puts "before runGUI" runGUI > -----Original Message----- > From: Fredrik Jagenheim [mailto:fr...@po...] > Sent: Tuesday, June 01, 2004 1:30 PM > To: fxruby > Subject: [Fxruby-users] FXScrollArea > > > Hi, another newbie question... > > How do I use FXScrollArea? > > I had hoped that it would be enough to add a layout manager as a child > to the ScrollArea, but it just draws a white area. How do I add > contents to my area? > > Thanks in advance, > //F > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... > Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users |
From: Fredrik J. <fr...@po...> - 2004-06-01 18:30:52
|
Hi, another newbie question... How do I use FXScrollArea? I had hoped that it would be enough to add a layout manager as a child to the ScrollArea, but it just draws a white area. How do I add contents to my area? Thanks in advance, //F |
From: Igor D. <idi...@ma...> - 2004-06-01 14:19:26
|
T24gVHVlLCAxIEp1biAyMDA0IDA4OjM1OjM1IC0wNTAwDQpqZXJvZW4gPGplcm9lbkBmb3gtdG9v bGtpdC5jb20+IHdyb3RlOg0KDQo+IEZPWCAxLjIueCBpcyB0aGUgc3RhYmxlIHZlcnNpb24sIHll cy4NCg0KOikNCg0KPiBGb3IgRlhSdWJ5LCB5b3Ugd2lsbCBuZWVkIHRvIHVzZSBGT1ggMS4wICh0 aGUgcHJldmlvdXMgc3RhYmxlDQo+IHZlcnNpb24pLCBhdCBsZWFzdCB1bnRpbCBMeWxlIGlzIHRo cm91Z2ggd2l0aCB0aGUgRlhSdWJ5IDEuMiB3aGljaA0KPiBzaG91bGQgYmUgcmVhZHkgc29tZXRp bWUgdGhpcyBtb250aCBhcyBJIHVuZGVyc3RhbmQgaXQuDQoNCkknbGwgYmUgd2FpdGluZy4gSG93 IG1hbnkgdG9vbHMgd29ya3Mgd2l0aCBGWFJ1Ynk/IEkgbmV3IGluIEVtYWNzIChhbmQNCm5vdCBz byBpbiBMaW51eCkgYnV0IEkgc2ltcGzVIGhhdmUgZXhlY3V0ZWQgdGNsLXNjcmlwdHMuIFdpdGgg UnVieSBJDQpjYW4ndCBkbyB0aGlzIDooIChvciBjYW4uLi4gOi8pLg0KDQotLSANCkJlc3QgcmVn YXJkcywNCiAgIElnb3IgRGlka292c2t5DQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09DQoNCiAgICAgIElDUTogMTIxNzAxMTA0DQogICAgICBXZWI6IGh0dHA6Ly9sYW5nb3Mu bHJuLnJ1DQoNCktleXNlcnZlcjogaGtwOi8va2V5c2VydmVyLmtqc2wuY29tDQogICAgS2V5SUQ6 IDB4ODMzMzgwQjANCg== |
From: jeroen <je...@fo...> - 2004-06-01 12:33:36
|
On Tuesday 01 June 2004 12:47 am, Igor Didkovsky wrote: > Can I download fxruby for fox-1.2.1 ? Is fox-1.2.1 stable version? FOX 1.2.x is the stable version, yes. For FXRuby, you will need to use FOX 1.0 (the previous stable version), at least until Lyle is through with the FXRuby 1.2 which should be ready sometime this month as I understand it. - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |
From: Igor D. <idi...@ma...> - 2004-06-01 05:47:45
|
Can I download fxruby for fox-1.2.1 ? Is fox-1.2.1 stable version? -- Best regards, Igor Didkovsky ===================================== ICQ: 121701104 Web: http://langos.lrn.ru Keyserver: hkp://keyserver.kjsl.com KeyID: 0x833380B0 |
From: Jordan, T. <Tom...@ca...> - 2004-05-28 15:35:48
|
Hi All: Does anyone have a reference for an example on how to do a simple reordering of TreeItems within a TreeList using the mouse. I really don't need to DND between applications, just with in a tree itself. Thanks, -- Tom. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004 This e-mail or the documents accompanying this e-mail contain information that may be confidential and/or privileged. It may also be prohibited from disclosure under applicable law. The information is intended to be for the use of the individual or entity named on this transmission. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is without authorization and is prohibited. If you have received this e-mail in error, please notify us immediately so that we can take action to correct the problem. |
From: Fredrik J. <fr...@po...> - 2004-05-28 11:11:08
|
On Fri, May 28, 2004 at 11:27:37AM +0200, Simon Strandgaard wrote: > Fredrik Jagenheim <fr...@po...> wrote: > > I can't figure out the correct arguments to the baseclass initialize: > > What about ? > super(owner, "Title", nil, nil, DECOR_ALL, 0, 0, 640, 480, 0, 0, 0, 0, 0, 0) Worked perfectly, thanks. //F |
From: Simon S. <ne...@ad...> - 2004-05-28 09:32:00
|
Fredrik Jagenheim <fr...@po...> wrote: > I don't want it as a dialog, so I figured I had to use FXTopWindow > instead. But I can't figure out the correct arguments to the baseclass > initialize: > matrixWindow.rb:9:in `initialize': No matching function for overloaded > 'new_FXTopWindow' (ArgumentError) What about ? class MyTop < FXTopWindow def initialize(owner) super(owner, "Title", nil, nil, DECOR_ALL, 0, 0, 640, 480, 0, 0, 0, 0, 0, 0) end ... end -- Simon Strandgaard |
From: Fredrik J. <fr...@po...> - 2004-05-28 09:23:24
|
Hi, I'm trying to create a new window from my MainWindow; but I can't figure out how. I don't want it as a dialog, so I figured I had to use FXTopWindow instead. But I can't figure out the correct arguments to the baseclass initialize: matrixWindow.rb:9:in `initialize': No matching function for overloaded 'new_FXTopWindow' (ArgumentError) So, perhaps there is no initialize, since it's an abstract class, so I remove the 'super' call: matrixWindow.rb:13:in `initialize': This FXComposite * already released (RuntimeError) Obviously, calling initialize is required somehow. Am I mistaken when trying to use FXTopWindow? Perhaps I can use FXDialogBox without it telling my WindowManager that it's a dialog? Tia, //F |