help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function handle with arguments for GUI callback


From: Michael Goffioul
Subject: Re: Function handle with arguments for GUI callback
Date: Mon, 11 Mar 2013 13:34:24 -0400

On Mon, Mar 11, 2013 at 12:43 PM, Arnaud Miege <address@hidden> wrote:
On 11 March 2013 16:32, Jordi Gutiérrez Hermoso <address@hidden> wrote:


You might be interested in knowing that the current development branch
of Octave has changed nested functions:

    http://hg.savannah.gnu.org/hgweb/octave/rev/fa3989fbb1b5#l1.57

- Jordi G. H.

Thanks. Even though I mentioned nested functions, I am not currently using any. My code is structured as follows:

- Main GUI function
  - Sub-function to create the UI controls
  - Sub-function for first callback
  - Sub-function for second callback
  - etc...
end

I just need to find a mechanism to pass (and modify) data to/from the callback functions to the main GUI function where the information is stored (in a struct).

It's good to know about nested functions though, I'll give them a try when I upgrade to the next stable release of Octave (hopefully there will have some improvement to the Octave GUI by then, fingers crossed). Right now, I need a solution for 3.6.2. I have tried defining the callback as a cell array, i.e. address@hidden,gui,k} or even address@hidden,"gui","k"}, but that didn't work either.

Using a cell array is the right approach. It is supported. What error do you get and what code are you using? Also please note that a GUI callback always get the object handle and an event data as first 2 arguments. Whatever arguments you specify in the cell array starts at position 3 in the callback argument list.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]