widgetInvoke {widgetInvoke}R Documentation

A function to provide a graphical widget to call a function


This function will provide a graphical widget (currently using Gtk) to call a function. The widget is defined previously by the package author and information about this widget is stored in an XML file, which is then read in by widgetInvoke. The user's input is passed on directly to the appropriate function.


widgetInvoke(funName, argOverides=list(), argsOnly=FALSE)


funName The name of the function
argOverides Allows the user to customize the argument display on widgets
argsOnly If this is set to TRUE, the internal argument list is returned instead of evaluated values.


The package that funName is in must already be loaded prior to running widgetInvoke for widgetInvoke to work properly.

Calling this function will display a widget via RGtk to the user that allows them to graphically enter in the values for the function described by funName. Then, upon hitting the Evaluate button, the values stored in the widget are passed directly to the requested function, which is then evaluated normally.

The widget is constructed by information stored in an XML file, which must be generated by running createWF for funName prior to running widgetInvoke.

Some arguments will have default values specified, which can be changed by the user. Also, arguments may have been designated as being required to have a value before evaluation can take place, these arguments will have their name surrounded by * characters (e.g. *colors* or *x*). If the user hits the Evaluate button and any of the required parameters do not have a value, the function will not be evaluated and the user will be warned of the situation.

Note that with text entry boxes, values which the user intends to be treated as a character string must be quoted. Any value which is not quoted will be treated in the same manner as usual for R, in that it will be handled as a numerical value, a variable name, etc.

If a user wishes to enter in a vector of values, the simplest manner would be to declare that vector as a variable before calling widgetInvoke and then using that variable as the value for an argument. However, if the user wants to enter the vector in the actual entry spot, comma separated values are interpreted to be vectors.

The argOverides argument allows the widgetInvoke user to customize their widget for a particular function. The structure of this argument is a list, where for any argument that the user wishes to customize, an element is in the list w/ the same name as the argument. That element itself is a list where elements are any slot of the function's wFun object's argument list (e.g. argDefault). The value of these elements are used to replace the values that come from the XML file. This use of this argument is not recommended for most users, and is primarily intended for the use of other software which is using the widgetInvoke function.


Jeff Gentry

See Also

createWF, wFun-class


  ## Coming soon

[Package widgetInvoke version 0.0.9 Index]