GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Nov 27, 2014 9:52 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: about filechooser
PostPosted: Wed Jun 20, 2007 10:12 am 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
hi all
how to open a file using file chooser..
in this file chooser i have to give path(ex: it will alway select a file from /root/Desktop)

please help me

thank you in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 20, 2007 1:16 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
I'm assuming that you want to select the file from a dialog, so you should use GtkFileChooserDialog. There is a simple example of how to do what you want in its API:
http://developer.gnome.org/doc/API/2.0/ ... ialog.html

Also, to set the default location, you would use gtk_file_chooser_set_current_folder() before running the dialog. Here's the reference for that function:
http://developer.gnome.org/doc/API/2.0/ ... ent-folder

Hope this helps!

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 22, 2007 11:33 am 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
openldev wrote:
I'm assuming that you want to select the file from a dialog, so you should use GtkFileChooserDialog. There is a simple example of how to do what you want in its API:
http://developer.gnome.org/doc/API/2.0/ ... ialog.html

Also, to set the default location, you would use gtk_file_chooser_set_current_folder() before running the dialog. Here's the reference for that function:
http://developer.gnome.org/doc/API/2.0/ ... ent-folder

Hope this helps!

hi
i am using this filechooser to send and receive a file. from one machine to another machine.
using "cp" command.. to receive a file through socket..

my problem is about file chooser...
if i send local files(means actual path of gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filechooserwidget), "/root");)
from root to other machine it is successfully receiving at the other end.
but when i send non-local file (other than /root)
there is an error showing in the terminal.. at the receiving side
"cp: cannot stat `xxxxx-1.1.1.tar.gz': No such file or directory"

what is the problem with the filechooser..

can you help me

thank you in advance


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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