DFileBrowser

Hi, so I’m making some fun stuff in lua, but I can’t figure out this filebrowser.
It doesn’t seems to be able to find ANY files at all?
I’ve used the example on the wiki, it works ok, and the menu is created, but there is no files listed…
This is the example given:


local FileBrowser = vgui.Create( "DFileBrowser" )
FileBrowser:SetName( "Data folder" )
FileBrowser:SetPath( "data/" )
FileBrowser:SetFiles( "*.txt" )

I tried it as that, didn’t work, but I’ve also tried with this:


						M1:AddOption("Test", function() 
								FileBrowser = vgui.Create( "DFileBrowser", Notebook )
								FileBrowser:SetName( "Data folder" )
								FileBrowser:SetPath( "data/" )
								FileBrowser:SetFiles( "*.txt" )
								FileBrowser:SetPos(100,100)
								FileBrowser:SetSize(150,150)
								FileBrowser:Center()
			end):SetIcon("icon16/page_edit.png")


I think it should be FileBrowser:SetPath( “data/*” )

I’m not sure though.

I’ll try it when I get to my computer tomorrow, thanks.
However, it still seems pretty weird, when the wiki is telling something else :quagmire:

Ok, so I tried it, and unfortunately, it didn’t work.
I’m not sure whenever I’m doing something wrong, or it just doesn’t work?

However, is there any other way to list files from /data/folder?
Some sort of menu e.g.

There’s DTree. I use it myself for a file browser menu.

The element is broken, I am trying to fix it right now.

Thanks.
However, I sorted it by using a for in pairs loop, and outputted it on a DListView.
I’ll mark this as solved, as I got a workaround, however I’ll still check up on DFileBrowser to see how it went with your fix.:smile: