[fxruby-users] Method calls with menus

Stuart Clarke stuart_clarke86 at yahoo.com
Tue Nov 25 16:31:54 EST 2008

Ah yes, I should have included that, see below:

  def minecompleteEVT(sender, sel, ptr)
    @evtrievefindings.push "Hello"
    if @evtrievefindings.length != 0
      @mineresults.text = @evtrievefindngs.join("\n")

Basically clicking the run button will run the following method, please note the above is just an example and not the contents of the actual method.

Many thanks

--- On Tue, 25/11/08, Lyle Johnson <lyle at lylejohnson.name> wrote:
From: Lyle Johnson <lyle at lylejohnson.name>
Subject: Re: [fxruby-users] Method calls with menus
To: fxruby-users at rubyforge.org
Date: Tuesday, 25 November, 2008, 9:31 PM

On Nov 25, 2008, at 2:55 PM, Stuart Clarke wrote:
I have a second GUI button which I am having trouble with. This button will only work once the first button has been selected and the data processed. This second button or RUN button is meant to pass to another method in my code which will then run searches on the already processed data. To do this I have the following code:

mineEVT = FXMenuCommand.new(minerMenu, "Run...").connect(SEL_COMMAND, method(:minecompleteEVT))

My method is minecompleteEVT(). However upon running this code i get the following error:

.rb:55:in `minecompleteEVT': wrong number of arguments (3 for 0) (ArgumentError)
What does your minecompleteEVT() method look like? It should take three arguments:
	def minecompleteEVT(sender, sel, data)

When you click the button and FXRuby calls this method, it will pass in (1) a reference to the object (e.g. the FXButton) that's sending the message, (2) the message type and (3) any associated message data.
Hope this helps,
fxruby-users mailing list
fxruby-users at rubyforge.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081125/95f78583/attachment.html>

More information about the fxruby-users mailing list