From dglnz at yahoo.com Mon Aug 10 04:07:59 2009 From: dglnz at yahoo.com (dave L) Date: Mon, 10 Aug 2009 01:07:59 -0700 (PDT) Subject: [fxruby-users] foxGUI - textfieldTextStyle Message-ID: <646618.44060.qm@web30008.mail.mud.yahoo.com> I have just come across the Textfield_Limited option. I would like to get an understanding on how and why it is used. Could anyone give me a scenario of it's use? I am thinking of using it like this. I have a login screen and it contains a label, textfield and button. the textfield has the password option checked so asterisks appear and would like to use the Textfield_Limited as a check to ensure the user enters X characters in for a password thus saving me from doing the test myself. Is this what it's use is for? I have another textfield where i am wanting to restrict the characters to 10 no more no less before allowing the user to proceed on (currently this is done via a length test) when the user presses enter on the keyboard (note there are no buttons! on this particular window). Cheers, Dave. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn.bergqvist at gmail.com Wed Aug 12 16:14:15 2009 From: bjorn.bergqvist at gmail.com (=?ISO-8859-1?Q?Bj=F6rn_Bergqvist?=) Date: Wed, 12 Aug 2009 22:14:15 +0200 Subject: [fxruby-users] Ruby 1.9 speedup Message-ID: <44936e730908121314t32b9a9b6g4d78dc7e70159123@mail.gmail.com> Hello, I have tested ruby 1.9 and notice a speedup of 2 to 3 when running my app: http://www.discretizer.org I'm very happy and just had to change a few things (an atan that went Complex and maybe something more). Regards Bj?rn Bergqvist www.discretizer.org _________________________________________________________ One test I made with a normal test case (read file, and export mesh): ruby 1.8.7p174 -Real time 1m33.665s 1m33.733s 1m33.649s ruby 1.9.1-p243 -Real time 0m46.481s 0m41.844s 0m41.830s From lyle at lylejohnson.name Thu Aug 20 10:16:56 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 20 Aug 2009 09:16:56 -0500 Subject: [fxruby-users] Updating rows in a table In-Reply-To: References: Message-ID: <57cf8f720908200716r3de88f4cs59d3c99dcc1c8b8f@mail.gmail.com> On Thu, Aug 20, 2009 at 4:18 AM, Martin Hawkins wrote: > I'm loading data from a SQL table using activerecord and displaying it in a > table. At the moment I'm iterating through the table,so the code is as > follows: > I want to be able to edit, add and delete. Using SEL_REPLACED I can detect > when a cell has been edited and so can update the record based on row and > column position. This is not good enough as the SQL table entries are not necessarily > unique. I don't understand what the fact that SQL table entries aren't necessarily unique has to do with it. When a table cell is edited, the table sends a SEL_REPLACED message to its target, and the message data is an FXTableRange instance indicating which cell(s) were modified. So you should be able to do something like this to determine which row and column was edited: table.connect(SEL_REPLACED) do |sender, sel, table_range| puts "finished editing the cell at row=#{fm.row}, col=#{fm.col}" end Hope this helps, Lyle From martin.hawkins at gmail.com Thu Aug 20 11:34:55 2009 From: martin.hawkins at gmail.com (Martin Hawkins) Date: Thu, 20 Aug 2009 08:34:55 -0700 (PDT) Subject: [fxruby-users] Updating rows in a table In-Reply-To: <57cf8f720908200716r3de88f4cs59d3c99dcc1c8b8f@mail.gmail.com> References: <57cf8f720908200716r3de88f4cs59d3c99dcc1c8b8f@mail.gmail.com> Message-ID: Lyle, Thanks for the reply. It's about keeping the SQL table and the FX table in sync. My sql table is sorted by last name and the table ids don't match up with the row numbers in the fx_table. I've created a column which is 0 wide that contains the sql_id so that when I identify the item that's been modified (using the row and column information from SEL_REPLACED, as you suggest), I know which SQL table row to update. I then pull back the data from the SQL table so that the edited name is in the correct position and re-draw the table. The edited name is then highlighted using makPositionVisible and setCurrentItem. I saw FXDataTarget and was hoping that the rather clunky code I've got could be made a lot neater by using it, rather like cocoa bindings I suppose. I see that FXDataTarget can't be used with an Array so guess I'm stuck with my sledgehammer approach. On Aug 20, 3:16?pm, Lyle Johnson wrote: > On Thu, Aug 20, 2009 at 4:18 AM, Martin Hawkins wrote: > > I'm loading data from a SQL table using activerecord and displaying it in a > > table. At the moment I'm iterating through the table,so the code is as > > follows: > > > > > I want to be able to edit, add and delete. Using SEL_REPLACED I can detect > > when a cell has been edited and so can update the record based on row and > > column position. This is not good enough as the SQL table entries are not necessarily > > unique. > > I don't understand what the fact that SQL table entries aren't > necessarily unique has to do with it. When a table cell is edited, the > table sends a SEL_REPLACED message to its target, and the message data > is an FXTableRange instance indicating which cell(s) were modified. So > you should be able to do something like this to determine which row > and column was edited: > > ? ? table.connect(SEL_REPLACED) do |sender, sel, table_range| > ? ? ? puts "finished editing the cell at row=#{fm.row}, col=#{fm.col}" > ? ? end > > Hope this helps, > > Lyle > _______________________________________________ > fxruby-users mailing list > fxruby-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/fxruby-users From martin.hawkins at gmail.com Thu Aug 20 12:18:23 2009 From: martin.hawkins at gmail.com (Martin Hawkins) Date: Thu, 20 Aug 2009 09:18:23 -0700 (PDT) Subject: [fxruby-users] Updating rows in a table In-Reply-To: References: Message-ID: <142398cf-2426-4cbf-982d-c1d8ded0e3e2@k30g2000yqf.googlegroups.com> Phillipe, Many thanks for the suggestion. The idea of adding a 'cancel all changes option' is an interesting one and the commit at the end of all of all the changes would certainly make coding easier and neater and response times shorter as the tables grow. On Aug 20, 10:54?am, "Philippe Lang" wrote: > Hi Martin, > > I'm not sure it's the best idea to update your data while the user is working with the GUI. I think you have better let the user fill and change your table, and commit all the changes at the end, by comparing the activerecord content, and your table content. This way, you get an extra feature as well: the ability the CANCEL all the changes made to the table. > > When doing the comparison, you basically have to do 3 different things: > > 1) Detect that a line was deleted in the table, and delete the record properly. > > 2) Detect that a line was inserted in the table, and insert the record properly. > > 3) Detect tha a line was update in the table (one or more columns), and update the record properly. > > I suggest you use in the table a column that stores your record id. You can make it invisible if you want. > > This is how we do it inhttp://www.attiksystem.ch/beerp/beerp-the-fxruby-erp/. It works just fine. > > Good luck! > > Philippe Lang > Attik System > > ? _____ ? > > De : fxruby-users-boun... at rubyforge.org [mailto:fxruby-users-boun... at rubyforge.org] De la part de Martin Hawkins > Envoy? : jeudi, 20. ao?t 2009 11:18 > ? : fxruby-us... at rubyforge.org > Objet : [fxruby-users] Updating rows in a table > > I'm new to using fxruby, so please excuse any daft questions. > > I'm loading data from a SQL table using activerecord and displaying it in a table. At the moment I'm iterating through the table,so the code is as follows: > > def initialize(app) > ? super(app, "Library", :width => 600, :height => 400) > ? @authors = Author.find(:all) > ? table = FXTable.new(self, :opts => LAYOUT_FILL|TABLE_COL_SIZABLE) > ? table.setTableSize(@authors.length, 2) > ? table.rowHeaderMode = LAYOUT_FIX_WIDTH > ? table.rowHeaderWidth = 0 > ? table.setColumnText( 0, "Last Name") > ? table.setColumnText( 1, "First Name") > ? r, c = 0, 0 > ? @authors.each do |author| > ? ?table.setItemText(r, c, author.author_last_name) > ? ?table.setItemJustify(r, c, FXTableItem::LEFT) > ? ?table.setItemText(r, c + 1, author.author_first_name) > ? ?table.setItemJustify(r, c + 1, FXTableItem::LEFT) > ? ?r += 1 > ? end > end > > I want to be able to edit, add and delete. Using SEL_REPLACED I can detect when a cell has been edited and so can update the record based on row and column position. > This is not good enough as the SQL table entries are not necessarily unique. > I presume that I'm supposed to use FXDataTarget - but I'm really not sure how. > I haven't even started looking at add and delete. > Any pointers would be greatly appreciated. > Martin > > _______________________________________________ > fxruby-users mailing list > fxruby-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/fxruby-users From lyle at lylejohnson.name Thu Aug 20 13:35:20 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 20 Aug 2009 12:35:20 -0500 Subject: [fxruby-users] Updating rows in a table In-Reply-To: References: <57cf8f720908200716r3de88f4cs59d3c99dcc1c8b8f@mail.gmail.com> Message-ID: On Aug 20, 2009, at 10:34 AM, Martin Hawkins wrote: > It's about keeping the SQL table and the FX table in sync. Oh, OK. Yes, you'll need to do something to keep track of which table row is associated with which database record. Instead of storing the sql_id in an invisible column, you could maybe store the sql_id in the table item's "data" field, e.g. table.setItemData(r, c, author.sql_id) and then later: sql_id = table.getItemData(table_range.fm.row, table_range.fm.col) Hope this helps, Lyle From dglnz at yahoo.com Fri Aug 21 22:55:22 2009 From: dglnz at yahoo.com (dave L) Date: Fri, 21 Aug 2009 19:55:22 -0700 (PDT) Subject: [fxruby-users] putting in a tabbed spacing into a list Message-ID: <418381.93967.qm@web30005.mail.mud.yahoo.com> I am using foxGUI to help me speed up the GUI design. I have got 8 items I'd like to have entered in each row but have them put in columns. I don't know how (due to limited ruby knowledge) to mix FXruby and foxGUI controls (or if this can be done). FoxGUI doesn't have a table control and i do not know if list has a column property for this use. i want to have text put in row and column formation (making it easier to read and find data) than having the text at variable positions due to the length of the text on the row. if all else fails i will create enough list controls and place them across the screen so that i can get the same effect but this seems a bit much. Can wiser heads help me with my problem? I do hope i have explained myself well. dave. -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.hawkins at gmail.com Mon Aug 24 07:08:46 2009 From: martin.hawkins at gmail.com (Martin Hawkins) Date: Mon, 24 Aug 2009 04:08:46 -0700 (PDT) Subject: [fxruby-users] Displaying a quicktime movie in an fxruby app Message-ID: I want to be able to capture video from an attached camera and display it as part of the UI. Is this possible and if so, which widget should I use? thx From dglnz at yahoo.com Tue Aug 25 06:56:53 2009 From: dglnz at yahoo.com (dave L) Date: Tue, 25 Aug 2009 03:56:53 -0700 (PDT) Subject: [fxruby-users] Best way to brake up a string within FXruby? Message-ID: <55879.6461.qm@web30001.mail.mud.yahoo.com> Hi I have a string inside a FXList that is seperated into columns by spaces. I will have a need to put this data into editable controls when ever the user clicks on a line. I thought of using the ruby split(' ') command. The way i was going to do this was to have it setup like this... control.text, control.text... = ALine.split(' ') but i got a error referring to split as being private! Is there a better way of doing this? I have googled but for the present i have not found anything meaningful. anyone able to help? dave. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dglnz at yahoo.com Tue Aug 25 08:00:17 2009 From: dglnz at yahoo.com (dave L) Date: Tue, 25 Aug 2009 05:00:17 -0700 (PDT) Subject: [fxruby-users] to get the system date / time? Message-ID: <217307.93977.qm@web30002.mail.mud.yahoo.com> I would like to be able to get the PC system date/time as you can in ruby. not exactly sure why i'm not getting it currently! I'm doing this at the moment. mydate = Date mytime = Time these failed so added a .now and it still failed!!! looked at the fxruby Rdoc site and found no luck their as yet (and googled)! dave. -------------- next part -------------- An HTML attachment was scrubbed... URL: From natarajsn at gmail.com Tue Aug 25 08:10:53 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Tue, 25 Aug 2009 17:40:53 +0530 Subject: [fxruby-users] to get the system date / time? In-Reply-To: <217307.93977.qm@web30002.mail.mud.yahoo.com> References: <217307.93977.qm@web30002.mail.mud.yahoo.com> Message-ID: <630286c70908250510m1114c152ib0bf82cf63d507e7@mail.gmail.com> Hi Try this require 'date' @appldate= FXDataTarget.new(Date.today().to_s) FXLabel.new(frame, "APPL Date",:opts => JUSTIFY_LEFT|LAYOUT_FILL_X) FXTextField.new(frame, 10, at appldate, FXDataTarget::ID_VALUE) do |theTextField| theTextField.layoutHints = LAYOUT_FIX_X|LAYOUT_FIX_Y theTextField.text=@appldate.value end regards Nataraj On Tue, Aug 25, 2009 at 5:30 PM, dave L wrote: > I would like to be able to get the PC system date/time as you can in ruby. > > not exactly sure why i'm not getting it currently! > > I'm doing this at the moment. > > mydate = Date > mytime = Time > > these failed so added a .now and it still failed!!! > > looked at the fxruby Rdoc site and found no luck their as yet (and googled)! > > dave. > > Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail, New Zealand's new > email address. > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From davidm at astro.berkeley.edu Tue Aug 25 11:54:44 2009 From: davidm at astro.berkeley.edu (David MacMahon) Date: Tue, 25 Aug 2009 08:54:44 -0700 Subject: [fxruby-users] Best way to brake up a string within FXruby? In-Reply-To: <55879.6461.qm@web30001.mail.mud.yahoo.com> References: <55879.6461.qm@web30001.mail.mud.yahoo.com> Message-ID: <2E739428-ACA2-47D5-B1C2-73BADE673386@astro.berkeley.edu> On Aug 25, 2009, at 3:56 , dave L wrote: > The way i was going to do this was to have it setup like this... > > control.text, control.text... = ALine.split(' ') > > but i got a error referring to split as being private! Are you sure ALine is a String? Dave From dglnz at yahoo.com Tue Aug 25 17:17:52 2009 From: dglnz at yahoo.com (dave L) Date: Tue, 25 Aug 2009 14:17:52 -0700 (PDT) Subject: [fxruby-users] Best way to brake up a string within FXruby? Message-ID: <153169.32689.qm@web30005.mail.mud.yahoo.com> Nataraj S Narayan & David MacMahon, Thanks for your quick reply. David, Yes Aline is a string as it is actually obtained from fxlist and has data like Job No, Date, Time (PC system obtained) plus other entries but i am wanting to ADD to the list. Nataraj, Didn't think of doing this! as i'd just thought these would be in as a system function of FXruby. Lession learnt :) many thanks to you both. Dave --- On Wed, 26/8/09, David MacMahon < References: <217307.93977.qm@web30002.mail.mud.yahoo.com> Message-ID: <4A93DA04.8090600@tarazed.demon.co.uk> dave L wrote: > I would like to be able to get the PC system date/time as you can in ruby. > > not exactly sure why i'm not getting it currently! > > I'm doing this at the moment. > > mydate = Date > mytime = Time > > these failed so added a .now and it still failed!!! > > looked at the fxruby Rdoc site and found no luck their as yet (and > googled)! > > dave. > > > Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail > , > New Zealand's new email address. > > ------------------------------------------------------------------------ Have you got require 'date' in your header section? I have this in one of my non FX scripts: Today = (DateTime.now).to_s.slice( 0, 10 ).tr( '-', ' ' ) to get the year, month and day. Len From dglnz at yahoo.com Wed Aug 26 18:13:14 2009 From: dglnz at yahoo.com (dave L) Date: Wed, 26 Aug 2009 15:13:14 -0700 (PDT) Subject: [fxruby-users] to get the system date / time? In-Reply-To: <4A93DA04.8090600@tarazed.demon.co.uk> Message-ID: <716327.54677.qm@web30008.mail.mud.yahoo.com> Len, Many thanks, two two others sent me similar pointers and i had taken it for granted that FXruby might have had it's own datetime handling routines - Doh light has since switched on Dave. --- On Wed, 26/8/09, Len Lawrence wrote: > From: Len Lawrence > Subject: Re: [fxruby-users] to get the system date / time? > To: fxruby-users at rubyforge.org > Received: Wednesday, 26 August, 2009, 12:33 AM > dave L wrote: > > I would like to be able to get the PC system date/time > as you can in ruby. > > > > not exactly sure why i'm not getting it currently! > > > > I'm doing this at the moment. > > > > mydate = Date > > mytime = Time > > > > these failed so added a .now and it still failed!!! > > > > looked at the fxruby Rdoc site and found no luck their > as yet (and > > googled)! > > > > dave. > > > > > > Email slow, clunky, unreliable? Switch to Yahoo!Xtra > Mail > > , > > > New Zealand's new email address. > > > > > ------------------------------------------------------------------------ > Have you got > > require 'date' > > in your header section? > > I have this in one of my non FX scripts: > > Today = (DateTime.now).to_s.slice( 0, 10 ).tr( '-', ' ' ) > > to get the year, month and day. > > Len > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From jkinsella at ancillaryservices.com Wed Aug 26 18:49:40 2009 From: jkinsella at ancillaryservices.com (jkinsella at ancillaryservices.com) Date: Wed, 26 Aug 2009 22:49:40 +0000 Subject: [fxruby-users] to get the system date / time? Message-ID: <1543103695-1251326975-cardhu_decombobulator_blackberry.rim.net-862974132-@bxe1060.bisx.prod.on.blackberry> I'm not 100% sure, but you should be able to just do: require 'time' my_date = Date.now my_time = Time.now ------Original Message------ From: Len Lawrence Sender: fxruby-users-bounces at rubyforge.org To: fxruby-users at rubyforge.org ReplyTo: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] to get the system date / time? Sent: Aug 25, 2009 8:33 AM dave L wrote: > I would like to be able to get the PC system date/time as you can in ruby. > > not exactly sure why i'm not getting it currently! > > I'm doing this at the moment. > > mydate = Date > mytime = Time > > these failed so added a .now and it still failed!!! > > looked at the fxruby Rdoc site and found no luck their as yet (and > googled)! > > dave. > > > Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail > , > New Zealand's new email address. > > ------------------------------------------------------------------------ Have you got require 'date' in your header section? I have this in one of my non FX scripts: Today = (DateTime.now).to_s.slice( 0, 10 ).tr( '-', ' ' ) to get the year, month and day. Len _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users From dglnz at yahoo.com Wed Aug 26 22:31:02 2009 From: dglnz at yahoo.com (dave L) Date: Wed, 26 Aug 2009 19:31:02 -0700 (PDT) Subject: [fxruby-users] to get the system date / time? In-Reply-To: <1543103695-1251326975-cardhu_decombobulator_blackberry.rim.net-862974132-@bxe1060.bisx.prod.on.blackberry> Message-ID: <816598.28289.qm@web30005.mail.mud.yahoo.com> Yes I have since found out from my 1st posting for help that I had to require date in and so time too. Have a need also to split text from a FXList into other controls (allow data to be changed) and bashed my head as i thought i'd have to invent the wheel again not thinking about just requiring string to do the heavy lifting for me). So i have now been able to kill more birds with the one call for help. By the way have you played with foxGUI? I'm very much a noob with both ruby, FXruby and foxGUI. but making head way in 2 steps forward 1 back. many thanks for your relpy. Dave. PS sending this to you personnally as posting to list won't enlighten other anymore than what has been posted on my date/time question and reply to date, BUT I am interested in hearing back from you on the foxGUI as i'd like to get someone with more experiance to help me with some problems i have with it. --- On Thu, 27/8/09, jkinsella at ancillaryservices.com wrote: > From: jkinsella at ancillaryservices.com > Subject: Re: [fxruby-users] to get the system date / time? > To: fxruby-users at rubyforge.org > Received: Thursday, 27 August, 2009, 10:49 AM > I'm not 100% sure, but you should be > able to just do: > > require 'time' > > my_date = Date.now > my_time = Time.now > ------Original Message------ > From: Len Lawrence > Sender: fxruby-users-bounces at rubyforge.org > To: fxruby-users at rubyforge.org > ReplyTo: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] to get the system date / time? > Sent: Aug 25, 2009 8:33 AM > > dave L wrote: > > I would like to be able to get the PC system date/time > as you can in ruby. > > > > not exactly sure why i'm not getting it currently! > > > > I'm doing this at the moment. > > > > mydate = Date > > mytime = Time > > > > these failed so added a .now and it still failed!!! > > > > looked at the fxruby Rdoc site and found no luck their > as yet (and > > googled)! > > > > dave. > > > > > > Email slow, clunky, unreliable? Switch to Yahoo!Xtra > Mail > > , > > > New Zealand's new email address. > > > > > ------------------------------------------------------------------------ > Have you got > > require 'date' > > in your header section? > > I have this in one of my non FX scripts: > > Today = (DateTime.now).to_s.slice( 0, 10 ).tr( '-', ' ' ) > > to get the year, month and day. > > Len > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From lcl at tarazed.demon.co.uk Thu Aug 27 03:12:46 2009 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Thu, 27 Aug 2009 08:12:46 +0100 Subject: [fxruby-users] to get the system date / time? In-Reply-To: <816598.28289.qm@web30005.mail.mud.yahoo.com> References: <816598.28289.qm@web30005.mail.mud.yahoo.com> Message-ID: <4A9631EE.6070105@tarazed.demon.co.uk> dave L wrote: > Yes I have since found out from my 1st posting for help that I had to require date in and so time too. > > Have a need also to split text from a FXList into other controls (allow data to be changed) and bashed my head as i thought i'd have to invent the wheel again not thinking about just requiring string to do the heavy lifting for me). > > So i have now been able to kill more birds with the one call for help. > > By the way have you played with foxGUI? > > I'm very much a noob with both ruby, FXruby and foxGUI. > > but making head way in 2 steps forward 1 back. > > many thanks for your relpy. > > Dave. > > PS sending this to you personnally as posting to list won't enlighten other anymore than what has been posted on my date/time question and reply to date, BUT I am interested in hearing back from you on the foxGUI as i'd like to get someone with more experiance to help me with some problems i have with it. > > Sorry Dave, I don't have any experience with foxGUI. I have actually stopped using FOX altogether and gone back to using Tk. 18 years experience with Tcl/Tk so it was natural to adopt RubyTk. fxruby fits in better with the object hierarchy of Ruby but Tk has functionality which hardly exists in other graphic toolkits and which I need every day, like an intuitive listbox and the peerless TkCanvas. Good luck with the learning curve. I have been programming for 46 years but am still on the learning curve. Like you it is still 2 steps forward and 1 back, or even +3 -2. Len From matma.rex at gmail.com Thu Aug 27 12:32:09 2009 From: matma.rex at gmail.com (Bartosz Dz.) Date: Thu, 27 Aug 2009 18:32:09 +0200 Subject: [fxruby-users] Best way to brake up a string within FXruby? In-Reply-To: <7EFF85E1-CEEE-49D3-88EB-BD7986B3D4F8@lylejohnson.name> References: <104279.80938.qm@web30003.mail.mud.yahoo.com> <7EFF85E1-CEEE-49D3-88EB-BD7986B3D4F8@lylejohnson.name> Message-ID: Maybe it's stupid, but did you try to just make *sure* it's string by calling its to_s method? -- Matma Rex - http://matma-rex.prv.pl/ From soumyanath.c at gmail.com Fri Aug 28 07:55:15 2009 From: soumyanath.c at gmail.com (Soumyanath) Date: Fri, 28 Aug 2009 17:25:15 +0530 Subject: [fxruby-users] Is it possible to create a pane dynamically In-Reply-To: <573065.36660.qm@web30001.mail.mud.yahoo.com> References: <573065.36660.qm@web30001.mail.mud.yahoo.com> Message-ID: <4A97C5A3.3060905@gmail.com> Hi! I am new to FXRuby so excuse me for this stupid question. I need to enter many different data and trying to create a vertical pane dynamically using response from a SQL query. I want these input form to appear in my main window. Created a class based on FXMainWindow. --------------- Code snippet ------------ class DbFace < FXMainWindow attr_writer \ :title, def addNew vPane = FXVerticalFrame.new(@hWnd) dTitle = FXLabel.new(vPane, at title,nil,LAYOUT_FILL_ROW) end def initialize(app, pane) @hWnd = pane @hApp = app end end ----------- End ----------------- I use this class from inside my program. As: book = DbFace.new(app, @frame) book.title = "Add new record" book.addNew The new dialog fields do not show up with this. Please tell me if I am doing something wrong. Any example will be great. From wbparsons at cshore.com Sat Aug 29 17:18:16 2009 From: wbparsons at cshore.com (William B. Parsons) Date: Sat, 29 Aug 2009 17:18:16 -0400 Subject: [fxruby-users] elementary problem with LAYOUT_FILL Message-ID: <20090829171816.cd727699.wbparsons@cshore.com> I'm sure this must be simple but I can't seem to figure out how to fill the main window with widgets. The following bare-bones test app illustrates my problem: ---------------------- #!/usr/bin/env ruby require 'fox16' include Fox class TopLevelWindow < FXMainWindow def initialize(app) super(app, 'Test Application', :width => 200, :height => 300) FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) end def create super show(PLACEMENT_SCREEN) end end FXApp.new do |app| TopLevelWindow.new(app) app.create app.run end ---------------------- Why doesn't the FXPacker fill the top-level window? -- Will From wbparsons at cshore.com Mon Aug 31 17:50:39 2009 From: wbparsons at cshore.com (William B. Parsons) Date: Mon, 31 Aug 2009 17:50:39 -0400 Subject: [fxruby-users] elementary problem with LAYOUT_FILL In-Reply-To: <447670.45565.qm@web30005.mail.mud.yahoo.com> References: <20090829171816.cd727699.wbparsons@cshore.com> <447670.45565.qm@web30005.mail.mud.yahoo.com> Message-ID: <20090831175039.8bdf4f73.wbparsons@cshore.com> On Sat, 29 Aug 2009 14:58:26 -0700 (PDT) dave L wrote: > I haven't used this control but think it's a non visible control - I.E > it is something you don't visually see but can access when used within > a window. But it is visible - since I passed a FRAME_SUNKEN attribute to the FXPacker you can see a small sunken square in the upper left-hand corner. Of course, in the real application I'm trying to build, the problem is that the widgets that get packed don't fill the entire top-level window as I would like. > --- On Sun, 30/8/09, William B. Parsons wrote: > > From: William B. Parsons > Subject: [fxruby-users] elementary problem with LAYOUT_FILL > To: fxruby-users at rubyforge.org > Received: Sunday, 30 August, 2009, 9:18 AM > > I'm sure this must be simple but I can't seem to figure out how to fill the > main window with widgets.? The following bare-bones test app illustrates my > problem: > ---------------------- > #!/usr/bin/env ruby > require 'fox16' > include Fox > > class TopLevelWindow < FXMainWindow > ???def initialize(app) > ? ? ? super(app, 'Test Application', :width => 200, :height => 300) > ? ? ? FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > ???end > ???def create > ? ? ? super > ? ? ? show(PLACEMENT_SCREEN) > ???end > end > > FXApp.new do |app| > ???TopLevelWindow.new(app) > ???app.create > ???app.run > end > ---------------------- > Why doesn't the FXPacker fill the top-level window? > > -- > Will > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > -- William B. Parsons From lyle at lylejohnson.name Mon Aug 31 18:06:48 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 31 Aug 2009 17:06:48 -0500 Subject: [fxruby-users] elementary problem with LAYOUT_FILL In-Reply-To: <20090829171816.cd727699.wbparsons@cshore.com> References: <20090829171816.cd727699.wbparsons@cshore.com> Message-ID: <57cf8f720908311506r1be0febas14d6405a37aedc2c@mail.gmail.com> On Sat, Aug 29, 2009 at 4:18 PM, William B. Parsons wrote: > I'm sure this must be simple but I can't seem to figure out how to fill the > main window with widgets. ?The following bare-bones test app illustrates my > problem: > ---------------------- > #!/usr/bin/env ruby > require 'fox16' > include Fox > > class TopLevelWindow < FXMainWindow > ? def initialize(app) > ? ? ?super(app, 'Test Application', :width => 200, :height => 300) > ? ? ?FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > ? end > ? def create > ? ? ?super > ? ? ?show(PLACEMENT_SCREEN) > ? end > end > > FXApp.new do |app| > ? TopLevelWindow.new(app) > ? app.create > ? app.run > end > ---------------------- > Why doesn't the FXPacker fill the top-level window? For some reason you've split out the construction options over two separate arguments. Trying changing this line: FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) to this: FXPacker.new(self, :opts => FRAME_SUNKEN | LAYOUT_FILL) Hope this helps, Lyle From lyle at lylejohnson.name Mon Aug 31 18:12:15 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 31 Aug 2009 17:12:15 -0500 Subject: [fxruby-users] Is it possible to create a pane dynamically In-Reply-To: <4A97C5A3.3060905@gmail.com> References: <573065.36660.qm@web30001.mail.mud.yahoo.com> <4A97C5A3.3060905@gmail.com> Message-ID: <57cf8f720908311512m660e87e3v65b31927266bbb78@mail.gmail.com> On Fri, Aug 28, 2009 at 6:55 AM, Soumyanath wrote: > I am new to FXRuby so excuse me for this stupid question. It is not a stupid question. > I need to enter many different data and trying to create a vertical pane > dynamically using response from a SQL query. > > I want these input form to appear in my main window. Created a class > based on FXMainWindow. > > --------------- Code snippet ------------ > class DbFace < FXMainWindow > ? ?attr_writer \ > ? ?:title, > > ?def addNew > ? ?vPane = FXVerticalFrame.new(@hWnd) > ? ?dTitle = FXLabel.new(vPane, at title,nil,LAYOUT_FILL_ROW) > ?end > > ?def initialize(app, pane) > ? ?@hWnd = pane > ? ?@hApp ?= app > ?end > end > ----------- End ----------------- > > I use this class from inside my program. As: > > ? ? ? ?book = DbFace.new(app, @frame) > ? ? ? ?book.title = "Add new record" > ? ? ? ?book.addNew > > > The new dialog fields do not show up with this. Please tell me if I am > doing something wrong. Any example will be great. I think you're just leaving out a call to create() for the newly-constructed widgets. What happens if you add a call to vPane.create() at the end of your addNew() method? def addNew vPane = FXVerticalFrame.new(@hWnd) dTitle = FXLabel.new(vPane, at title,nil,LAYOUT_FILL_ROW) vPane.create end Let me know if that does the trick. For more background on this, see: http://www.fox-toolkit.org/faq.html#CREATELATER Or, even better, buy the FXRuby book and read Chapter 7. ;) Hope this helps, Lyle From wbparsons at cshore.com Mon Aug 31 19:55:29 2009 From: wbparsons at cshore.com (William B. Parsons) Date: Mon, 31 Aug 2009 19:55:29 -0400 Subject: [fxruby-users] elementary problem with LAYOUT_FILL In-Reply-To: <57cf8f720908311506r1be0febas14d6405a37aedc2c@mail.gmail.com> References: <20090829171816.cd727699.wbparsons@cshore.com> <57cf8f720908311506r1be0febas14d6405a37aedc2c@mail.gmail.com> Message-ID: <20090831195529.b62642b5.wbparsons@cshore.com> On Mon, 31 Aug 2009 17:06:48 -0500 Lyle Johnson wrote: > On Sat, Aug 29, 2009 at 4:18 PM, William B. Parsons wrote: > > > I'm sure this must be simple but I can't seem to figure out how to fill the > > main window with widgets. ?The following bare-bones test app illustrates my > > problem: > > ---------------------- > > #!/usr/bin/env ruby > > require 'fox16' > > include Fox > > > > class TopLevelWindow < FXMainWindow > > ? def initialize(app) > > ? ? ?super(app, 'Test Application', :width => 200, :height => 300) > > ? ? ?FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > > ? end > > ? def create > > ? ? ?super > > ? ? ?show(PLACEMENT_SCREEN) > > ? end > > end > > > > FXApp.new do |app| > > ? TopLevelWindow.new(app) > > ? app.create > > ? app.run > > end > > ---------------------- > > Why doesn't the FXPacker fill the top-level window? > > For some reason you've split out the construction options over two > separate arguments. Trying changing this line: > > FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > > to this: > > FXPacker.new(self, :opts => FRAME_SUNKEN | LAYOUT_FILL) Thanks! - that seems to have been the problem with my test app. (I'm still having issues with getting an FXTable to fill its alotted space, but I'll poke around with the options a bit more before bothering the list.) -- Will