GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Oct 22, 2014 11:59 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: directory chooser
PostPosted: Tue May 06, 2008 8:11 pm 
Offline

Joined: Mon May 05, 2008 4:21 pm
Posts: 3
I'm wondering if there's a way to create something like a file chooser that would, instead of returning the path to a file, allow the user to select a certain directory.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 06, 2008 8:52 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
You set the action of the GtkFileChooser using gtk_file_chooser_set_action (). In your case, you want to use the GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER enum. So it would look something like this...

Code:
GtkWidget *chooser;

/* ... some code to setup the chooser here ... */

gtk_file_chooser_set_action (GTK_FILE_CHOOSER (chooser),
                             GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);

/* ... some code to pack or otherwise show the chooser ... */

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group