# How to call an interactive Dialog to choose a directory with xpce

**URL:** https://swi-prolog.discourse.group/t/how-to-call-an-interactive-dialog-to-choose-a-directory-with-xpce/6443
**Category:** Help!
**Tags:** how-to, xpce
**Created:** [April 6, 2023, 10:23am UTC](https://swi-prolog.discourse.group/t/how-to-call-an-interactive-dialog-to-choose-a-directory-with-xpce/6443 "2023-04-06T10:23:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nijan104](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@nijan104](https://swi-prolog.discourse.group/u/nijan104)
#### Post date: [April 6, 2023, 10:23am UTC](https://swi-prolog.discourse.group/t/how-to-call-an-interactive-dialog-to-choose-a-directory-with-xpce/6443/1 "2023-04-06T10:23:03Z")

</div>

Hello everyone,

I am very new to prolog and xpce and trying to build my first GUI with it.  
Since I want the user to be able to choose a directory to store files in, I was wondering if there is already an existing dialog to do that.

So far I found out how to choose a file and get its path using the following code:

```prolog
call(get(@display,
           win_file_name,  
           open,  
           Filter,
           Title_atom,
           owner:=Owner,   
           File)),

```

Now I want to be able to choose a directory instead of a file and get its path.  
I hope someone can help me and I’m excited to become a part of this community.  
Happy Easter everyone 🙂

Niclas

PS. I’m using: SWI-Prolog version 5.6.48

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)
#### Post date: [April 6, 2023, 10:33am UTC](https://swi-prolog.discourse.group/t/how-to-call-an-interactive-dialog-to-choose-a-directory-with-xpce/6443/2 "2023-04-06T10:33:41Z")

</div>

> [@nijan104](#):
>
> I’m using: [SWI-Prolog](https://www.swi-prolog.org/pldoc/doc_for?object=manual) version 5.6.48

You should consider upgrading to the lastest version which can be seen here are Repology

> **[swi-prolog package versions - Repology](https://repology.org/project/swi-prolog/versions)**
>
> List of package versions for project swi-prolog in all repositories

* * *

If you are starting a project from scratch or at the very early stages then consider instead using a web interface. A good example is [SWISH](https://swish.swi-prolog.org/).

The SWISH code is availabe on GitHub.

> **[GitHub - SWI-Prolog/swish: SWI-Prolog for SHaring: a SWI-Prolog web IDE](https://github.com/SWI-Prolog/swish)**
>
> SWI-Prolog for SHaring: a SWI-Prolog web IDE. Contribute to SWI-Prolog/swish development by creating an account on GitHub.
