From meinrad.recheis at gmail.com Wed Mar 1 01:34:32 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 1 Mar 2006 07:34:32 +0100 Subject: [fxruby-users] ProgressiveSelectTextField In-Reply-To: <200602282231.37981.uwe.hartl@gmx.net> References: <200602282231.37981.uwe.hartl@gmx.net> Message-ID: <43d756720602282234o342d42c3wa931d4ca1c26a211@mail.gmail.com> it's quite nice. i definitely will have use for that. there are also some little things, that are not so cool about it: * configuration via constructor (yes, fox is all like this, but it makes classes definitly less easy to use ... especially if there are many of them) * inconsequent coding style: appendItem vs append_array. but that is easy to fix ;) i appreciate that you share your code with us. should be done more often on this list. thanks a lot!! -- henon On 2/28/06, Uwe Hartl wrote: > > Hello, > > is somebody interested on something like this? There is a little problem > with > the FXChoiceBox.ask which I just replaced by a > > p "Warning" > > and I have some difficulties how to quote a "\" and "(" in a regular > expression but everything else seems to work in here. Can somebody help me > out here? > > Is there a database of code snippets, where I would put something like > this, > or do you guys think, people should write this kind of stuff (extensions > of > widgets) themselves? > > See you, > > Uwe > > by the way, "*" is a wildcard in here... > > require 'fox14' > include Fox > > > class ProgressiveSelectTextField < FXTextField > include Responder > > def initialize(parent, new_entries_allowed = true, > confirm_new_entries = > true, nc = 3, tgt=nil, sel=0, opts=TEXTFIELD_NORMAL, x=0, y=0, w=0, h=0, > pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD) > super(parent, nc, tgt=nil, sel=0, opts = LAYOUT_FILL_X) > @new_entries_allowed = new_entries_allowed > @confirm_new_entries = confirm_new_entries > @fields = [] > @items = [] > @selected = 0 > @old_text = "" > connect(SEL_CHANGED, method(:on_changed)) > connect(SEL_KEYPRESS, method(:on_key)) > connect(SEL_FOCUSIN, method(:on_focus_in)) > connect(SEL_FOCUSOUT, method(:on_focus_out)) > connect(SEL_LEFTBUTTONPRESS, method(:on_clicked)) > enable > @sp = FXMenuPane.new(self, > POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK) > @list = FXList.new(@sp, nil, 0, > LIST_SINGLESELECT|LAYOUT_FILL_X| > LAYOUT_FILL_Y) > @list.connect(SEL_DOUBLECLICKED) { |sender, sel, data| > self.text = @items[data] > self. selectAll > @sp.popdown > } > @list.connect(SEL_KEYPRESS) { |sender, sel, event| > self.text = event.to_s > @sp.popdown > } > end > def appendItem(text) > @fields << text > end > def append_array(txt) > txt.each do |tt| > appendItem(tt) > end > end > def set_default_text(def_text = "*") > self.text = def_text > @old_text = def_text > end > def on_clicked(sender, sel, event) > on_focus_in(sender, sel, event) > end > def on_focus_in(sender, sel, event) > if !@sp.shown?() > populateList(self.text) > ret = true > @selected = 0 > else > ret = false > end > ret > end > def on_focus_out(sender, sel, data) > if (@new_entries_allowed && @confirm_new_entries && !@ > fields.include? > (self.text)) > f = File.open("icons/bigpenguin.png", "rb") > icon = FXPNGIcon.new(getApp(), f.read) > p "here there is the need for asking if the user > wants to get a new text > string in the field (not existent in the Array. Not implemented" > #choice = FXChoiceBox.ask(getApp(), opts = 0, > caption = "Unbekannter > Eintrag", text = "Wirklich neuen Wert anlegen?", icon, ["Ja", "Nein"]) > #self.text = "" if choice == 1 > end > end > def on_changed(sender, sel, data) > new = !populateList(data) > if !@new_entries_allowed && new > self.text = @old_text > end > @old_text = self.text > @selected = 0 > end > def sel > if @selected < @list.numItems > @list.makeItemVisible(@selected) > @list.selectItem(@selected) > end > end > def on_key(sender, sel, event) > if populateList(self.text) > if ((@selected < ((@list.numItems) - 1)) && > event.code == 65364) #arrow > down > @selected += 1 > self.sel > elsif ((@selected > 0) && event.code == 65362) > #arrow up > @selected -= 1 > self.sel > elsif event.code == 65293 # Enter key > self.text = @list.getItem(@selected).text > self.cursorPos = self.text.length > self.selectAll > @sp.popdown > end > end > false > end > def popup > xy = translateCoordinatesTo(getRoot(), x, y) > @sp.popup(nil, xy[0], xy[1]+height, self.width, 100) > @sp.recalc > @sp.create > end > def populateList(searchString = "") > ss = searchString.gsub("(", ".") > ss.gsub!(")", ".") > p ss > re = Regexp.new(ss.gsub("*", "(\\D*|\\d*)")) > p re > @items = @fields.collect { |val| val if val.match(re).to_s > != ""} > @items.delete(nil) > @list.clearItems > if @items.length > 0 > @items.each do |it| > @list.appendItem(it) > end > popup > sel > ret = true > else > @sp.popdown() > ret = false > end > return ret > end > end > > > > class Welcome < FXMainWindow > def initialize() > super($theApp, 'ComboBox', icon=nil, miniIcon=nil, > opts=DECOR_ALL, x=0, y=0, > width=300, height=300) > > ta = ProgressiveSelectTextField.new(self) > txt = ["able", "apartment", "apple", "Appolinaris", > "andruide", "berta", > "aparent", "aple", "Apinaris", "anduide", "beta", "Zeta"] > ta.append_array(txt) > ta.set_default_text(txt[2]) > end > end > > if $0 == __FILE__ > $theApp = FXApp.new > $wn = Welcome.new > $wn.show > $theApp.create > > $theApp.run > end > > -- > *********************************************************************** > Uwe Hartl e-mail: Uwe.Hartl at gmx.net > 91522 Ansbach Telephone: (0981) 9724526 > Am M?hlfeld 8 Notfall-Mobil: (0160)90418680 > Germany > *********************************************************************** > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060301/cdb1b1c5/attachment-0001.htm From uwe.hartl at gmx.net Wed Mar 1 14:25:13 2006 From: uwe.hartl at gmx.net (Uwe Hartl) Date: Wed, 1 Mar 2006 20:25:13 +0100 Subject: [fxruby-users] ProgressiveSelectTextField In-Reply-To: <43d756720602282234o342d42c3wa931d4ca1c26a211@mail.gmail.com> References: <200602282231.37981.uwe.hartl@gmx.net> <43d756720602282234o342d42c3wa931d4ca1c26a211@mail.gmail.com> Message-ID: <200603012025.14645.uwe.hartl@gmx.net> Ok, I will fix these. I started programming a couple of weeks ago in ruby after a 9 year brake, coming fron C. Sorry, I will improve. A couple of things I would need help with: I tried "fillItems" from the FXList and get a segfault. Thats why I wrote append_array(txt). Can somebody verify this, please? In my case we look at an Gentoo system, I have no idea if this is system specific. I want to have a String: "blabla\(blabla" to make the "(" a normal character for the regex; Here are my Attempts irb(main):089:0* "blabla\(blabla" => "blabla(blabla" irb(main):090:0> "blabla\\(blabla" => "blabla\\(blabla" irb(main):091:0> 'blabla\\(blabla' => "blabla\\(blabla" Can somebody tell me how I can do this? I either get two backslashes or I get none. What do I miss? Thanks Uwe On Wednesday 01 March 2006 07:34, Meinrad Recheis wrote: > it's quite nice. i definitely will have use for that. > there are also some little things, that are not so cool about it: > * configuration via constructor (yes, fox is all like this, but it makes > classes definitly less easy to use ... especially if there are many of > them) * inconsequent coding style: appendItem vs append_array. > but that is easy to fix ;) > > i appreciate that you share your code with us. should be done more often on > this list. > thanks a lot!! > -- henon > > On 2/28/06, Uwe Hartl wrote: > > Hello, > > > > is somebody interested on something like this? There is a little problem > > with > > the FXChoiceBox.ask which I just replaced by a > > > > p "Warning" > > > > and I have some difficulties how to quote a "\" and "(" in a regular > > expression but everything else seems to work in here. Can somebody help > > me out here? > > > > Is there a database of code snippets, where I would put something like > > this, > > or do you guys think, people should write this kind of stuff (extensions > > of > > widgets) themselves? > > > > See you, > > > > Uwe > > > > by the way, "*" is a wildcard in here... > > > > require 'fox14' > > include Fox > > > > > > class ProgressiveSelectTextField < FXTextField > > include Responder > > > > def initialize(parent, new_entries_allowed = true, > > confirm_new_entries = > > true, nc = 3, tgt=nil, sel=0, opts=TEXTFIELD_NORMAL, x=0, y=0, w=0, h=0, > > pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD) > > super(parent, nc, tgt=nil, sel=0, opts = LAYOUT_FILL_X) > > @new_entries_allowed = new_entries_allowed > > @confirm_new_entries = confirm_new_entries > > @fields = [] > > @items = [] > > @selected = 0 > > @old_text = "" > > connect(SEL_CHANGED, method(:on_changed)) > > connect(SEL_KEYPRESS, method(:on_key)) > > connect(SEL_FOCUSIN, method(:on_focus_in)) > > connect(SEL_FOCUSOUT, method(:on_focus_out)) > > connect(SEL_LEFTBUTTONPRESS, method(:on_clicked)) > > enable > > @sp = FXMenuPane.new(self, > > POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK) > > @list = FXList.new(@sp, nil, 0, > > LIST_SINGLESELECT|LAYOUT_FILL_X| > > LAYOUT_FILL_Y) > > @list.connect(SEL_DOUBLECLICKED) { |sender, sel, data| > > self.text = @items[data] > > self. selectAll > > @sp.popdown > > } > > @list.connect(SEL_KEYPRESS) { |sender, sel, event| > > self.text = event.to_s > > @sp.popdown > > } > > end > > def appendItem(text) > > @fields << text > > end > > def append_array(txt) > > txt.each do |tt| > > appendItem(tt) > > end > > end > > def set_default_text(def_text = "*") > > self.text = def_text > > @old_text = def_text > > end > > def on_clicked(sender, sel, event) > > on_focus_in(sender, sel, event) > > end > > def on_focus_in(sender, sel, event) > > if !@sp.shown?() > > populateList(self.text) > > ret = true > > @selected = 0 > > else > > ret = false > > end > > ret > > end > > def on_focus_out(sender, sel, data) > > if (@new_entries_allowed && @confirm_new_entries && !@ > > fields.include? > > (self.text)) > > f = File.open("icons/bigpenguin.png", "rb") > > icon = FXPNGIcon.new(getApp(), f.read) > > p "here there is the need for asking if the user > > wants to get a new text > > string in the field (not existent in the Array. Not implemented" > > #choice = FXChoiceBox.ask(getApp(), opts = 0, > > caption = "Unbekannter > > Eintrag", text = "Wirklich neuen Wert anlegen?", icon, ["Ja", "Nein"]) > > #self.text = "" if choice == 1 > > end > > end > > def on_changed(sender, sel, data) > > new = !populateList(data) > > if !@new_entries_allowed && new > > self.text = @old_text > > end > > @old_text = self.text > > @selected = 0 > > end > > def sel > > if @selected < @list.numItems > > @list.makeItemVisible(@selected) > > @list.selectItem(@selected) > > end > > end > > def on_key(sender, sel, event) > > if populateList(self.text) > > if ((@selected < ((@list.numItems) - 1)) && > > event.code == 65364) #arrow > > down > > @selected += 1 > > self.sel > > elsif ((@selected > 0) && event.code == 65362) > > #arrow up > > @selected -= 1 > > self.sel > > elsif event.code == 65293 # Enter key > > self.text = @list.getItem(@selected).text > > self.cursorPos = self.text.length > > self.selectAll > > @sp.popdown > > end > > end > > false > > end > > def popup > > xy = translateCoordinatesTo(getRoot(), x, y) > > @sp.popup(nil, xy[0], xy[1]+height, self.width, 100) > > @sp.recalc > > @sp.create > > end > > def populateList(searchString = "") > > ss = searchString.gsub("(", ".") > > ss.gsub!(")", ".") > > p ss > > re = Regexp.new(ss.gsub("*", "(\\D*|\\d*)")) > > p re > > @items = @fields.collect { |val| val if > > val.match(re).to_s != ""} > > @items.delete(nil) > > @list.clearItems > > if @items.length > 0 > > @items.each do |it| > > @list.appendItem(it) > > end > > popup > > sel > > ret = true > > else > > @sp.popdown() > > ret = false > > end > > return ret > > end > > end > > > > > > > > class Welcome < FXMainWindow > > def initialize() > > super($theApp, 'ComboBox', icon=nil, miniIcon=nil, > > opts=DECOR_ALL, x=0, y=0, > > width=300, height=300) > > > > ta = ProgressiveSelectTextField.new(self) > > txt = ["able", "apartment", "apple", "Appolinaris", > > "andruide", "berta", > > "aparent", "aple", "Apinaris", "anduide", "beta", "Zeta"] > > ta.append_array(txt) > > ta.set_default_text(txt[2]) > > end > > end > > > > if $0 == __FILE__ > > $theApp = FXApp.new > > $wn = Welcome.new > > $wn.show > > $theApp.create > > > > $theApp.run > > end > > > > -- > > *********************************************************************** > > Uwe Hartl e-mail: Uwe.Hartl at gmx.net > > 91522 Ansbach Telephone: (0981) 9724526 > > Am M?hlfeld 8 Notfall-Mobil: (0160)90418680 > > Germany > > *********************************************************************** > > > > > > _______________________________________________ > > fxruby-users mailing list > > fxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/fxruby-users -- *********************************************************************** Uwe Hartl e-mail: Uwe.Hartl at gmx.net 91522 Ansbach Telephone: (0981) 9724526 Am M?hlfeld 8 Notfall-Mobil: (0160)90418680 Germany *********************************************************************** From sdruby at onlinehome.de Wed Mar 1 14:36:37 2006 From: sdruby at onlinehome.de (=?iso-8859-1?Q?Sascha_D=F6rdelmann?=) Date: Wed, 1 Mar 2006 20:36:37 +0100 Subject: [fxruby-users] ProgressiveSelectTextField In-Reply-To: <200603012025.14645.uwe.hartl@gmx.net> Message-ID: Hi Uwe, > I want to have a String: "blabla\(blabla" to make the "(" a normal > character for the regex; irb(main):003:0> Regexp.compile 'blabla\(blabla' => /blabla\(blabla/ Ciao Sascha From r.fulton at auckland.ac.nz Wed Mar 1 15:18:35 2006 From: r.fulton at auckland.ac.nz (Russell Fulton) Date: Thu, 02 Mar 2006 09:18:35 +1300 Subject: [fxruby-users] ProgressiveSelectTextField In-Reply-To: <200603012025.14645.uwe.hartl@gmx.net> References: <200602282231.37981.uwe.hartl@gmx.net> <43d756720602282234o342d42c3wa931d4ca1c26a211@mail.gmail.com> <200603012025.14645.uwe.hartl@gmx.net> Message-ID: <4406019B.1030202@auckland.ac.nz> Uwe Hartl wrote: > I want to have a String: "blabla\(blabla" to make the "(" a normal character > for the regex; > What string are you trying to match? and I also suggest you post the actual code. The complication here is that if you are assigning to a string and then using the string in an RE then there *two* levels of quoting necessary, one for the string and one for the RE with the \ needing to be quoted twice and the ( once. i.e. to get a single \ in the RE you would need \\\\ in the string -- this gets unmanageable really fast so I recommend not using variables in REs unless you really have to. We need to see exactly what you are trying to do to solve this one there are too many ambiguities. Russell From info at sten-net.de Wed Mar 1 15:41:02 2006 From: info at sten-net.de (Jannis Pohlmann) Date: Wed, 1 Mar 2006 21:41:02 +0100 Subject: [fxruby-users] ProgressiveSelectTextField In-Reply-To: <200603012025.14645.uwe.hartl@gmx.net> References: <200602282231.37981.uwe.hartl@gmx.net> <43d756720602282234o342d42c3wa931d4ca1c26a211@mail.gmail.com> <200603012025.14645.uwe.hartl@gmx.net> Message-ID: <20060301214102.33175fe1.info@sten-net.de> On Wed, 1 Mar 2006 20:25:13 +0100 Uwe Hartl wrote: > Ok, I will fix these. I started programming a couple of weeks ago in > ruby after a 9 year brake, coming fron C. Sorry, I will improve. > > A couple of things I would need help with: > > I tried "fillItems" from the FXList and get a segfault. Thats why I > wrote append_array(txt). Can somebody verify this, please? In my case > we look at an Gentoo system, I have no idea if this is system > specific. > > I want to have a String: "blabla\(blabla" to make the "(" a normal > character for the regex; > > Here are my Attempts > irb(main):089:0* "blabla\(blabla" > => "blabla(blabla" > irb(main):090:0> "blabla\\(blabla" > => "blabla\\(blabla" > irb(main):091:0> 'blabla\\(blabla' > => "blabla\\(blabla" > > Can somebody tell me how I can do this? I either get two backslashes > or I get none. What do I miss? You're missing that irb displays stuff (almost) the way Ruby is interpreting it. "\(" would always become "(" because Ruby tries to interpret the backslash as a special char (\n, \r, \t etc.) but fails to find a 'r', 'n' or 't', so the slash is just ignored. To check this, try typing "blabla\t(blabla", which will give you "blabla\t(blabla". Irb returns "\\(" as "\\(", but this doesn't mean that there will be two backslashes in the actual string output. If it would print "\" you might expect a special char here (=> misleading). To check your expressions, assign the string to a variable and print its value: jannis at nebelsee ~> irb irb(main):001:0> var = "bla\test" => "bla\test" irb(main):002:0> puts var bla est => nil irb(main):003:0> var = "bla\\test" => "bla\\test" irb(main):004:0> puts var bla\test => nil irb(main):005:0> var = "bla\(test" => "bla(test" irb(main):006:0> puts var bla(test => nil irb(main):007:0> var = "bla\\(test" => "bla\\(test" irb(main):008:0> puts var bla\(test => nil Hope this helps, Jannis -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060301/acacdf1f/attachment.bin From uwe.hartl at gmx.net Wed Mar 1 16:16:41 2006 From: uwe.hartl at gmx.net (Uwe Hartl) Date: Wed, 1 Mar 2006 22:16:41 +0100 Subject: [fxruby-users] ProgressiveSelectTextField In-Reply-To: <20060301214102.33175fe1.info@sten-net.de> References: <200602282231.37981.uwe.hartl@gmx.net> <200603012025.14645.uwe.hartl@gmx.net> <20060301214102.33175fe1.info@sten-net.de> Message-ID: <200603012216.41435.uwe.hartl@gmx.net> Thanks Jannis, this was enligthening. Thanks. With the help of you guys and gals soon I will understand what I do. No joke. Uwe > jannis at nebelsee ~> irb > irb(main):001:0> var = "bla\test" > => "bla\test" > irb(main):002:0> puts var > bla est > => nil > irb(main):003:0> var = "bla\\test" > => "bla\\test" > irb(main):004:0> puts var > bla\test > => nil > irb(main):005:0> var = "bla\(test" > => "bla(test" > irb(main):006:0> puts var > bla(test > => nil > irb(main):007:0> var = "bla\\(test" > => "bla\\(test" > irb(main):008:0> puts var > bla\(test > => nil > > Hope this helps, > Jannis -- *********************************************************************** Uwe Hartl e-mail: Uwe.Hartl at gmx.net 91522 Ansbach Telephone: (0981) 9724526 Am M?hlfeld 8 Notfall-Mobil: (0160)90418680 Germany *********************************************************************** From g.castaldi at gmail.com Fri Mar 3 08:10:20 2006 From: g.castaldi at gmail.com (Giannandrea Castaldi) Date: Fri, 3 Mar 2006 14:10:20 +0100 Subject: [fxruby-users] problem compiling fxruby Message-ID: Hi, I'm using ruby on my laptop with Ubuntu and since this distribution has ruby 1.8.3 I've installed for my user ruby 1.8.4 in $HOME/local. I want to use fxri and then I've installed fox from Ubuntu and fxruby and fxri from gem without problem. Now I'd like to use mondrian or freeride and I've seen that for that I must recompile fxruby with fxscintilla. In Ubuntu I haven't found both scintilla and fxscintilla and then I've recompiled them and installed in $HOME/local. When I recompile fxruby with the following command: ~/local/lib/ruby/gems/cache$ gem install fxruby-1.2.6.gem --force -- --with-fxscintilla-include=~/local/include/fxscintilla --with-fxscintilla-lib=~/local/lib I've the following error: Attempting local installation of 'fxruby-1.2.6.gem' Building native extensions. This could take a while... In file included from core_wrap.cpp:584: include/FXRbCommon.h:83:23: error: Scintilla.h: No such file or directory include/FXRbCommon.h:84:25: error: FXScintilla.h: No such file or directory I've tried to put the scintilla files .h in serveral places: - $HOME/local/include/scintilla - $HOME/local/include/fxscintilla - $HOME/local/include - /usr/include/scintilla but the problem remains, any solution? Thanks. Giannandrea From guslist at free.fr Mon Mar 6 09:45:26 2006 From: guslist at free.fr (Guillaume Marcais) Date: Mon, 6 Mar 2006 09:45:26 -0500 Subject: [fxruby-users] Printing & exporting Message-ID: <8aaedf5fba3808e0fa0266b149db1a62@free.fr> Two questions about FXRuby: Does printing with FXDCPrint works? All I manage to get are corrupt poscript file or completely blank pages... Any tricks or pitfalls to avoid when using FXDCPrint? Can I export the content of a canvas as a picture in JPEG or PNG format? Thanks for your help, Guillaume. From meinrad.recheis at gmail.com Mon Mar 6 13:57:07 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 6 Mar 2006 19:57:07 +0100 Subject: [fxruby-users] realspinner segfaults Message-ID: <43d756720603061057i37b7e355gb9e5261cf97fec0c@mail.gmail.com> hi lyle, spinner is also a german word meaning crazy person ^^ in this case nomen est omen. realspinner segfaults in line 1 of this script: 0: realspinner.connect(SEL_COMMAND){|a, b, c| 1: p c 2: } the docs say: SEL_COMMAND:sent whenever the spinner's value changes; the message data is an integer indicating the new spinner value. SEL_CHANGED:sent whenever the text in the spinner's text field changes; the message data is an integer indicating the new spinner value. i think it should also be a float instead of an integer, shouldn't it? -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060306/bfd70c8c/attachment-0001.htm From maurice.codik at gmail.com Mon Mar 6 23:33:08 2006 From: maurice.codik at gmail.com (Maurice Codik) Date: Mon, 6 Mar 2006 22:33:08 -0600 Subject: [fxruby-users] FXProgressDialog trouble Message-ID: <2927e5d70603062033n66421dc0v289c0ad1aa875e1e@mail.gmail.com> Hey all, I'm having trouble with FXProgressDialog-- I'm trying to use it to show the progress of a file upload.. I am running the upload in a separate thread that calls the dialog's destroy method when its done.. the dialog closes, but the application remains non-responsive (as if its still in the execute loop). I've tried sending ID_ACCEPT to the dialog with the same results. I've seen some other threads on this list (and others) with the same issue, with no solution... can someone point me to an example of successfully using this dialog? Thanks.. Maurice ------------------------- code snippet: -- in my FXMainWindow: progress = FXProgressDialog.new(self, "Upload Progress", "Starting upload") th = Thread.new { # this does the upload, and calls progress.increment and sets progress.message OpenomyUploader.upload(dir, tags, progress) progress.destroy } progress.execute -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060306/61ed144f/attachment.htm From meinrad.recheis at gmail.com Tue Mar 7 02:46:02 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 7 Mar 2006 08:46:02 +0100 Subject: [fxruby-users] FXProgressDialog trouble In-Reply-To: <2927e5d70603062033n66421dc0v289c0ad1aa875e1e@mail.gmail.com> References: <2927e5d70603062033n66421dc0v289c0ad1aa875e1e@mail.gmail.com> Message-ID: <43d756720603062346w69471ea6g1bf3f621b7a0e98c@mail.gmail.com> i had the same issue with dialogbox. i could only work around by making the dialogbox nonmodal. everything else failed for me too. maybe it works for you if you call progress.show instead of progress execute. but then the progress dialog would not be modal anymore. let's wait on lyle's comment ;) ... sadly he has been not responding on the list for a while now. -- henon On 3/7/06, Maurice Codik wrote: > > Hey all, > > I'm having trouble with FXProgressDialog-- I'm trying to use it to show > the progress of a file upload.. > > I am running the upload in a separate thread that calls the dialog's > destroy method when its done.. the dialog closes, but the application > remains non-responsive (as if its still in the execute loop). I've tried > sending ID_ACCEPT to the dialog with the same results. > > I've seen some other threads on this list (and others) with the same > issue, with no solution... can someone point me to an example of > successfully using this dialog? > > Thanks.. > > Maurice > > ------------------------- > > code snippet: > > -- in my FXMainWindow: > > progress = FXProgressDialog.new(self, "Upload Progress", "Starting > upload") > > th = Thread.new { > # this does the upload, and calls progress.increment and sets > progress.message > OpenomyUploader.upload(dir, tags, progress) > progress.destroy > } > > progress.execute > > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060307/43abc346/attachment.htm From lyle at knology.net Tue Mar 7 09:11:17 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 7 Mar 2006 08:11:17 -0600 Subject: [fxruby-users] problem compiling fxruby In-Reply-To: References: Message-ID: <9225bc114dd097e2ed80f0b2fd31384c@knology.net> On Mar 3, 2006, at 7:10 AM, Giannandrea Castaldi wrote: > Now I'd like to use mondrian or freeride and I've seen that for that I > must recompile fxruby with fxscintilla. In Ubuntu I haven't found both > scintilla and fxscintilla and then I've recompiled them and installed > in $HOME/local. When I recompile fxruby with the following command: > ~/local/lib/ruby/gems/cache$ gem install fxruby-1.2.6.gem --force -- > --with-fxscintilla-include=~/local/include/fxscintilla > --with-fxscintilla-lib=~/local/lib I don't know if this will make a difference, but what if you specify the full path to those directories, i.e. gem install fxruby-1.2.6.gem -- --with-fxscintilla-include=/home/fred/local/include/fxscintilla --with-fxscintilla-lib=/home/fred/local/lib I just tried a quick test with the FXScintilla files installed non-standard places and it worked OK. Hope this helps, Lyle From lyle at knology.net Tue Mar 7 09:20:46 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 7 Mar 2006 08:20:46 -0600 Subject: [fxruby-users] Printing & exporting In-Reply-To: <8aaedf5fba3808e0fa0266b149db1a62@free.fr> References: <8aaedf5fba3808e0fa0266b149db1a62@free.fr> Message-ID: <92688b5c9d4dd2bf9aee235040b90b99@knology.net> On Mar 6, 2006, at 8:45 AM, Guillaume Marcais wrote: > Two questions about FXRuby: > > Does printing with FXDCPrint works? All I manage to get are corrupt > poscript file or completely blank pages... Any tricks or pitfalls to > avoid when using FXDCPrint? I don't believe that FOX's printing code really works yet, but to be sure you could ask on the FOX mailing list. > Can I export the content of a canvas as a picture in JPEG or PNG > format? Sure, see the code on this page of the FOX Community Wiki: http://fox-toolkit.net/cgi-bin/wiki.pl?Cookbook/ Making_A_Snapshot_Of_A_Widget Hope this helps, Lyle From lyle at knology.net Tue Mar 7 09:26:19 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 7 Mar 2006 08:26:19 -0600 Subject: [fxruby-users] FXProgressDialog trouble In-Reply-To: <2927e5d70603062033n66421dc0v289c0ad1aa875e1e@mail.gmail.com> References: <2927e5d70603062033n66421dc0v289c0ad1aa875e1e@mail.gmail.com> Message-ID: <75358d92af74e530af409ff8d41b8320@knology.net> On Mar 6, 2006, at 10:33 PM, Maurice Codik wrote: > I'm having trouble with FXProgressDialog-- I'm trying to use it to > show the progress of a file upload.. > > I am running the upload in a separate thread that calls the dialog's > destroy method when its done.. the dialog closes, but the application > remains non-responsive (as if its still in the execute loop). I've > tried sending ID_ACCEPT to the dialog with the same results. So you are saying that instead of doing this: progress.destroy At the end of the thread, you're doing this: progress.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) and that doesn't stop the modal loop and close the dialog box? From maurice.codik at gmail.com Tue Mar 7 10:31:53 2006 From: maurice.codik at gmail.com (Maurice Codik) Date: Tue, 7 Mar 2006 09:31:53 -0600 Subject: [fxruby-users] FXProgressDialog trouble In-Reply-To: <75358d92af74e530af409ff8d41b8320@knology.net> References: <2927e5d70603062033n66421dc0v289c0ad1aa875e1e@mail.gmail.com> <75358d92af74e530af409ff8d41b8320@knology.net> Message-ID: <2927e5d70603070731p1ebcfb5cka3e13ec393df58b7@mail.gmail.com> I was actually using a different command, based on some advice you had given on ruby-talk a few years back, here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/72014, this didnt stop the modal loop. Replacing progress.destroy with the method you gave actually causes a segfault! Perhaps I'm using an old version? uploader.rb:98: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] (line 98 is the call to progress.handle) using fxruby 1.4.3. Maurice On 3/7/06, Lyle Johnson wrote: > > > On Mar 6, 2006, at 10:33 PM, Maurice Codik wrote: > > > I'm having trouble with FXProgressDialog-- I'm trying to use it to > > show the progress of a file upload.. > > > > I am running the upload in a separate thread that calls the dialog's > > destroy method when its done.. the dialog closes, but the application > > remains non-responsive (as if its still in the execute loop). I've > > tried sending ID_ACCEPT to the dialog with the same results. > > So you are saying that instead of doing this: > > progress.destroy > > At the end of the thread, you're doing this: > > progress.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), > nil) > > and that doesn't stop the modal loop and close the dialog box? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060307/d34ea86e/attachment.htm From sdruby at onlinehome.de Tue Mar 7 15:27:25 2006 From: sdruby at onlinehome.de (=?iso-8859-1?Q?Sascha_D=F6rdelmann?=) Date: Tue, 7 Mar 2006 21:27:25 +0100 Subject: [fxruby-users] FXProgressDialog trouble In-Reply-To: <43d756720603062346w69471ea6g1bf3f621b7a0e98c@mail.gmail.com> Message-ID: Hello Maurice, > I'm having trouble with FXProgressDialog-- I'm trying to use it to show the progress of a file upload.. > [...] > can someone point me to an example of successfully using this dialog? My sourceforge-project Piggy includes an FTP browser written in FXRuby but I do not use a separate thread. Termination doesn't seem to be a problem there. I've noticed a few side effects, though. E. g. the modal Dialog which starts the upload will stay open until the upload is finished. BTW: If you are building an FTP browser, too, you might want to join in the project (or should I join yours)? Cheers Sascha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060307/0abf0c04/attachment.htm From maurice.codik at gmail.com Thu Mar 9 12:30:37 2006 From: maurice.codik at gmail.com (Maurice Codik) Date: Thu, 9 Mar 2006 11:30:37 -0600 Subject: [fxruby-users] FXProgressDialog trouble In-Reply-To: References: <43d756720603062346w69471ea6g1bf3f621b7a0e98c@mail.gmail.com> Message-ID: <2927e5d70603090930t51ae71feie59b6c22c0e8195f@mail.gmail.com> Hey Sascha, Thanks for the code example-- I used your approach and the dialog now works fine. I'm not writing an ftp client-- im writing a utility that will make uploading many files onto openomy.com (a file storage site I help run) a little easier. It calls: progress = FXProgressDialog.new(...) progress.create progress.show progress.repaint ... do stuff .. progress.hide Which is non-modal, but works fine as long as I dont create a new thread. Still, this doesnt feel like the "right" solution. I will try to use ID_ACCEPT again after I upgrade my Ruby/FXRuby later this week... Maurice On 3/7/06, Sascha D?rdelmann wrote: > > Hello Maurice, > > > I'm having trouble with FXProgressDialog-- I'm trying to use it to show > the progress of a file upload.. > > [...] > > can someone point me to an example of successfully using this dialog? > My sourceforge-project Piggy includes an FTP browser written in FXRuby but > I do not use a separate thread. Termination doesn't seem to be a problem > there. I've noticed a few side effects, though. E. g. the modal Dialog which > starts the upload will stay open until the upload is finished. > > BTW: If you are building an FTP browser, too, you might want to join in > the project (or should I join yours)? > > Cheers > Sascha > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060309/8b243a22/attachment-0001.htm From bjorn.bergqvist at gmail.com Wed Mar 15 08:13:44 2006 From: bjorn.bergqvist at gmail.com (=?ISO-8859-1?Q?Bj=F6rn_Bergqvist?=) Date: Wed, 15 Mar 2006 14:13:44 +0100 Subject: [fxruby-users] Lumos? Message-ID: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> Hello, When will we se lumos in fxruby? Regards Bj?rn Bergqvist From lyle at knology.net Wed Mar 15 08:57:50 2006 From: lyle at knology.net (Lyle Johnson) Date: Wed, 15 Mar 2006 07:57:50 -0600 Subject: [fxruby-users] Lumos? In-Reply-To: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> References: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> Message-ID: On Mar 15, 2006, at 7:13 AM, Bj?rn Bergqvist wrote: > Hello, > When will we se lumos in fxruby? > Regards > Bj?rn Bergqvist Well, since we haven't seen Lumos in C++ yet, I wouldn't hold my breath if I were you. ;) From jeroen at fox-toolkit.org Wed Mar 15 17:31:23 2006 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Wed, 15 Mar 2006 16:31:23 -0600 Subject: [fxruby-users] Lumos? In-Reply-To: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> References: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> Message-ID: <200603151631.28809.jeroen@fox-toolkit.org> On Wednesday 15 March 2006 07:13, Bj?rn Bergqvist wrote: > Hello, > When will we se lumos in fxruby? > Regards As Lyle says, this is going to be a little while off... In fact, its probably going though some architectural changes in the next few weeks. But does it exist? For the skeptical, here's a screenshot... Lots of water will likely pass under the bridge before its released, however........... Stay tuned! - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 16:20 03/15/2006 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ -------------- next part -------------- A non-text attachment was scrubbed... Name: shiny_ball.jpg Type: image/jpeg Size: 22244 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060315/3e769948/attachment-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060315/3e769948/attachment-0001.bin From sander at knology.net Tue Mar 14 01:03:19 2006 From: sander at knology.net (Sander Jansen) Date: Tue, 14 Mar 2006 00:03:19 -0600 Subject: [fxruby-users] Lumos? In-Reply-To: <200603151631.28809.jeroen@fox-toolkit.org> References: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> <200603151631.28809.jeroen@fox-toolkit.org> Message-ID: <200603140003.19639.sander@knology.net> I personally think it's just a hoax... Sander On Wednesday 15 March 2006 16:31, Jeroen van der Zijp wrote: > On Wednesday 15 March 2006 07:13, Bj?rn Bergqvist wrote: > > Hello, > > When will we se lumos in fxruby? > > Regards > > As Lyle says, this is going to be a little while off... In fact, > its probably going though some architectural changes in the next > few weeks. > > But does it exist? For the skeptical, here's a screenshot... > > > Lots of water will likely pass under the bridge before its released, > however........... > > Stay tuned! > > > > - Jeroen From bjorn.bergqvist at gmail.com Thu Mar 16 02:37:07 2006 From: bjorn.bergqvist at gmail.com (=?ISO-8859-1?Q?Bj=F6rn_Bergqvist?=) Date: Thu, 16 Mar 2006 08:37:07 +0100 Subject: [fxruby-users] Lumos? In-Reply-To: <200603140003.19639.sander@knology.net> References: <44936e730603150513y1a17c4edj34de3afde3153ba5@mail.gmail.com> <200603151631.28809.jeroen@fox-toolkit.org> <200603140003.19639.sander@knology.net> Message-ID: <44936e730603152337g69778bd5o3b9886bcc4893710@mail.gmail.com> Maybe that is why the fox toolkit is so good. There are real commercial applications made with it. I can understand that Jeroen's paying customers get the candy first. Bj?rn On 3/14/06, Sander Jansen wrote: > I personally think it's just a hoax... > > Sander > > > On Wednesday 15 March 2006 16:31, Jeroen van der Zijp wrote: > > On Wednesday 15 March 2006 07:13, Bj?rn Bergqvist wrote: > > > Hello, > > > When will we se lumos in fxruby? > > > Regards > > > > As Lyle says, this is going to be a little while off... In fact, > > its probably going though some architectural changes in the next > > few weeks. > > > > But does it exist? For the skeptical, here's a screenshot... > > > > > > Lots of water will likely pass under the bridge before its released, > > however........... > > > > Stay tuned! > > > > > > > > - Jeroen > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From guslist at free.fr Fri Mar 17 11:33:13 2006 From: guslist at free.fr (Guillaume Marcais) Date: Fri, 17 Mar 2006 11:33:13 -0500 Subject: [fxruby-users] Scrollable menu Message-ID: <2fa8c2be94e91ac9fa6b13a698ee9203@free.fr> How would I go about creating a scrollable menu? I have a cascade menu with over a thousand entries, and not all of them fit in the screen. Is it possible to add a scrollbar or scroll arrow on a FXMenuPane? Guillaume. From lyle at knology.net Fri Mar 17 12:32:30 2006 From: lyle at knology.net (lyle at knology.net) Date: 17 Mar 2006 17:32:30 -0000 Subject: [fxruby-users] Scrollable menu In-Reply-To: <> References: <> Message-ID: <20060317173230.21122.qmail@webmail2.knology.net> On Fri, 17 Mar 2006 11:33:13 -0500, Guillaume Marcais wrote : > How would I go about creating a scrollable menu? I have a cascade menu > with over a thousand entries, and not all of them fit in the screen. Is > it possible to add a scrollbar or scroll arrow on a FXMenuPane? I would begin by saying that if you have a menu with over a thousand items, you have a serious design issue that you need to deal with. But in the meantime, could you use FXScrollPane in place of the FXMenuPane? From bjorn.bergqvist at gmail.com Sun Mar 19 02:42:15 2006 From: bjorn.bergqvist at gmail.com (=?ISO-8859-1?Q?Bj=F6rn_Bergqvist?=) Date: Sun, 19 Mar 2006 08:42:15 +0100 Subject: [fxruby-users] Strange Message-ID: <44936e730603182342x3eec8c3es74ef6269e14e400d@mail.gmail.com> Hello, I've installed fox-1.4.31, fxscintilla-1.63 and fxruby-1.4.4 on my Gentoo-box. When I press this button: " FXButton.new(toolbar, "\tReset\tReset the viewer.", loadIcon("reset"), @viewer, FXGLViewer::ID_RESETVIEW, FRAME_THICK|FRAME_RAISED|LAYOUT_TOP|LAYOUT_LEFT) " I got: " FXRuby.cpp:145: FXASSERT(result==0) failed. " and whet I select something in the FXGLViewer the application crashes: " discretizer.rb:1138:in `drawContents': Expected FXDC * (TypeError) from discretizer.rb:1138 " The strange thing is that when i use the pane: " FXMenuCommand.new(pane, "R&eset\t\tReset all viewing parameters", nil, sender, FXGLViewer::ID_RESETVIEW) " it works. Regards Bj?rn Bergqvist From shevegen at linuxmail.org Tue Mar 21 21:24:51 2006 From: shevegen at linuxmail.org (Roebe XXX) Date: Wed, 22 Mar 2006 03:24:51 +0100 Subject: [fxruby-users] Multitab FXRuby Editor with movable tabs - possible? Message-ID: <20060322022451.85F0D23D26@ws5-3.us4.outblaze.com> Hi list, I want to make an editor in FXRuby, that shall feature (as my personal basic needs) - ruby syntax highlighting (and php ;>), in general though any kind of syntax highlighting words easily - tabs/buffers that have one file in them - ability to rearrange tabs, by clicking with mouse on them and move them to another position - vim like keybindings (optional) Anyway, i am asking whether this is possible. In Ruby/GTK2 I came pretty far, had tabs, could rearrange them (though not yet at drag and drop, which is the thing I am trying to pay most attention soon), but I got a bit frustrated at it and dropped it for some time. Then I picked about FOX again ;) (First toolkit was Tcl/Tk via ruby, this is really very ugly in my opinion) -- _______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze From lyle at knology.net Tue Mar 21 22:30:24 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 21 Mar 2006 21:30:24 -0600 Subject: [fxruby-users] Multitab FXRuby Editor with movable tabs - possible? In-Reply-To: <20060322022451.85F0D23D26@ws5-3.us4.outblaze.com> References: <20060322022451.85F0D23D26@ws5-3.us4.outblaze.com> Message-ID: On Mar 21, 2006, at 8:24 PM, Roebe XXX wrote: > I want to make an editor in FXRuby, that shall feature (as > my personal basic needs) > > - ruby syntax highlighting (and php ;>), in general though any > kind of syntax highlighting words easily > - tabs/buffers that have one file in them > - ability to rearrange tabs, by clicking with mouse on them and > move them to another position > - vim like keybindings (optional) > > Anyway, i am asking whether this is possible. I think that you will probably run into some of the same frustrations that you did with Gtk, but it's just a guess. It will definitely be difficult to figure out how to do the rearrangement of tabs via drag and drop. And unless you're just insistent on developing the syntax highlighting portion yourself, you might want to base the editor on Scintilla (via FXScintilla). So, is it possible? Maybe. Seems to me that it would be so much easier to download one of the thousands of text editors that already do this stuff and be done with it, but what do I know? ;) From vjoel at path.berkeley.edu Mon Mar 27 18:00:02 2006 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Mon, 27 Mar 2006 15:00:02 -0800 Subject: [fxruby-users] FXMenuBar.new(self) raises ArgumentError Message-ID: <44286E72.6060608@path.berkeley.edu> I've been away from FXRuby code for a while, and was surprised that mb = FXMenuBar.new(self) which used to work (in 1.2 I guess) now in 1.4 causes this: No matching function for overloaded 'new_FXMenuBar' (ArgumentError) It was easily fixed with: mb = FXMenuBar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) But it seems like FXMenuBar.new should have a default that works. Not a big issue though... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From r.mark.volkmann at gmail.com Mon Mar 27 19:39:45 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Mon, 27 Mar 2006 18:39:45 -0600 Subject: [fxruby-users] SELTYPE and SELID methods Message-ID: I understand that in FOX, the SELTYPE and SELID methods are used to extract the type and identifer from a message selector value. I wonder why those methods are named FXSELTYPE and FXSELID in fxruby. Was there a reason to add the "FX" prefixes? -- R. Mark Volkmann Object Computing, Inc. From r.mark.volkmann at gmail.com Mon Mar 27 19:43:34 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Mon, 27 Mar 2006 18:43:34 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable Message-ID: What's the proper way to detect when a row header or column header in an FXTable is clicked. I tried this, but it didn't work. table.connect(SEL_SELECTED) do |table, selection, position| type = FXSELTYPE(selection) identifier = FXSELID(selection) puts "column selected" if identier == FXTable::ID_SELECT_COLUMN end It seems that identifier always gets set to zero. -- R. Mark Volkmann Object Computing, Inc. From lyle at knology.net Mon Mar 27 20:29:09 2006 From: lyle at knology.net (Lyle Johnson) Date: Mon, 27 Mar 2006 19:29:09 -0600 Subject: [fxruby-users] SELTYPE and SELID methods In-Reply-To: References: Message-ID: On Mar 27, 2006, at 6:39 PM, Mark Volkmann wrote: > I understand that in FOX, the SELTYPE and SELID methods are used to > extract the type and identifer from a message selector value. I wonder > why those methods are named FXSELTYPE and FXSELID in fxruby. Was there > a reason to add the "FX" prefixes? In FOX 1.0, those methods were named SELID and SELTYPE. Their names were changed to FXSELID and FXSELTYPE in FOX 1.2. I assume that Jeroen changed the names to avoid a potential name clash, but you'd need to ask him. From lyle at knology.net Mon Mar 27 20:32:35 2006 From: lyle at knology.net (Lyle Johnson) Date: Mon, 27 Mar 2006 19:32:35 -0600 Subject: [fxruby-users] FXMenuBar.new(self) raises ArgumentError In-Reply-To: <44286E72.6060608@path.berkeley.edu> References: <44286E72.6060608@path.berkeley.edu> Message-ID: <087631114d2be6b749319059ba2f052d@knology.net> On Mar 27, 2006, at 5:00 PM, Joel VanderWerf wrote: > > I've been away from FXRuby code for a while, and was surprised that > > mb = FXMenuBar.new(self) > > which used to work (in 1.2 I guess) now in 1.4 causes this: > > No matching function for overloaded 'new_FXMenuBar' (ArgumentError) > > It was easily fixed with: > > mb = FXMenuBar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) > > But it seems like FXMenuBar.new should have a default that works. Not a > big issue though... That changed in FOX 1.4, although I don't know the reasoning for the change. I made the same change in FXRuby to keep the APIs consistent, but I agree that I should have provided for some kind of backwards compatibility there (even if FOX didn't). From lyle at knology.net Mon Mar 27 20:36:59 2006 From: lyle at knology.net (Lyle Johnson) Date: Mon, 27 Mar 2006 19:36:59 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: On Mar 27, 2006, at 6:43 PM, Mark Volkmann wrote: > What's the proper way to detect when a row header or column header in > an FXTable is clicked. I tried this, but it didn't work. > > table.connect(SEL_SELECTED) do |table, selection, position| > type = FXSELTYPE(selection) > identifier = FXSELID(selection) > puts "column selected" if identier == FXTable::ID_SELECT_COLUMN > end > > It seems that identifier always gets set to zero. A bug was fixed for this in FXRuby 1.4.4 (see the change notes at http://www.fxruby.org/doc/changes.html). The table widget is supposed to send an FXTablePos instance along as its message data, from which you could extract the selected row and column: table.connect(SEL_SELECTED) do |table, sel, table_pos| puts "selected row, col = #{table_pos.row}, #{table_pos.col}" end Hope this helps, Lyle From r.mark.volkmann at gmail.com Mon Mar 27 20:49:05 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Mon, 27 Mar 2006 19:49:05 -0600 Subject: [fxruby-users] SELTYPE and SELID methods In-Reply-To: References: Message-ID: On 3/27/06, Lyle Johnson wrote: > > On Mar 27, 2006, at 6:39 PM, Mark Volkmann wrote: > > > I understand that in FOX, the SELTYPE and SELID methods are used to > > extract the type and identifer from a message selector value. I wonder > > why those methods are named FXSELTYPE and FXSELID in fxruby. Was there > > a reason to add the "FX" prefixes? > > In FOX 1.0, those methods were named SELID and SELTYPE. Their names > were changed to FXSELID and FXSELTYPE in FOX 1.2. I assume that Jeroen > changed the names to avoid a potential name clash, but you'd need to > ask him. Ah, so it's not unique to fxruby. That's good to know. -- R. Mark Volkmann Object Computing, Inc. From vjoel at path.berkeley.edu Mon Mar 27 20:54:39 2006 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Mon, 27 Mar 2006 17:54:39 -0800 Subject: [fxruby-users] SELTYPE and SELID methods In-Reply-To: References: Message-ID: <4428975F.40606@path.berkeley.edu> Lyle Johnson wrote: > On Mar 27, 2006, at 6:39 PM, Mark Volkmann wrote: > >> I understand that in FOX, the SELTYPE and SELID methods are used to >> extract the type and identifer from a message selector value. I wonder >> why those methods are named FXSELTYPE and FXSELID in fxruby. Was there >> a reason to add the "FX" prefixes? > > In FOX 1.0, those methods were named SELID and SELTYPE. Their names > were changed to FXSELID and FXSELTYPE in FOX 1.2. I assume that Jeroen > changed the names to avoid a potential name clash, but you'd need to > ask him. Any idea why they show up as SELID and SELTYPE in the 1.4.4 gem docs? I'm looking under the Fox module, and almost everthing is FXsomething or fxsomething. But a few (including these) do not have the prefix. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From r.mark.volkmann at gmail.com Mon Mar 27 21:03:20 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Mon, 27 Mar 2006 20:03:20 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: On 3/27/06, Lyle Johnson wrote: > > On Mar 27, 2006, at 6:43 PM, Mark Volkmann wrote: > > > What's the proper way to detect when a row header or column header in > > an FXTable is clicked. I tried this, but it didn't work. > > > > table.connect(SEL_SELECTED) do |table, selection, position| > > type = FXSELTYPE(selection) > > identifier = FXSELID(selection) > > puts "column selected" if identier == FXTable::ID_SELECT_COLUMN > > end > > > > It seems that identifier always gets set to zero. > > A bug was fixed for this in FXRuby 1.4.4 (see the change notes at > http://www.fxruby.org/doc/changes.html). The table widget is supposed > to send an FXTablePos instance along as its message data, from which > you could extract the selected row and column: > > table.connect(SEL_SELECTED) do |table, sel, table_pos| > puts "selected row, col = #{table_pos.row}, #{table_pos.col}" > end When I click a column header, I get a separate event for every cell in that column. Is there a way to just get one event that says a column header (or a row header) was selected? -- R. Mark Volkmann Object Computing, Inc. From r.mark.volkmann at gmail.com Mon Mar 27 22:06:12 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Mon, 27 Mar 2006 21:06:12 -0600 Subject: [fxruby-users] FXTable size Message-ID: Sorry to keep asking basic questions. I've searched the document for FXTable and don't see a method that returns the number of rows and columns in the table. How do I get that information? -- R. Mark Volkmann Object Computing, Inc. From lyle at knology.net Mon Mar 27 22:21:32 2006 From: lyle at knology.net (Lyle Johnson) Date: Mon, 27 Mar 2006 21:21:32 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: On Mar 27, 2006, at 8:03 PM, Mark Volkmann wrote: > When I click a column header, I get a separate event for every cell in > that column. > Is there a way to just get one event that says a column header (or a > row header) was selected? FOX calls the selectColumn() method when you click on a column header, so I think you might be able to pull this off if you subclass FXTable and override its selectColumn() method, e.g. class MyTable < FXTable def selectColumn(col, notify=false) puts "selected column #{col}" super end end Hope this helps, Lyle From lyle at knology.net Mon Mar 27 22:23:41 2006 From: lyle at knology.net (Lyle Johnson) Date: Mon, 27 Mar 2006 21:23:41 -0600 Subject: [fxruby-users] SELTYPE and SELID methods In-Reply-To: <4428975F.40606@path.berkeley.edu> References: <4428975F.40606@path.berkeley.edu> Message-ID: <8e1f003d2d05184175f99e5b54f60e4a@knology.net> On Mar 27, 2006, at 7:54 PM, Joel VanderWerf wrote: > Any idea why they show up as SELID and SELTYPE in the 1.4.4 gem docs? Ah, that's a typo. Their real names are FXSELTYPE and FXSELID, but I must have overlooked this change in the RDocs. From lyle at knology.net Mon Mar 27 22:28:56 2006 From: lyle at knology.net (Lyle Johnson) Date: Mon, 27 Mar 2006 21:28:56 -0600 Subject: [fxruby-users] FXTable size In-Reply-To: References: Message-ID: <91d28f6bd3836d7ffca72eb27b175f38@knology.net> On Mar 27, 2006, at 9:06 PM, Mark Volkmann wrote: > Sorry to keep asking basic questions. I've searched the document for > FXTable and don't see a method that returns the number of rows and > columns in the table. How do I get that information? No problem about the questions, and its the numRows and numColumns attributes that you're looking for: r, c = table.numRows, table.numColumns These are listed in the "Attributes" section for the API documentation on FXTable. For methods like these it is sometimes a little gray (to me, anyways) about whether they should be listed in the "Public Instance Methods" section or in the "Attributes" section. So if in doubt, check both places. ;) From ujb1 at gmx.de Tue Mar 28 11:14:06 2006 From: ujb1 at gmx.de (Dirk Schwendemann) Date: Tue, 28 Mar 2006 18:14:06 +0200 (MEST) Subject: [fxruby-users] intercepting messages from FXScrollBar to FXScrollArea Message-ID: <7231.1143562446@www056.gmx.net> Hi FXRuby-users, I want to connect to SEL_CONFIGURE events of a FXScrollBar. The corresponding code looks like this: @scrollArea.verticalScrollBar.connect(SEL_CONFIGURE){ ... } After this connect, the ScrollArea doesn't receive any events. Before the call, the target of the Scrollbar was the FXScrollArea. After the call, the connect method has created an PseudoTarget that has overwritten the original target. Any idea, how I can connect to the verticalScrollBar without disturbing the ScrollArea? One more question: Is there a "global" hook method that can be used in a FXObject to intercept all messages sent to this object? The handle method of FXObject doesn't seem to work for this Thanks, Dirk -- Echte DSL-Flatrate dauerhaft f?r 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl From lyle at knology.net Tue Mar 28 14:20:49 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 28 Mar 2006 13:20:49 -0600 Subject: [fxruby-users] intercepting messages from FXScrollBar to FXScrollArea In-Reply-To: <7231.1143562446@www056.gmx.net> References: <7231.1143562446@www056.gmx.net> Message-ID: <1703396b249c752fd2f11d68c324982a@knology.net> On Mar 28, 2006, at 10:14 AM, Dirk Schwendemann wrote: > I want to connect to SEL_CONFIGURE events of a FXScrollBar... What is it that you're trying to accomplish? From r.mark.volkmann at gmail.com Tue Mar 28 14:32:08 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Tue, 28 Mar 2006 13:32:08 -0600 Subject: [fxruby-users] setting widget attributes Message-ID: I'm trying to set attributes of widgets in subclasses like the following. class PersonTable < FXTable def initialize(owner) options = TABLE_COL_SIZEABLE super(owner, nil, 0, options) visibleRows = 5 ... end end visibleRows doesn't get set. However, if I do this self.visibleRows = 5 then it does. Shouldn't it work without "self."? -- R. Mark Volkmann Object Computing, Inc. From r.mark.volkmann at gmail.com Tue Mar 28 14:47:57 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Tue, 28 Mar 2006 13:47:57 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: On 3/27/06, Lyle Johnson wrote: > > On Mar 27, 2006, at 8:03 PM, Mark Volkmann wrote: > > > When I click a column header, I get a separate event for every cell in > > that column. > > Is there a way to just get one event that says a column header (or a > > row header) was selected? > > FOX calls the selectColumn() method when you click on a column header, > so I think you might be able to pull this off if you subclass FXTable > and override its selectColumn() method, e.g. > > class MyTable < FXTable > def selectColumn(col, notify=false) > puts "selected column #{col}" > super > end > end Are you sure about this? I've overridden that method and it doesn't get called when I click a column header. I wonder if that method is only used to programatically select a column. Hopefully there is another way to be notified that the user clicked a column heading. -- R. Mark Volkmann Object Computing, Inc. From lyle at knology.net Tue Mar 28 14:56:21 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 28 Mar 2006 13:56:21 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: On Mar 28, 2006, at 1:47 PM, Mark Volkmann wrote: > Are you sure about this? I've overridden that method and it doesn't > get called when I click a column header... Looking at the code again, I think I see a bug (in FOX). Let me check this with Jeroen and see if there's been a fix. From vjoel at path.berkeley.edu Tue Mar 28 15:01:52 2006 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Tue, 28 Mar 2006 12:01:52 -0800 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: <44299630.3000001@path.berkeley.edu> Mark Volkmann wrote: > I'm trying to set attributes of widgets in subclasses like the following. > > class PersonTable < FXTable > def initialize(owner) > options = TABLE_COL_SIZEABLE > super(owner, nil, 0, options) > > visibleRows = 5 > ... > end > end > > visibleRows doesn't get set. > However, if I do this > > self.visibleRows = 5 > > then it does. > > Shouldn't it work without "self."? That's a general ruby principle: any expression like identifier = value assigns to a local variable, even if there is a method identifier= . -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From lyle at knology.net Tue Mar 28 15:07:06 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 28 Mar 2006 14:07:06 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: On Mar 28, 2006, at 1:47 PM, Mark Volkmann wrote: > Are you sure about this? I've overridden that method and it doesn't > get called when I click a column header. I wonder if that method is > only used to programatically select a column. Hopefully there is > another way to be notified that the user clicked a column heading. Mark, I was mistaken in my previous e-mail. It doesn't look like that method (selectColumn) or the message handler associated with it (onCmdSelectColumn) ever gets used. I suspect it's dead code, and I've posted a question about it on the foxgui-users list. So back to your original question, it doesn't look like there's an easy way to catch this event. When the user clicks on a column header, the table receives an ID_SELECT_COLUMN_INDEX message which is handled by its onCmdSelectColumnIndex() method. This is not a virtual method (in C++) that we can override. I'll think about a possible workaround but nothing obvious comes to mind, unfortunately. Lyle From lyle at knology.net Tue Mar 28 15:09:29 2006 From: lyle at knology.net (Lyle Johnson) Date: Tue, 28 Mar 2006 14:09:29 -0600 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: On Mar 28, 2006, at 1:32 PM, Mark Volkmann wrote: > However, if I do this > > self.visibleRows = 5 > > then it does. > > Shouldn't it work without "self."? Nope, and this is a Ruby thing (not particular to FXRuby, I mean). When you do: visibleRows = 5 Ruby assumes that you're initializing a local variable. You only invoke the accessor method for the visibleRows attribute when you prepend it with self (as you've discovered). From meinrad.recheis at gmail.com Tue Mar 28 16:07:08 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 28 Mar 2006 23:07:08 +0200 Subject: [fxruby-users] intercepting messages from FXScrollBar to FXScrollArea In-Reply-To: <1703396b249c752fd2f11d68c324982a@knology.net> References: <7231.1143562446@www056.gmx.net> <1703396b249c752fd2f11d68c324982a@knology.net> Message-ID: <43d756720603281307r21cce0b0i90c4efbd90967136@mail.gmail.com> hi dirk, maybe i am wrong, but i think it's possible like this: @scrollArea.verticalScrollBar.connect(SEL_CONFIGURE){ # your code here... next 0 # tell fox to execute the original message handler. } hth -- henon On 3/28/06, Lyle Johnson wrote: > > On Mar 28, 2006, at 10:14 AM, Dirk Schwendemann wrote: > > > I want to connect to SEL_CONFIGURE events of a FXScrollBar... > > What is it that you're trying to accomplish? > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From r.mark.volkmann at gmail.com Tue Mar 28 16:08:02 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Tue, 28 Mar 2006 15:08:02 -0600 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: On 3/28/06, Lyle Johnson wrote: > > On Mar 28, 2006, at 1:32 PM, Mark Volkmann wrote: > > > However, if I do this > > > > self.visibleRows = 5 > > > > then it does. > > > > Shouldn't it work without "self."? > > Nope, and this is a Ruby thing (not particular to FXRuby, I mean). When > you do: > > visibleRows = 5 > > Ruby assumes that you're initializing a local variable. You only invoke > the accessor method for the visibleRows attribute when you prepend it > with self (as you've discovered). Since visibleRows is listed as an RW "attribute" in the RDoc, I thought that implied there were methods named "visibleRows" and visibleRows=" available. That's what I thought I was invoking with "visibleRows = 5". If those methods existed then Ruby wouldn't have thought I wanted to initialize a local variable. Right? Since those accessor methods don't exist, I'll just use "@visibleRows = 5". -- R. Mark Volkmann Object Computing, Inc. From meinrad.recheis at gmail.com Tue Mar 28 16:12:12 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 28 Mar 2006 23:12:12 +0200 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: <43d756720603281312v2e5e5639qed60df4b445926b7@mail.gmail.com> On 3/28/06, Mark Volkmann wrote: > I'm trying to set attributes of widgets in subclasses like the following. > > class PersonTable < FXTable > def initialize(owner) > options = TABLE_COL_SIZEABLE > super(owner, nil, 0, options) > > visibleRows = 5 > ... > end > end > > visibleRows doesn't get set. > However, if I do this > > self.visibleRows = 5 > > then it does. > > Shouldn't it work without "self."? that's a common problem with ruby extensions. but i don't understand the underlying principle ;) -- henon From r.mark.volkmann at gmail.com Tue Mar 28 16:14:35 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Tue, 28 Mar 2006 15:14:35 -0600 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: On 3/28/06, Mark Volkmann wrote: > On 3/28/06, Lyle Johnson wrote: > > > > On Mar 28, 2006, at 1:32 PM, Mark Volkmann wrote: > > > > > However, if I do this > > > > > > self.visibleRows = 5 > > > > > > then it does. > > > > > > Shouldn't it work without "self."? > > > > Nope, and this is a Ruby thing (not particular to FXRuby, I mean). When > > you do: > > > > visibleRows = 5 > > > > Ruby assumes that you're initializing a local variable. You only invoke > > the accessor method for the visibleRows attribute when you prepend it > > with self (as you've discovered). > > Since visibleRows is listed as an RW "attribute" in the RDoc, I > thought that implied there were methods named "visibleRows" and > visibleRows=" available. That's what I thought I was invoking with > "visibleRows = 5". If those methods existed then Ruby wouldn't have > thought I wanted to initialize a local variable. Right? > > Since those accessor methods don't exist, I'll just use "@visibleRows = 5". Eeek! This doesn't work. I'm so confused. Is visibleRows an instance variable of FXTable? If so, why can't I access it directly from a subclass with "@visibleRows"? Does it have accessor methods? If so, why can't I invoke them directly from a subclass without using "self."? Sorry to ask basic Ruby questions. I thought I understood this, but apparently not. -- R. Mark Volkmann Object Computing, Inc. From meinrad.recheis at gmail.com Tue Mar 28 16:31:02 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 28 Mar 2006 23:31:02 +0200 Subject: [fxruby-users] setting widget attributes In-Reply-To: <43d756720603281312v2e5e5639qed60df4b445926b7@mail.gmail.com> References: <43d756720603281312v2e5e5639qed60df4b445926b7@mail.gmail.com> Message-ID: <43d756720603281331k54dabc05labc33cdd2dcaa10b@mail.gmail.com> On 3/28/06, Meinrad Recheis wrote: > On 3/28/06, Mark Volkmann wrote: > > I'm trying to set attributes of widgets in subclasses like the following. > > > > class PersonTable < FXTable > > def initialize(owner) > > options = TABLE_COL_SIZEABLE > > super(owner, nil, 0, options) > > > > visibleRows = 5 > > ... > > end > > end > > > > visibleRows doesn't get set. > > However, if I do this > > > > self.visibleRows = 5 > > > > then it does. > > > > Shouldn't it work without "self."? > > that's a common problem with ruby extensions. but i don't understand > the underlying principle ;) thanks to joel now i do :D From lyle at knology.net Tue Mar 28 17:35:29 2006 From: lyle at knology.net (lyle at knology.net) Date: 28 Mar 2006 22:35:29 -0000 Subject: [fxruby-users] setting widget attributes In-Reply-To: <> References: <> Message-ID: <20060328223529.11409.qmail@webmail3.knology.net> On Tue, 28 Mar 2006 15:08:02 -0600, "Mark Volkmann" wrote : > Since visibleRows is listed as an RW "attribute" in the RDoc, I > thought that implied there were methods named "visibleRows" and > visibleRows=" available. There are! You just have to be careful about how you invoke those methods. > That's what I thought I was invoking with > "visibleRows = 5". If those methods existed then Ruby wouldn't have > thought I wanted to initialize a local variable. Right? I'm not Matz; you are arguing with the wrong person. ;) From meinrad.recheis at gmail.com Tue Mar 28 17:46:50 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 29 Mar 2006 00:46:50 +0200 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: <43d756720603281446k49c04606me4bdb7f23803b04d@mail.gmail.com> On 3/28/06, Mark Volkmann wrote: > On 3/28/06, Lyle Johnson wrote: > > > > On Mar 28, 2006, at 1:32 PM, Mark Volkmann wrote: > > > > > However, if I do this > > > > > > self.visibleRows = 5 > > > > > > then it does. > > > > > > Shouldn't it work without "self."? > > > > Nope, and this is a Ruby thing (not particular to FXRuby, I mean). When > > you do: > > > > visibleRows = 5 > > > > Ruby assumes that you're initializing a local variable. You only invoke > > the accessor method for the visibleRows attribute when you prepend it > > with self (as you've discovered). > > Since visibleRows is listed as an RW "attribute" in the RDoc, I > thought that implied there were methods named "visibleRows" and > visibleRows=" available. That's what I thought I was invoking with > "visibleRows = 5". If those methods existed then Ruby wouldn't have > thought I wanted to initialize a local variable. Right? > > Since those accessor methods don't exist, I'll just use "@visibleRows = 5". that won't work ;) all attributes are accessible via methods only. there are no instance variables (with some exceptions) because the attributes have to be passed to the underlying C++ library. -- henon From lyle at knology.net Tue Mar 28 17:48:50 2006 From: lyle at knology.net (lyle at knology.net) Date: 28 Mar 2006 22:48:50 -0000 Subject: [fxruby-users] setting widget attributes In-Reply-To: <> References: <> Message-ID: <20060328224850.16673.qmail@webmail3.knology.net> On Tue, 28 Mar 2006 15:14:35 -0600, "Mark Volkmann" wrote : > Eeek! This doesn't work. I'm so confused. > > Is visibleRows an instance variable of FXTable? > If so, why can't I access it directly from a subclass with "@visibleRows"? No, @visibleRows is not a real instance variable for FXTable. That value is buried way down deep in the C++ object. > Does it have accessor methods? Yes, but they are more along the lines of what Dave and Andy called "virtual attributes". See the "Classes, Objects and Variables" chapter of Programming Ruby (http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_classes.html), and look at the section called "Virtual Attributes". > If so, why can't I invoke them directly from a subclass > without using "self."? As I've noted in other replies, this is just how Ruby works. There is some discussion of this in Programming Ruby as well; see the sidebar titled "Using Accessors Within a Class" in the "Expressions" chapter (http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html). From r.mark.volkmann at gmail.com Tue Mar 28 17:53:23 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Tue, 28 Mar 2006 16:53:23 -0600 Subject: [fxruby-users] setting widget attributes In-Reply-To: <43d756720603281312v2e5e5639qed60df4b445926b7@mail.gmail.com> References: <43d756720603281312v2e5e5639qed60df4b445926b7@mail.gmail.com> Message-ID: On 3/28/06, Meinrad Recheis wrote: > On 3/28/06, Mark Volkmann wrote: > > I'm trying to set attributes of widgets in subclasses like the following. > > > > class PersonTable < FXTable > > def initialize(owner) > > options = TABLE_COL_SIZEABLE > > super(owner, nil, 0, options) > > > > visibleRows = 5 > > ... > > end > > end > > > > visibleRows doesn't get set. > > However, if I do this > > > > self.visibleRows = 5 > > > > then it does. > > > > Shouldn't it work without "self."? > > that's a common problem with ruby extensions. but i don't understand > the underlying principle ;) I think I do now, so I'll try to pass on what is happening. When Ruby sees something like this foo bar it starts by checking the current object referred to by self to see if it has a method named "foo". If it does, that is used. If it doesn't, the method search continues through singleton methods, class methods, included module methods, and up the inheritance hierachy. But what about a method named "foo="? I assumed that if I wrote foo = bar the same method search would apply. However, it does not. It will just create a local variable named foo and assign bar to it. But if I write self.foo = bar then it knows I'm invoking a method and it knows the receiver and will look for a foo= method in the current object. -- R. Mark Volkmann Object Computing, Inc. From meinrad.recheis at gmail.com Tue Mar 28 17:57:50 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 29 Mar 2006 00:57:50 +0200 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: References: Message-ID: <43d756720603281457v1b96dc0ay84dfbe8e0ed51714@mail.gmail.com> On 3/28/06, Mark Volkmann wrote: > On 3/27/06, Lyle Johnson wrote: > > > > On Mar 27, 2006, at 6:43 PM, Mark Volkmann wrote: > > > > > What's the proper way to detect when a row header or column header in > > > an FXTable is clicked. I tried this, but it didn't work. > > > > > > table.connect(SEL_SELECTED) do |table, selection, position| > > > type = FXSELTYPE(selection) > > > identifier = FXSELID(selection) > > > puts "column selected" if identier == FXTable::ID_SELECT_COLUMN > > > end > > > > > > It seems that identifier always gets set to zero. > > > > A bug was fixed for this in FXRuby 1.4.4 (see the change notes at > > http://www.fxruby.org/doc/changes.html). The table widget is supposed > > to send an FXTablePos instance along as its message data, from which > > you could extract the selected row and column: > > > > table.connect(SEL_SELECTED) do |table, sel, table_pos| > > puts "selected row, col = #{table_pos.row}, #{table_pos.col}" > > end > > When I click a column header, I get a separate event for every cell in > that column. > Is there a way to just get one event that says a column header (or a > row header) was selected? > @table.columnHeader.connect(SEL_COMMAND){|a,b,index| #... } works well for me. -- henon From meinrad.recheis at gmail.com Tue Mar 28 18:05:28 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 29 Mar 2006 01:05:28 +0200 Subject: [fxruby-users] setting widget attributes In-Reply-To: References: Message-ID: <43d756720603281505r5860446fmd9028b020077681a@mail.gmail.com> On 3/28/06, Mark Volkmann wrote: > On 3/28/06, Mark Volkmann wrote: > > On 3/28/06, Lyle Johnson wrote: > > > > > > On Mar 28, 2006, at 1:32 PM, Mark Volkmann wrote: > > > > > > > However, if I do this > > > > > > > > self.visibleRows = 5 > > > > > > > > then it does. > > > > > > > > Shouldn't it work without "self."? > > > > > > Nope, and this is a Ruby thing (not particular to FXRuby, I mean). When > > > you do: > > > > > > visibleRows = 5 > > > > > > Ruby assumes that you're initializing a local variable. You only invoke > > > the accessor method for the visibleRows attribute when you prepend it > > > with self (as you've discovered). > > > > Since visibleRows is listed as an RW "attribute" in the RDoc, I > > thought that implied there were methods named "visibleRows" and > > visibleRows=" available. That's what I thought I was invoking with > > "visibleRows = 5". If those methods existed then Ruby wouldn't have > > thought I wanted to initialize a local variable. Right? > > > > Since those accessor methods don't exist, I'll just use "@visibleRows = 5". > > Eeek! This doesn't work. I'm so confused. > > Is visibleRows an instance variable of FXTable? > If so, why can't I access it directly from a subclass with "@visibleRows"? no it isn't as i have explained in my previous mail. > > Does it have accessor methods? > If so, why can't I invoke them directly from a subclass without using "self."? yes, the accessors exist. but as joel has explained bevore ruby assumes that you are defining local variables so you need to use self. > > Sorry to ask basic Ruby questions. I thought I understood this, but > apparently not. no problem. hope that helps, -- henon From ujb1 at gmx.de Wed Mar 29 02:47:25 2006 From: ujb1 at gmx.de (Dirk Schwendemann) Date: Wed, 29 Mar 2006 09:47:25 +0200 (MEST) Subject: [fxruby-users] intercepting messages from FXScrollBar toFXScrollArea Message-ID: <31697.1143618445@www057.gmx.net> Hello Lyle, the Task, I want to accomplish: I've created a little app that is used on a PC with a touch screen. To ease hitting the keys, the keys and the scrollbars are really big (45 pixels). So the ScrollCorner is also really big and I just wanted to use this space by moving the ScrollDown Botton down to the position of the ScrollCorner (like the attachment shows) The code looks like this (it seems to work unless that you can't use the scrollbar afterward): textField.verticalScrollBar.connect(SEL_CONFIGURE){ textField.scrollCorner.destroy() width = textField.verticalScrollBar.width height = textField.height textField.verticalScrollBar.resize(width, height) } The connect method has changed the target of the ScrollBar and so the ScrollArea doesn't get any further messages from the ScrollBar. How can I avoid that connect prevents the ScrollArea from receiving messages? I don't want to subclass FXScrollArea, as I'm using foxGUIb to create the gui. Best regards, Dirk -- "Feel free" mit GMX FreeMail! Monat f?r Monat 10 FreeSMS inklusive! http://www.gmx.net -------------- next part -------------- A non-text attachment was scrubbed... Name: app.PNG Type: image/png Size: 11946 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060329/de4673fb/attachment.png From lyle at knology.net Wed Mar 29 08:33:34 2006 From: lyle at knology.net (Lyle Johnson) Date: Wed, 29 Mar 2006 07:33:34 -0600 Subject: [fxruby-users] intercepting messages from FXScrollBar toFXScrollArea In-Reply-To: <31697.1143618445@www057.gmx.net> References: <31697.1143618445@www057.gmx.net> Message-ID: On Mar 29, 2006, at 1:47 AM, Dirk Schwendemann wrote: > I've created a little app that is used on a PC with a touch screen. To > ease > hitting the keys, the keys and the scrollbars are really big (45 > pixels). So > the ScrollCorner is also really big and I just wanted to use this > space by > moving the ScrollDown Botton down to the position of the ScrollCorner > (like > the attachment shows) Ah, OK! > The code looks like this (it seems to work unless that you can't use > the > scrollbar afterward): > > textField.verticalScrollBar.connect(SEL_CONFIGURE){ > textField.scrollCorner.destroy() > width = textField.verticalScrollBar.width > height = textField.height > textField.verticalScrollBar.resize(width, height) > } > > The connect method has changed the target of the ScrollBar and so the > ScrollArea doesn't get any further messages from the ScrollBar. How > can I > avoid that connect prevents the ScrollArea from receiving messages? Hmmm. You can always just reassign the verticalScrollBar's original target and message id after you've handled the SEL_CONFIGURE message, e.g. textField.verticalScrollBar.connect(SEL_CONFIGURE) { ... everything as listed above ... textField.verticalScrollBar.target = textField textField.verticalScrollBar.selector = FXWindow::ID_VSCROLLED } but then the *next* time the scroll bar sends a SEL_CONFIGURE message, you wouldn't get it. Maybe you could write a little class that would handle the SEL_CONFIGURE message and forward any other messages back to the FXScrollArea? Hope this helps, Lyle From r.mark.volkmann at gmail.com Wed Mar 29 10:28:28 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Wed, 29 Mar 2006 09:28:28 -0600 Subject: [fxruby-users] detecting row and column selections in an FXTable In-Reply-To: <43d756720603281457v1b96dc0ay84dfbe8e0ed51714@mail.gmail.com> References: <43d756720603281457v1b96dc0ay84dfbe8e0ed51714@mail.gmail.com> Message-ID: On 3/28/06, Meinrad Recheis wrote: > On 3/28/06, Mark Volkmann wrote: > > On 3/27/06, Lyle Johnson wrote: > > > > > > On Mar 27, 2006, at 6:43 PM, Mark Volkmann wrote: > > > > > > > What's the proper way to detect when a row header or column header in > > > > an FXTable is clicked. I tried this, but it didn't work. > > > > > > > > table.connect(SEL_SELECTED) do |table, selection, position| > > > > type = FXSELTYPE(selection) > > > > identifier = FXSELID(selection) > > > > puts "column selected" if identier == FXTable::ID_SELECT_COLUMN > > > > end > > > > > > > > It seems that identifier always gets set to zero. > > > > > > A bug was fixed for this in FXRuby 1.4.4 (see the change notes at > > > http://www.fxruby.org/doc/changes.html). The table widget is supposed > > > to send an FXTablePos instance along as its message data, from which > > > you could extract the selected row and column: > > > > > > table.connect(SEL_SELECTED) do |table, sel, table_pos| > > > puts "selected row, col = #{table_pos.row}, #{table_pos.col}" > > > end > > > > When I click a column header, I get a separate event for every cell in > > that column. > > Is there a way to just get one event that says a column header (or a > > row header) was selected? > > > > @table.columnHeader.connect(SEL_COMMAND){|a,b,index| > > #... > > } Woo hoo! This is exactly what I needed. Thanks! -- R. Mark Volkmann Object Computing, Inc. From r.mark.volkmann at gmail.com Wed Mar 29 14:47:20 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Wed, 29 Mar 2006 13:47:20 -0600 Subject: [fxruby-users] FXOptionMenu setCurrent method Message-ID: I've got a FXOptionMenu that is associated with an FXPopup that has several FXOptions. At some point after creating this, I'd like to set the current value of the option menu. I see that FXOptionMenu has a setCurrent method, but it's not clear to me what I'm suppose to pass to that. Does anyone know how to use that method or if that's the normal way to set the value of an option menu? -- R. Mark Volkmann Object Computing, Inc. From meinrad.recheis at gmail.com Wed Mar 29 15:03:19 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 29 Mar 2006 22:03:19 +0200 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: References: Message-ID: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> On 3/29/06, Mark Volkmann wrote: > I've got a FXOptionMenu that is associated with an FXPopup that has > several FXOptions. > At some point after creating this, I'd like to set the current value > of the option menu. I see that FXOptionMenu has a setCurrent method, > but it's not clear to me what I'm suppose to pass to that. Does anyone > know how to use that method or if that's the normal way to set the > value of an option menu? several widgets have this method "setCurrent". it always takes an index to the element that shall become the current one. best wishes, -- henon From r.mark.volkmann at gmail.com Wed Mar 29 15:08:54 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Wed, 29 Mar 2006 14:08:54 -0600 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> References: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> Message-ID: On 3/29/06, Meinrad Recheis wrote: > On 3/29/06, Mark Volkmann wrote: > > I've got a FXOptionMenu that is associated with an FXPopup that has > > several FXOptions. > > At some point after creating this, I'd like to set the current value > > of the option menu. I see that FXOptionMenu has a setCurrent method, > > but it's not clear to me what I'm suppose to pass to that. Does anyone > > know how to use that method or if that's the normal way to set the > > value of an option menu? > > several widgets have this method "setCurrent". it always takes an > index to the element that shall become the current one. Thanks! What if I don't know the index, but I know the string value. Is there a way I can loop though the values in an option menu and determine the index of the one I want to select? -- R. Mark Volkmann Object Computing, Inc. From meinrad.recheis at gmail.com Wed Mar 29 15:24:35 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 29 Mar 2006 22:24:35 +0200 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: References: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> Message-ID: <43d756720603291224i31ecfd22k78587e67afecd7f9@mail.gmail.com> On 3/29/06, Mark Volkmann wrote: > On 3/29/06, Meinrad Recheis wrote: > > On 3/29/06, Mark Volkmann wrote: > > > I've got a FXOptionMenu that is associated with an FXPopup that has > > > several FXOptions. > > > At some point after creating this, I'd like to set the current value > > > of the option menu. I see that FXOptionMenu has a setCurrent method, > > > but it's not clear to me what I'm suppose to pass to that. Does anyone > > > know how to use that method or if that's the normal way to set the > > > value of an option menu? > > > > several widgets have this method "setCurrent". it always takes an > > index to the element that shall become the current one. > > Thanks! What if I don't know the index, but I know the string value. > Is there a way I can loop though the values in an option menu and > determine the index of the one I want to select? have you tried it? i think i was wrong. FXOptionMenu#current is documented like this: current [RW] The current option, or nil if none [FXOption] which means you can set the option you want directly by passing it to "current=" anyways, if you want to iterate over all options there is a method FXOptionMenu#children returning an array of options. sorry for the erratic response of mine. -- henon From r.mark.volkmann at gmail.com Wed Mar 29 15:32:11 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Wed, 29 Mar 2006 14:32:11 -0600 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: <43d756720603291224i31ecfd22k78587e67afecd7f9@mail.gmail.com> References: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> <43d756720603291224i31ecfd22k78587e67afecd7f9@mail.gmail.com> Message-ID: On 3/29/06, Meinrad Recheis wrote: > On 3/29/06, Mark Volkmann wrote: > > On 3/29/06, Meinrad Recheis wrote: > > > On 3/29/06, Mark Volkmann wrote: > > > > I've got a FXOptionMenu that is associated with an FXPopup that has > > > > several FXOptions. > > > > At some point after creating this, I'd like to set the current value > > > > of the option menu. I see that FXOptionMenu has a setCurrent method, > > > > but it's not clear to me what I'm suppose to pass to that. Does anyone > > > > know how to use that method or if that's the normal way to set the > > > > value of an option menu? > > > > > > several widgets have this method "setCurrent". it always takes an > > > index to the element that shall become the current one. > > > > Thanks! What if I don't know the index, but I know the string value. > > Is there a way I can loop though the values in an option menu and > > determine the index of the one I want to select? > have you tried it? i think i was wrong. FXOptionMenu#current is > documented like this: > current [RW] The current option, or nil if none [FXOption] > > which means you can set the option you want directly by passing it to "current=" When I do that I get "wrong argument type Fixnum (expected Data). I have no idea what a Data object is. > anyways, if you want to iterate over all options there is a method > FXOptionMenu#children returning an array of options. > sorry for the erratic response of mine. No problem. I'm glad for any response. -- R. Mark Volkmann Object Computing, Inc. From meinrad.recheis at gmail.com Wed Mar 29 15:38:49 2006 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 29 Mar 2006 22:38:49 +0200 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: References: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> <43d756720603291224i31ecfd22k78587e67afecd7f9@mail.gmail.com> Message-ID: <43d756720603291238i1404db70n960b37b261f25ba3@mail.gmail.com> On 3/29/06, Mark Volkmann wrote: > On 3/29/06, Meinrad Recheis wrote: > > On 3/29/06, Mark Volkmann wrote: > > > On 3/29/06, Meinrad Recheis wrote: > > > > On 3/29/06, Mark Volkmann wrote: > > > > > I've got a FXOptionMenu that is associated with an FXPopup that has > > > > > several FXOptions. > > > > > At some point after creating this, I'd like to set the current value > > > > > of the option menu. I see that FXOptionMenu has a setCurrent method, > > > > > but it's not clear to me what I'm suppose to pass to that. Does anyone > > > > > know how to use that method or if that's the normal way to set the > > > > > value of an option menu? > > > > > > > > several widgets have this method "setCurrent". it always takes an > > > > index to the element that shall become the current one. > > > > > > Thanks! What if I don't know the index, but I know the string value. > > > Is there a way I can loop though the values in an option menu and > > > determine the index of the one I want to select? > > have you tried it? i think i was wrong. FXOptionMenu#current is > > documented like this: > > current [RW] The current option, or nil if none [FXOption] > > > > which means you can set the option you want directly by passing it to "current=" > > When I do that I get "wrong argument type Fixnum (expected Data). I > have no idea what a Data object is. Fixnum? so you have tried to pass an index. but the doc says you can pass the option itself or nil. Data stands for a wrapped C object i think which means a fox widget. -- henon From desmarm at gmail.com Wed Mar 29 15:58:45 2006 From: desmarm at gmail.com (Matthew Desmarais) Date: Wed, 29 Mar 2006 15:58:45 -0500 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: <43d756720603291238i1404db70n960b37b261f25ba3@mail.gmail.com> References: <43d756720603291203j484fa40di5bd510dc08605739@mail.gmail.com> <43d756720603291224i31ecfd22k78587e67afecd7f9@mail.gmail.com> <43d756720603291238i1404db70n960b37b261f25ba3@mail.gmail.com> Message-ID: <442AF505.8070209@gmail.com> Meinrad Recheis wrote: > On 3/29/06, Mark Volkmann wrote: > >> On 3/29/06, Meinrad Recheis wrote: >> >>> On 3/29/06, Mark Volkmann wrote: >>> >>>> On 3/29/06, Meinrad Recheis wrote: >>>> >>>>> On 3/29/06, Mark Volkmann wrote: >>>>> >>>>>> I've got a FXOptionMenu that is associated with an FXPopup that has >>>>>> several FXOptions. >>>>>> At some point after creating this, I'd like to set the current value >>>>>> of the option menu. I see that FXOptionMenu has a setCurrent method, >>>>>> but it's not clear to me what I'm suppose to pass to that. Does anyone >>>>>> know how to use that method or if that's the normal way to set the >>>>>> value of an option menu? >>>>>> >>>>> several widgets have this method "setCurrent". it always takes an >>>>> index to the element that shall become the current one. >>>>> >>>> Thanks! What if I don't know the index, but I know the string value. >>>> Is there a way I can loop though the values in an option menu and >>>> determine the index of the one I want to select? >>>> >>> have you tried it? i think i was wrong. FXOptionMenu#current is >>> documented like this: >>> current [RW] The current option, or nil if none [FXOption] >>> >>> which means you can set the option you want directly by passing it to "current=" >>> >> When I do that I get "wrong argument type Fixnum (expected Data). I >> have no idea what a Data object is. >> > > Fixnum? so you have tried to pass an index. but the doc says you can > pass the option itself or nil. Data stands for a wrapped C object i > think which means a fox widget. > > -- henon > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > Hi guys, It's been my experience that when "Data" starts popping up in FXRuby stuff, it's time to go to the API Docs. Try the FXOptionMenu page[1]. I usually start around the attributes section. I think you'll find that the FXOptionMenu contains a list of FXOptions. You can get at them through either index ((get/set)CurrentNo) which takes a Fixnum or reference ((get/set)Current) which deals in FXOptions. Or that's the way it looks to me, anyway. I've not used the FXOptionMenu myself. I hope that helps. Matthew J Desmarais [1] http://fxruby.org/doc/api/classes/Fox/FXOptionMenu.html#M002096 From r.mark.volkmann at gmail.com Thu Mar 30 11:51:23 2006 From: r.mark.volkmann at gmail.com (Mark Volkmann) Date: Thu, 30 Mar 2006 10:51:23 -0600 Subject: [fxruby-users] setting value of FXCalendar Message-ID: Is there a way to programatically set the date displayed by an FXCalendar widget? -- R. Mark Volkmann Object Computing, Inc. From lyle at knology.net Thu Mar 30 13:56:13 2006 From: lyle at knology.net (lyle at knology.net) Date: 30 Mar 2006 18:56:13 -0000 Subject: [fxruby-users] You should explain how "require" translates names. In-Reply-To: <> References: <> Message-ID: <20060330185613.30359.qmail@webmail2.knology.net> On Thu, 30 Mar 2006 10:46:36 -0700, Stephen Tashiro wrote : > You do a good job of directing the Linux user to LD_LIBRARY_PATH and > ldconfig. But you frustrate people who "know exactly what your talking > about" in that regard but are new to Ruby. What such a reader needs to > know is: > How does > require 'fox14' > result in a search for libFox1.4.so ? > Should they try putting a full path name in the require? Should they > create a symbolic link from fox14 to libFox1.4.so? Or is there some > mapping of short names to library names that is configured in a file > somewhere? This is a key piece of information. Stephen, Thanks for pointing this out; it's been a long time since I wrote that part of the documentation and no one's really commented on it from this perspective. When Ruby sees: require 'fox14' it goes looking in Ruby's search path for a file named "fox14.so". That shared library contains the (compiled) C++ code that bridges between FOX and Ruby. The problem that I was describing in the User's Guide is that the loader can't find libFOX-1.4.so, which is a dependency of fox14.so. So no, they shouldn't put a full path name in the require statement -- Ruby has already found "fox14.so", it just can't find one of the shared libraries that "fox14.so" depends on. Nor should they create a symbolic link between fox14.so and libFOX-1.4.so -- they're two completely different pieces of code. -- Lyle From jeroen at fox-toolkit.org Thu Mar 30 20:43:57 2006 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 30 Mar 2006 19:43:57 -0600 Subject: [fxruby-users] FXOptionMenu setCurrent method In-Reply-To: References: Message-ID: <200603301943.57844.jeroen@fox-toolkit.org> On Wednesday 29 March 2006 13:47, Mark Volkmann wrote: > I've got a FXOptionMenu that is associated with an FXPopup that has > several FXOptions. > At some point after creating this, I'd like to set the current value > of the option menu. I see that FXOptionMenu has a setCurrent method, > but it's not clear to me what I'm suppose to pass to that. Does anyone > know how to use that method or if that's the normal way to set the > value of an option menu? My recommendation is to call setCurrentNo() which simply takes the index; the other takes a pointer to FXOption which is often not as convenient! - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 19:40 03/30/2006 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060330/12e2f5be/attachment.bin From jeroen at fox-toolkit.org Thu Mar 30 21:03:46 2006 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 30 Mar 2006 20:03:46 -0600 Subject: [fxruby-users] intercepting messages from FXScrollBar toFXScrollArea In-Reply-To: References: <31697.1143618445@www057.gmx.net> Message-ID: <200603302003.46493.jeroen@fox-toolkit.org> On Wednesday 29 March 2006 07:33, Lyle Johnson wrote: > > On Mar 29, 2006, at 1:47 AM, Dirk Schwendemann wrote: > > > I've created a little app that is used on a PC with a touch screen. To > > ease > > hitting the keys, the keys and the scrollbars are really big (45 > > pixels). So > > the ScrollCorner is also really big and I just wanted to use this > > space by > > moving the ScrollDown Botton down to the position of the ScrollCorner > > (like > > the attachment shows) > > Ah, OK! > > > The code looks like this (it seems to work unless that you can't use > > the > > scrollbar afterward): > > > > textField.verticalScrollBar.connect(SEL_CONFIGURE){ > > textField.scrollCorner.destroy() > > width = textField.verticalScrollBar.width > > height = textField.height > > textField.verticalScrollBar.resize(width, height) > > } > > > > The connect method has changed the target of the ScrollBar and so the > > ScrollArea doesn't get any further messages from the ScrollBar. How > > can I > > avoid that connect prevents the ScrollArea from receiving messages? > > Hmmm. You can always just reassign the verticalScrollBar's original > target and message id after you've handled the SEL_CONFIGURE message, > e.g. > > textField.verticalScrollBar.connect(SEL_CONFIGURE) { > ... everything as listed above ... > textField.verticalScrollBar.target = textField > textField.verticalScrollBar.selector = FXWindow::ID_VSCROLLED > } > > but then the *next* time the scroll bar sends a SEL_CONFIGURE message, > you wouldn't get it. Maybe you could write a little class that would > handle the SEL_CONFIGURE message and forward any other messages back to > the FXScrollArea? My advice is to try and overload the layout() routine which places the scrollbars. If this is FXText [I assume that it is], you STILL will want to keep FXText's own layout [which calls FXScrollArea's layout()]. Therefore, if you subclass FXText, your overloaded layout() should first call FXText::layout() and then afterward "fix" the placement of the vertical scrollbar. Its probably going to be a bit tricky but I expect it to work... - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 20:00 03/30/2006 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060330/34e0857b/attachment.bin