# Using selectOutput

**URL:** <https://discourse.processing.org/t/using-selectoutput/17534>\
**Category:** Beginners\
**Created:** [February 4, 2020, 1:14am UTC](https://discourse.processing.org/t/using-selectoutput/17534 "2020-02-04T01:14:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spflanze](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@spflanze](https://discourse.processing.org/u/spflanze)\
**Post date:** [February 4, 2020, 1:14am UTC](https://discourse.processing.org/t/using-selectoutput/17534/1 "2020-02-04T01:14:40Z")

</div>

I seek to add a file browser to my application. I see that the selectOutput, and selectInput, classes were made for it. In this document for selectOutput:  
[https://processing.org/reference/selectOutput\_.html](https://processing.org/reference/selectOutput_.html)  
I see constructor overloads that I cannot find documentation on. These are:

```auto
selectOutput(prompt, callback, file)
selectOutput(prompt, callback, file, callbackObject)
selectOutput(prompt, callbackMethod, file, callbackObject, parent)
selectOutput(prompt, callbackMethod, file, callbackObject, parent, sketch)

```

I cannot find any documentation for the file, callbackObject, parent, and sketch, parameters.

My guess is that the “file” parameter is the default directory the file browser starts in. I have no guess for what the callbackObject, parent, and sketch, parameters are there for, and how to use them. Where is complete documentation for the selectInput, and selectOutput, classes that include a description of those four right most optional parameters?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 4, 2020, 1:50am UTC](https://discourse.processing.org/t/using-selectoutput/17534/2 "2020-02-04T01:50:51Z")

</div>

> [@spflanze](#):
>
> I have no guess for what the _callbackObject_, _parent_, and _sketch_, parameters are there for, and how to use them.

If we invoke the overloaded version w/ just 2 parameters, we’ll get a `null` File _file_ and a `this` Object _callbackObject_ when it reaches the overloaded version w/ 4 parameters:

> <https://github.com/processing/processing/blob/processing-0270-3.5.4/core/src/processing/core/PApplet.java#L6544-L6557>

Then the overloaded version w/ 4 parameters invokes the 1 w/ 6 parameters, passing `null` for Frame _parent_ and `this` for PApplet _sketch_:

> <https://github.com/processing/processing/blob/processing-0270-3.5.4/core/src/processing/core/PApplet.java#L6566-L6570>

Given **selectOutput()** is a method from class PApplet, the keyword `this` holds a reference for the current instance of it; which is our sketch.

It means by default the parameter String _callback_ represents the name of some `public void (File)` method inside our sketch.

If we instead need for it to callback a method name belonging to some other class, we can use any overloaded version w/ 4 or more parameters, passing the instance of the target class as the argument for the parameter Object _callbackObject_.
