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 

about filechooser

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
ramesh
Familiar Face


Joined: 16 Nov 2006
Posts: 40

PostPosted: Wed Jun 20, 2007 10:12 am    Post subject: about filechooser Reply with quote

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
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Wed Jun 20, 2007 1:16 pm    Post subject: Reply with quote

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/gtk/GtkFileChooserDialog.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/gtk/GtkFileChooser.html#gtk-file-chooser-set-current-folder

Hope this helps!
Back to top
ramesh
Familiar Face


Joined: 16 Nov 2006
Posts: 40

PostPosted: Fri Jun 22, 2007 11:33 am    Post subject: Reply with quote

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/gtk/GtkFileChooserDialog.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/gtk/GtkFileChooser.html#gtk-file-chooser-set-current-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
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