Index: src/gigedit/mainwindow.cpp =================================================================== RCS file: /var/cvs/linuxsampler/gigedit/src/gigedit/mainwindow.cpp,v retrieving revision 1.44 diff -U3 -r1.44 mainwindow.cpp --- src/gigedit/mainwindow.cpp 6 Feb 2008 22:08:29 -0000 1.44 +++ src/gigedit/mainwindow.cpp 7 Feb 2008 14:30:17 -0000 @@ -59,6 +59,24 @@ return ss.str(); } +class FooLabel : public Gtk::Label { +public: + FooLabel(const Glib::ustring& label) : Gtk::Label(label), b(false) { + } + + void onFooResize(Gtk::Requisition* requisition) { + if (!b) { + b = true; + set_size_request(get_width(), -1); + b = false; + } + } + +private: + bool b; +}; + + Table::Table(int x, int y) : Gtk::Table(x, y), rowno(0) { } void Table::add(BoolEntry& boolentry) @@ -1503,7 +1521,8 @@ if (!file) return; Gtk::FileChooserDialog dialog(*this, _("Select Folder"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); - Gtk::Label description( + //Gtk::Label description( + FooLabel description( _("This is a very specific function. It tries to replace all samples " "in the current gig file by samples located in the directory chosen " "by you above.\n\n" @@ -1537,13 +1556,18 @@ dialog.set_select_multiple(false); // fix label width (because Gtk by design doesn't // know anything about the parent's size) -#if 0 //FIXME: doesn't work +#if 0 int dialogW, dialogH, labelW, labelH; dialog.get_size_request(dialogW, dialogH); description.get_size_request(labelW, labelH); std::cout << "dialog(" << dialogW << "," << dialogH << ")\nlabel(" << labelW << "," << labelH << ")\n" << std::flush; - description.set_size_request(dialogW, labelH); + std::cout << dialog.get_width() << " " << description.get_width() << " " << entryArea.get_width() << "\n" << std::flush; + description.set_size_request(dialog.get_width(), labelH); #endif + dialog.signal_size_request().connect( + sigc::mem_fun(description, &FooLabel::onFooResize) + ); + if (dialog.run() == Gtk::RESPONSE_OK) { Glib::ustring error_files;