Code

* don't strech buttons on lpe dialog when resizing the dialog
[inkscape.git] / src / ui / dialog / scriptdialog.cpp
index 07f26b71f92618bb625f6dc3a1f7253b4e65f1b8..a56e74df33a1905aa3a2d055d9d124f506887dd3 100644 (file)
@@ -192,9 +192,10 @@ void ScriptDialogImpl::executePerl()
 /**
  * Constructor
  */
-ScriptDialogImpl::ScriptDialogImpl()
+ScriptDialogImpl::ScriptDialogImpl() :
+    ScriptDialog()
 {
-    Gtk::VBox *mainVBox = get_vbox();
+    Gtk::Box *contents = _getContents();
 
     //## Add a menu for clear()
     menuBar.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_File"), fileMenu) );
@@ -208,7 +209,7 @@ ScriptDialogImpl::ScriptDialogImpl()
     fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Execute Perl"),
            sigc::mem_fun(*this, &ScriptDialogImpl::executePerl) ) );
 #endif
-    mainVBox->pack_start(menuBar, Gtk::PACK_SHRINK);
+    contents->pack_start(menuBar, Gtk::PACK_SHRINK);
 
     //### Set up the script field
     scriptText.set_editable(true);
@@ -218,7 +219,7 @@ ScriptDialogImpl::ScriptDialogImpl()
     scriptTextFrame.set_label(_("Script"));
     scriptTextFrame.set_shadow_type(Gtk::SHADOW_NONE);
     scriptTextFrame.add(scriptTextScroll);
-    mainVBox->pack_start(scriptTextFrame);
+    contents->pack_start(scriptTextFrame);
 
     //### Set up the output field
     outputText.set_editable(true);
@@ -228,7 +229,7 @@ ScriptDialogImpl::ScriptDialogImpl()
     outputTextFrame.set_label(_("Output"));
     outputTextFrame.set_shadow_type(Gtk::SHADOW_NONE);
     outputTextFrame.add(outputTextScroll);
-    mainVBox->pack_start(outputTextFrame);
+    contents->pack_start(outputTextFrame);
 
     //### Set up the error field
     errorText.set_editable(true);
@@ -238,7 +239,7 @@ ScriptDialogImpl::ScriptDialogImpl()
     errorTextFrame.set_label(_("Errors"));
     errorTextFrame.set_shadow_type(Gtk::SHADOW_NONE);
     errorTextFrame.add(errorTextScroll);
-    mainVBox->pack_start(errorTextFrame);
+    contents->pack_start(errorTextFrame);
 
     // sick of this thing shrinking too much
     set_size_request(350, 400);
@@ -249,10 +250,10 @@ ScriptDialogImpl::ScriptDialogImpl()
 /**
  * Factory method.  Use this to create a new ScriptDialog
  */
-ScriptDialog *ScriptDialog::create()
+ScriptDialog &ScriptDialog::getInstance()
 {
     ScriptDialog *dialog = new ScriptDialogImpl();
-    return dialog;
+    return *dialog;
 }