![](https://secure.gravatar.com/avatar/214fe9a0ecb4aed8994e8618ade6f5a8.jpg?s=120&d=mm&r=g)
Osei Poku wrote:
So, can you change the patch so it produces the fialog fully open?
According to this link, that behaviour is not yet possible. Sorry :)
http://mail.gnome.org/archives/gtk-list/2005-August/msg00199.html
Hi, all,
Actually, if you look at the SaveAs dialog, you can see that the file browser is already expanded. As a workaround for the problem, we wrote this little bit of code at line 1193 in src/dialog/filedialog.cpp, which recursively descends into the private widget tree of the dialog to find the expander widgets:
void findExpanderWidgets(Gtk::Container *parent, std::vector<Gtk::Expander *> &result) { if (!parent) return; std::vector<Gtk::Widget *> children = parent->get_children(); for (unsigned int i=0; i<children.size() ; i++) { Gtk::Widget *child = children[i]; GtkWidget *wid = child->gobj(); if (GTK_IS_EXPANDER(wid)) result.push_back((Gtk::Expander *)child); else if (GTK_IS_CONTAINER(wid)) findExpanderWidgets((Gtk::Container *)child, result); }
}
Then this code in the constructor at line 1288 calls it. You notice that we're only looking for the first one, anyway. It then easily pops the silly thing open and everyone is happy. :-)
//Let's do more customization std::vector<Gtk::Expander *> expanders; findExpanderWidgets(cont, expanders); //g_message("Found %d expander widgets\n", expanders.size()); if (expanders.size() >=1 ) { //Always show the file list Gtk::Expander *expander = expanders[0]; expander->set_expanded(true); }
Obviously, the guys who wrote the new Gtk dialog want to change the way people use file dialogs. Little hacks like this can ease the transition for luddites like me. ^^
Hope this helps.
bob