ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am writing a bash script that will bring up a "Open file" dialog displaying files with a *.hex ending. Once the file is chosen, the path of the file is sent to a variable, so that the bash script can perform some tasks on that given file.
I am wondering if there is a program, like the curses-based dialog app, that can display a GTK+2.0 file selection dialog. I found this application, but the file selection dialog that it uses doens't look anything like those in the rest of the GNOME desktop. I am not a programmer so I probably could not make a stand-alone program that does this.
Not really an answer but a suggestion - maybe Python can serve your purpose better for GUI purposes since it has many modules like pygtk, pyglade and so on which are easier to use.
Not really an answer but a suggestion - maybe Python can serve your purpose better for GUI purposes since it has many modules like pygtk, pyglade and so on which are easier to use.
gcc fc.c -o fc `pkg-config --cflags --libs gtk+-2.0`
Now you have an executable called fc, run it,
Code:
./fc
It'll pop up a box, choose a file, it'll write the file name chosen to standard out, then return 0 if successful, 1 if they pressed cancel (Check w/ the bash var $?).
So,
file="`./fc`"
Also, this only let's you choose .hex files, but you can remove anything that says filter to get it to let you choose all, or you could just mess w/ it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.