aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2004-01-13 13:09:31 +0000
committerFernando Nasser <fnasser@gcc.gnu.org>2004-01-13 13:09:31 +0000
commite5baf3bd82e549059b55fe169e637efbecbf8eca (patch)
treec4db13fdec0f1fbcabc413740320b1e335769768
parent9bc43c535ec8533339eccf3b17f0126874cd5a9d (diff)
downloadgcc-e5baf3bd82e549059b55fe169e637efbecbf8eca.zip
gcc-e5baf3bd82e549059b55fe169e637efbecbf8eca.tar.gz
gcc-e5baf3bd82e549059b55fe169e637efbecbf8eca.tar.bz2
TestAWT.java: Fix test program so that it does not show modal dialogs twice and so that it...
* gnu/java/awt/peer/gtk/TestAWT.java: Fix test program so that it does not show modal dialogs twice and so that it allows showing a modal dialog from another modal dialog. From-SVN: r75803
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/TestAWT.java39
2 files changed, 41 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 6252810..eb423b3 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
2004-01-12 Fernando Nasser <fnasser@redhat.com>
+ * gnu/java/awt/peer/gtk/TestAWT.java: Fix test program so that it does
+ not show modal dialogs twice and so that it allows showing a modal
+ dialog from another modal dialog.
+
+2004-01-12 Fernando Nasser <fnasser@redhat.com>
+
* java/awt/Dialog.java (show): Enable blocking for all modal dialogs
and run secondary dispatch thread to process event queue while this
thread is blocked.
diff --git a/libjava/gnu/java/awt/peer/gtk/TestAWT.java b/libjava/gnu/java/awt/peer/gtk/TestAWT.java
index 48cdce1..36e4416 100644
--- a/libjava/gnu/java/awt/peer/gtk/TestAWT.java
+++ b/libjava/gnu/java/awt/peer/gtk/TestAWT.java
@@ -184,8 +184,16 @@ class MainWindow extends PrettyFrame implements ActionListener
w.dispose ();
else
{
- w.setVisible (true);
- w.show();
+ if (w instanceof Dialog)
+ {
+ System.out.println ("Will 'show'");
+ w.show();
+ System.out.println ("Has shown");
+ }
+ else
+ {
+ w.setVisible (true);
+ }
}
}
}
@@ -250,11 +258,14 @@ class ButtonsWindow extends SubFrame implements ActionListener
class DialogWindow extends Dialog implements SubWindow
{
Label text;
+ Frame parent;
boolean initted = false;
public DialogWindow (Frame f)
{
super (f, true);
+
+ this.parent = f;
}
public void setVisible (boolean visible)
@@ -264,6 +275,13 @@ class DialogWindow extends Dialog implements SubWindow
super.setVisible (visible);
}
+ public void show ()
+ {
+ if (!initted)
+ init();
+ super.show ();
+ }
+
public void init ()
{
text = new Label ("Dialog Test");
@@ -282,7 +300,7 @@ class DialogWindow extends Dialog implements SubWindow
}
});
- p.setLayout (new GridLayout (1, 2));
+ p.setLayout (new GridLayout (1, 3));
((GridLayout) p.getLayout ()).setHgap (5);
((GridLayout) p.getLayout ()).setVgap (5);
p.add (cb);
@@ -300,10 +318,23 @@ class DialogWindow extends Dialog implements SubWindow
doLayout();
}
});
+
+ Button subdlg = new Button ("SubDialog");
+ p.add (subdlg);
+
+ subdlg.addActionListener(new ActionListener () {
+ public void actionPerformed (ActionEvent e)
+ {
+ DialogWindow sw = new DialogWindow (parent);
+ System.out.println ("Will show modal sub dialog");
+ sw.show ();
+ System.out.println ("Has shown modal sub dialog");
+ }
+ });
add (p, "South");
setTitle ("Dialog");
- setSize (130, 70);
+ setSize (240, 120);
}
}