Re: directory selection dialog



Hello.

Thanks to everyone who helped.

I found a solution that may be interesting for others who
also need a directory selection widget:

In gtk+-2.0 it is simple:
- add "/." to the wanted default path when setting it with
  gtk_file_selection_set_filename
- hide the selecten_entry widget:
gtk_widget_hide(GTK_FILE_SELECTION(fileselection)->selection_entry);

For gtk-1.2 it additionaly is necessary to remove the text in selection_entry:
  strncpy(filename, gtk_file_selection_get_filename(GTK_FILE_SELECTION(fileselection)),
max_len - 1);
  *(filename+strlen(filename)-strlen(
    gtk_entry_get_text(GTK_ENTRY(GTK_FILE_SELECTION(fileselection)->selection_entry)))) =
'\0';

Then the fileselection dialog behaves like expected.

May be someone can need it.

Bye
Oliver

Oliver Rauch schrieb:

Hello.

I am looking for a directory selection dialog,
comparable to gtk_fileselction.

Although it is possible to use gtk_fileselection_*
to select directories (I hide the file selection box)
the behaviour is not very intuitive.

When you click a "directory" once then you get the following:

Selection: /first/part/of/the/path
  "directory"

and the returned path is:

/first/part/of/the/path/"directory"

This often confuses the users because it would make more
sense that the returned path is the path listed in
the "Selection" part. The lower text box does not
make sense for selecting directories.

Is there a way to change the behaviour of gtk_fileselection
for selecting directories or is there an other widget/window
to do this?

Thanks
Oliver
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

-- 
Homepage:       http://www.rauch-domain.de
sane-umax:      http://www.rauch-domain.de/sane-umax
xsane:          http://www.xsane.org
E-Mail:         mailto:Oliver Rauch rauch-domain de



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