This code places an Elementary file selector entry widget on a window, along with some other checkboxes.
Those are there just as knobs on the file selector entry's state.
Here's how we instantiate it:
Note that we set on it's button both icon and label decorations. It's set to exhibit the path of (and list the contents of, when internal file selector is launched) the
"/tmp" directory, also, with elm_fileselector_entry_path_set(). What follows are checkboxes to exercise some of its API funtions:
The checkboxes will toggle whether the file selector entry's internal file selector:
Observe how the entry's text will match the string coming from the
"file,chosen" smart event:
event_infostring will contain the last selection on it (if any was made).
Try, also, to type in a valid system path and, then, open the file selector's window: it will start the file browsing there, for you.
This is how the example, just after called, should look like:
Click on the file selector entry 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 entry 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 entry. 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.