dialog box actually goes away! (at the cost of re-initializing Gtk2 in every child...
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 4 Oct 2010 03:36:31 +0000 (23:36 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 4 Oct 2010 03:36:31 +0000 (23:36 -0400)
Crypt/Monkeysphere/MSVA/MarginalUI.pm

index b89ad0c5b8562414f279914d150084b4f7481158..af7dbc99c19037c22a886c2a249ab455edfc0e0c 100755 (executable)
 
   use strict;
   use warnings;
-  use Gtk2 '-init';
+  use Gtk2;
 
   sub prompt {
     my $labeltxt = shift;
 
+    Gtk2->init();
     # create a new dialog with some buttons - one stock, one not.
-    my $dialog = Gtk2::Dialog->new ('msva-perl prompt!', undef, qw( modal ),
+    my $dialog = Gtk2::Dialog->new ('msva-perl prompt!', undef, [],
                                     'gtk-cancel' => 'cancel',
                                     'Lemme at it!' => 'ok');
     my $label = Gtk2::Label->new($labeltxt);
 
     $dialog->set_default_response ('cancel');
 
-    # show and interact modally -- blocks until the user
-    # activates a response.
     my $response = $dialog->run();
     if ($response eq 'ok') {
       $resp = 1;
     }
 
-    $dialog->hide();
-    # activating a response does not destroy the window,
-    # that's up to you.
-    $dialog->destroy();
+    # we'll let the fact that the process is about to terminate
+    # destroy the window.  so lazy!
 
     return $resp;
   }