On Wed, 29 May 2013, Allin Cottrell wrote:
Another thing that needs to be documented (and I plan to
document it in my paper for GC 2013). If you specify a
"gui-main" function, and this function returns a bundle,
then the handling of the returned bundle is done by gretl.
The user is not given the option of assigning the returned
bundle in advance, because it's assumed that the bundle will
be displayed in a GUI window, from where it can be saved (if
the user wants) in the same sort of way that a gretl model
can be saved.
If [a] returned bundle is not showing up in a window that
could be a bug in gretl, or possibly in [the associated]
package (though in the latter case you should get an error
message, and it would be a gretl bug if you don't). I'll try
constructing a minimal test of this functionality and report
back.
I've now put a trivial but complete example at
http://users.wfu.edu/cottrell/pkg/
Note that the main function, olsbundle(), calls the
bundle-print function to display its results. This is one way
of doing things. An alternative would be to include in
olsbundle() the special comment
## no-print ##
(see section 6 in
http://gretl.sourceforge.net/papers/addons.pdf ) This signals
to gretl that the function does not print its own results, in
which case gretl will take care of calling the package's
bundle-print function. (We don't want both of these things to
happen.)
Note that if olsbundle() did not print the bundle, and did not
include the special "no-print" comment, then the returned
bundle's window would come up empty (though it would have a
menu enabling saving of the bundle and/or selected contents).
Allin