[gtkmm] libglademm 2.4 and Gtk::FileChooser



Hello.
I am using libglademm (2.4) in a program and I have a problem with the
Gtk::FileChooserDialog.

When I click on the open file button of my app I receive the next message:

(uropeEd:7696): libglade-WARNING **: could not find a parent that
handles internal children for `vbox'

The file chooser dialog opens correctly, but I can't see the files in
any directory. Only see the directories in the left side of the
dialog. Then I click on cancel to close the dialog.

To open the FileChooserDialog I have this code:

// Cargar el fichero glade e instanciar sus widgets
  Glib::RefPtr < Gnome::Glade::Xml > refXml;
  try {
    refXml = Gnome::Glade::Xml::create ("../glade/dialog_filechooser.glade");
  }
  catch (const Gnome::Glade::XmlError & ex) {
    cerr << ex.what () << std::endl;
    exit(1);
  }
  // Obtener el diálogo instanciándolo del fichero glade
  CFileChooser *pFileChooser = 0;
  refXml->get_widget_derived ("filechooserdialog1", pFileChooser);
  if (pFileChooser) {
    pFileChooser->seleccionarFichero (*this);
  }
  else {
    cerr << "No se pudo abrir el diálogo de selección de fichero" << endl;
  }
}

The header of CFileChooser is

class CFileChooser:public Gtk::FileChooserDialog {
public:
  CFileChooser (BaseObjectType * cobject,
                const Glib::RefPtr < Gnome::Glade::Xml > &refGlade);
  virtual ~ CFileChooser ();
  // Necesario pasarle la  ventana padre para que la bloquee.
  void seleccionarFichero (Gtk::Window & padre);

and  in my .cpp the definition of CFileChooser starts like this:

CFileChooser::CFileChooser (BaseObjectType * cobject,
                            const Glib::RefPtr < Gnome::Glade::Xml >
                            &refGlade):Gtk::FileChooserDialog (cobject),
m_refGlade (refGlade)
{

¿How can I solve the problem? I only want a FileChooserDialog to
select files XDDDD

Thank you!

Santiago Rodriguez Pozo
--
Santi.



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