hoffstadt / hoffstadt/DearPyGui

open_file_dialog returns file name without the extension on windows

Open
#88 15 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

**Version of Dear PyGui:**

Version: 0.1.0b7

**OS**

Operating System: Windows 10

**My Issue/Question**

as per the documentation, open_file_dialog callback's data argument will be filled out with the directory path & file path as a list of strings. When I run the example provided in tutorial, and select a file, say "filename1.py", using the file picker, file path that is returned by callback has name but the extension ".py" is missing. i.e, "filename1.*" instead of "filename1.py".

**To Reproduce**

Steps to reproduce the behavior:
1. Run the second example (open_file_dialog example) from section "File, Directory, & Save Dialogs" of tutorial.
2. Click on "File Selector" button
3. Select a file with extension, ex: "somefilename.csv" and click OK
4. File path is missing in the callback data. "D:/path/to/file/somefilename.*" is printed.

**Expected behavior**

file path should have complete file name including the extension.

**Screenshots/Video**

![image](https://user-images.githubusercontent.com/7420631/90713165-62f55700-e2c2-11ea-8afb-a30bf0cc65a7.png)

**Standalone, minimal, complete and verifiable example:**

```python
from dearpygui.dearpygui import *

add_button("File Selector", callback="filePicker")
add_text("Directory Path: ")
add_same_line()
add_label_text("##filedir", "None Selected", data_source="directory")
add_text("File Path: ")
add_same_line()
add_label_text("##file", "None Selected", data_source="file_directory")

def filePicker(sender, data):
open_file_dialog(callback="applySelectedDirectory", extensions=".*,.py")

def applySelectedDirectory(sender, data):
directory = data[0]
file_directory = data[1]
add_data("directory", directory)
add_data("file_directory", file_directory)

start_dearpygui()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.