[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnetlib/samples XClockEmbed.cs,1.1,1.2
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnetlib/samples XClockEmbed.cs,1.1,1.2 |
Date: |
Sat, 01 Nov 2003 03:30:25 +0000 |
Update of /cvsroot/dotgnu-pnet/pnetlib/samples
In directory subversions:/tmp/cvs-serv22676/samples
Modified Files:
XClockEmbed.cs
Log Message:
Make the shutdown process on embedded applications more predictable,
to avoid X server crashes.
Index: XClockEmbed.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/XClockEmbed.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** XClockEmbed.cs 31 Oct 2003 06:52:56 -0000 1.1
--- XClockEmbed.cs 1 Nov 2003 03:30:23 -0000 1.2
***************
*** 36,40 ****
// Internal state.
private EmbeddedApplication embed;
- private bool allowClose;
// Constructor.
--- 36,39 ----
***************
*** 42,46 ****
: base(title, width, height)
{
! embed = new Embedder(this, 0, 0, width, height);
embed.Program = "xclock";
embed.Launch();
--- 41,45 ----
: base(title, width, height)
{
! embed = new EmbeddedApplication(this, 0, 0, width, height);
embed.Program = "xclock";
embed.Launch();
***************
*** 52,86 ****
embed.Resize(width, height);
}
-
- // Handle close events on the main application window.
- // We pass the close down to the embedded application.
- protected override bool OnClose()
- {
- if(allowClose)
- {
- return true;
- }
- else
- {
- embed.Close();
- return false;
- }
- }
-
- // Embed window, overriding the "OnClose()" notification.
- private class Embedder : EmbeddedApplication
- {
- // Constructor.
- public Embedder(Widget parent, int x, int y, int width, int
height)
- : base(parent, x, y, width, height) {}
-
- // Receive notification of application closure.
- protected override void OnClose()
- {
- ((XClockEmbed)Parent).allowClose = true;
- ((XClockEmbed)Parent).Close();
- }
-
- }; // class Embedder
}; // class XClockEmbed
--- 51,54 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnetlib/samples XClockEmbed.cs,1.1,1.2,
Rhys Weatherley <address@hidden> <=