Overrode ToString in WindowInfo implementations.

Debugging NRE in X11Keyboard constructor.
This commit is contained in:
the_fiddler 2007-08-05 16:44:31 +00:00
parent b526c077d5
commit a987a5daf6
3 changed files with 15 additions and 1 deletions

View file

@ -28,5 +28,12 @@ namespace OpenTK.Platform.Windows
} }
#endregion #endregion
public override string ToString()
{
return String.Format("Windows.WindowInfo: Handle {0}{1} Parent {2}",
this.Handle, System.Environment.NewLine, this.Parent.ToString());
}
} }
} }

View file

@ -31,5 +31,11 @@ namespace OpenTK.Platform.X11
public IntPtr Handle { get { return handle; } internal set { handle = value; } } public IntPtr Handle { get { return handle; } internal set { handle = value; } }
public IWindowInfo Parent { get { return parent; } internal set { parent = value as WindowInfo; } } public IWindowInfo Parent { get { return parent; } internal set { parent = value as WindowInfo; } }
public override string ToString()
{
return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}{3} Parent {4}",
this.Display, this.Screen, this.Handle, System.Environment.NewLine, this.Parent.ToString());
}
} }
} }

View file

@ -100,6 +100,7 @@ namespace OpenTK.Platform.X11
internal X11Keyboard(WindowInfo window) internal X11Keyboard(WindowInfo window)
{ {
/*
this.window = window; this.window = window;
Initialize(); Initialize();
@ -112,7 +113,7 @@ namespace OpenTK.Platform.X11
//keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[])); //keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[]));
API.Free(keysym_ptr); API.Free(keysym_ptr);
*/
Keyboard kb = new Keyboard(); Keyboard kb = new Keyboard();
kb.Description = "Default X11 keyboard"; kb.Description = "Default X11 keyboard";
kb.NumberOfKeys = lastKeyCode - firstKeyCode + 1; kb.NumberOfKeys = lastKeyCode - firstKeyCode + 1;