Using Eto OpenFileDialog

Hi Dale

I have tried using Eto.Forms.OpenFileDialog like your code above but in Python instead, Unfortunately, when the file dialog pops up by using Forms.FilePicker that doesn’t have any filter option. How can I solve it, Thanks!
This is my code :
self.fd = forms.OpenFileDialog
filter = forms.FileFilter(“CSV file”,".csv")
self.filepath = forms.FilePicker()

I’ve moved this to a new topic.

Hi @Dat_Nguyen,

How about this?

import rhinoscriptsyntax as rs
filename = rs.OpenFileName("Open", "CSV Files (*.csv)|*.csv||")
if filename: 

– Dale

Hi @dale,

Thanks for your response. I want to put the “input file” box into the Eto layout like this image
and then hit the browse button and see the filter option at the right hand, is it possible? or I have to use rs.OpenFileName to open the file separately from the Eto layout?

Hey @Dat_Nguyen,

If you did something like this:

self.PathTextBox = Eto.Forms.TextBox()

Then you can do this:

 def BrowseButtonClick(self, sender, e):
    filename = rs.OpenFileName("Open", "CSV Files (*.csv)|*.csv||")
    if filename: 
        self.PathTextBox.Text = filename

– Dale


Thanks @dale , I’ll try it!