Re: [glade--] glademm generated filechooserdialog code broken?



Johan Kohler schrieb:
Hi,
I used Glade-2.0 (glademm-2.4) to generate C++ code for a window and a
filechooserdialog and get the following error:

---- relevant build messages (line numbers added for referencing) ----
imageviewer.cc: In function `int main(int, char**)':
imageviewer.cc:23: error: no matching function for call to
`filechooserdialog1
   ::filechooserdialog1()'
filechooserdialog1.hh:16: error: candidates are: filechooserdialog1::filechooserdialog1(const filechooserdialog1&) filechooserdialog1.hh:19: error: filechooserdialog1::filechooserdialog1(GlademmData*)
---- end build messages ---

Relevant source code follows:

---- begin code excerpt ----
  imageviewer.cc:
23	filechooserdialog1 *filechooserdialog1 = new class
filechooserdialog1();

  filechooserdialog1.hh:
15	class filechooserdialog1 : public filechooserdialog1_glade
16 { 17 public: 18 19 filechooserdialog1(GlademmData *gmm_data) :
filechooserdialog1_glade(gmm_data)
20 	        {
21 } ---- end code excerpt ---

Could someone explain the purpose of GlademmData, and how to fix this?

GlademmData contains the accelerator pointer. Since every toplevel window has exactly one Glib::RefPtr<Gtk::AccelGroup> you have to pass it to subwidgets (if they ever might plan to use accelerators).

Normally every widget derived from Gtk::Window does not have a GlademmData * argument to the ctor.

So I think that glademm does not yet know that FileChooserDialog is a descendant of Dialog (and Window) and treats it like a label [defaul]. Simply take src/writers/fileselection.cc as a template to create filechoserdialog.cc (should be about 2-20 min work). Once it works send it to me and I'll put it into the mainline sources. [IIRC filechooserdialog is brand new 2.4 stuff]

If you run into trouble feel free to contact me again
   Christof

Attachment: signature.asc
Description: OpenPGP digital signature



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