Sample Basic File Browser

Hi everyone -

I was searching the forums for a file browser, but did not see one. So I have written one that seems to work fairly well. Anyone interested is welcome to download my example and use it. The code could probably be improved, but it works as it is.

You can get the py file here:

http://www.txt.com/geri/snippets/gui_test.py

I hope some will find this useful.

Geri

In using the browser today, I found a “corner case” where it did not work properly. I have now fixed it and re-uploaded the file.

It is now 5:20 pm US Eastern time on May 19, 2007. If you grabbed a copy of the file before that time, you might want to get the updated file.

Same place:

http://www.txt.com/geri/snippets/gui_test.py

The case I fixed was - if you type a filename in the entry box, then do not press return, but rather click on the Open button, then you will not get your text entry.

So that is fixed, and everything else still works too. :slight_smile:

Sorry for any inconvenience.

Geri

Thanks for sharing! this is very cool, useful…and much appreciated.

Yes it is cool and it is much appreciated. Great work! Any possibility of you getting it working with multiple disk volumes?

I’m glad you brought that up! I’ll have to look at that sometime for my self, because I think it will be important for my project.

This is part of a much larger project for me, with a current deadline to finish some functionality by the end of May. After that, I can fix up some things. I’ll add this to my list of things to check on then.

The change should be somewhere in the function that browses up.

It work as it is, since I tried to remember to make all the paths from root.

You might try putting in a full path into the entry box and see if it properly opens a directory on another disk volume.

As I said, I’ll experiment with it in a couple of weeks, and post an update then.

Thanks!

Geri

i dont know why… but i’m sensing something… hey pro-rsoft and neighborlee… how about using this piece of code for a texture-image selector for a terrain-painter?.. pro-rsofts shader+the texture painting code. see you guys @ #panda3d
@gertiwinters: great work =) very useful. keep it up!

@ThomasEgi, terrific idea :slight_smile: I’m implementing it right as I speak :slight_smile:

@geriwinters: wonderful job, thanks for sharing! But err. would it be hard to have the FileBrowser use Panda3D filename syntax instead of the OS specific?

I had to delay my project, but plan to get back to it next week.

So I will go through these suggestions for improving the file browser. They are really good suggestions, and will make the code much better.

Thanks!

Geri