This code places an Elementary file selector button widget on a window, along with some other checkboxes and a text entry.
Those are there just as knobs on the file selector button's state and to display information from it.
Here's how we instantiate it:
Note that we set on it both icon and label decorations. It's set to list the contents of the
"/tmp" directory, too, with elm_fileselector_button_path_set(). What follows are checkboxes to exercise some of its API funtions:
The checkboxes will toggle whether the file selector button's internal file selector:
The entry labeled
"Last selection" will exercise the
"file,chosen" smart event coming from the file selector button:
Whenever you dismiss or acknowledges the file selector, after it's raised, the
event_info string will contain the last selection on it (if any was made).
This is how the example, just after called, should look like:
Click on the file selector button to raise its internal file selector, which will be contained on an "inner window":
Toggle the "inwin mode" switch off and, if you click on the file selector button again, you'll get two windows, the original one (note the last selection there!)
and the file selector's new one
Play with the checkboxes to get the behavior changes on the file selector button. The respective API calls on the widget coming from those knobs where shown in the code already.
See the full source code for this example.