GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

directory chooser

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
aleph1trickpony



Joined: 05 May 2008
Posts: 3

PostPosted: Tue May 06, 2008 8:11 pm    Post subject: directory chooser Reply with quote

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.
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 407
Location: Portland, OR USA

PostPosted: Tue May 06, 2008 8:52 pm    Post subject: Reply with quote

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: (C)
1
2
3
4
5
6
7
8
9

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 ... */
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP