]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/GnomeBase.C
Remove unneeded files, we have switched to use the libglade and there is no
[lyx.git] / src / frontends / gnome / GnomeBase.C
index de37831333c39bbb53520b88628940d04bb0e865..8b68b16bb706c1f36eccf17f46054a80c3cc9db4 100644 (file)
 #include "support/filetools.h"
 #include <glib.h>
 
-GnomeBase::GnomeBase(ControlBase & c, string const & glade_file, string const & name)
-       : ViewBC<gnomeBC>(c), file_(glade_file), widget_name_(name), xml_(0)
+#include <gnome--/dialog.h>
+
+GnomeBase::GnomeBase(ControlButton & c, 
+               string const & glade_file, string const & name)
+       : ViewBC<gnomeBC>(c)
+       , file_(glade_file), widget_name_(name), xml_(0)
+       , dialog_(0)
 {}
        
 GnomeBase::~GnomeBase()
@@ -45,3 +50,31 @@ void GnomeBase::loadXML() const
        
        xml_ = glade_xml_new(file.c_str(), widget_name_.c_str());
 }
+
+
+void GnomeBase::show()
+{
+       if (!dialog_) {
+               dialog_ = dialog();
+               build();
+       }
+
+       update();
+       dialog_->show();
+}
+
+
+void GnomeBase::hide()
+{
+       if (dialog_)
+               dialog_->hide();
+}
+
+
+Gnome::Dialog * GnomeBase::dialog()
+{
+       if (!dialog_) 
+               dialog_ = getWidget<Gnome::Dialog>(widget_name_.c_str());
+               
+       return dialog_;
+}