Re: GtkFileChooser (I figured it out ! - finally)





  I finally figured it out... if we use any of the responses:

GTK_RESPONSE_ACCEPT
GTK_RESPONSE_OK
GTK_RESPONSE_YES
GTK_RESPONSE_APPLY

   then, the dialog may decide to do something else and not close the dialog:

 From the docs:


 "This is because GtkFileChooserDialog must intercept responses and switch to
folders if appropriate, rather than letting the dialog terminate ? the
implementation uses these known response codes to know which responses can be
blocked if appropriate."

  All I had to do was to come up with my own response ID. 


  The only dark side is this (again, from the docs).

 " To summarize, make sure you use a stock response code when you use
GtkFileChooserDialog to ensure proper operation."

Harring.





--- Harring Figueiredo <harringf yahoo com> wrote:



 John,
 
 Thanks again for the reply. I took a look at the test program as you
suggested. I got my code now to show only folders (it is exactly what I
want).

 There is little problem though.

 Even though I connect the "response" signal to a callback, it seems that the


 dialog_run doesn't return until there are no folders selected, i.e if a
folder
contains subfolders, a click on the "Open" button  "navigates" that folder. 

 I have tried this:

 g_signal_connect (dialog, "response",
                                G_CALLBACK (dir_response_cb), NULL);
 gtk_dialog_run (GTK_DIALOG (dialog));

 The problem is that if a folder has subfolders, the "Open" button 'opens'
the
folders, an calls the callback function, but does not return from the
dialog_run() call.


  I also have tried:

  if ( gtk_dialog_run (GTK_DIALOG (dialog)) == ...RESP..._ACCEPT)
       get-folder-name
  gtk_widget_destroy();

   Again, it only returns when there are no more folders to be 'navigated' or
opened.

   I am sure I am missing something really stupid somewhere --

Harring.
  






--- John Cupitt <jcupitt gmail com> wrote:

I think it does work (unless I misunderstand you, in which case sorry), try

gtk+-2.4.x/tests/testfilechooser

set it to SELECT_FOLDER, pick a folder, click OK.

On Thu, 2 Dec 2004 07:08:39 -0800 (PST), Harring Figueiredo
<harringf yahoo com> wrote:
  Yes.. except that it does not allow me to pick a folder name. i.e, if I
click
on  "Open", it will not close and return the name of the folder, it
actually
naigates the folder contents.. that is not what I want.




              
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page ? Try My Yahoo!
http://my.yahoo.com 
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]