From: Tim R. <ti...@us...> - 2004-07-30 11:17:17
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18733 Modified Files: gtkFrame.cs Log Message: isnserted scales for x and y rotation but kernell still kills programm when adding OpenGL Index: gtkFrame.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkFrame.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtkFrame.cs 30 Jul 2004 10:31:05 -0000 1.3 --- gtkFrame.cs 30 Jul 2004 11:17:02 -0000 1.4 *************** *** 17,20 **** --- 17,23 ---- protected Gtk.Window window; protected VScale scaleRotX; + protected HScale scaleRotY; + protected int oldHeight = 0; + protected int oldWidth = 0; public GtkFrame() { *************** *** 45,53 **** glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! //fixedLayout.Put( glarea, 100, 50 ); ! fixedLayout.Put( new Button ("HALLO"), 100, 100 ); ! fixedLayout.ShowAll(); Debug.WriteLine( "MainLoop" ); Application.Run (); --- 48,68 ---- glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! //fixedLayout.Put( glarea, 55, 55 ); ! Debug.WriteLine( "Init scaleRotX" ); ! scaleRotX = new VScale( 0.0, 359.9, 0.1 ); ! scaleRotX.ValuePos = PositionType.Bottom; ! scaleRotX.ValueChanged += new EventHandler( valueChanged ); ! fixedLayout.Put( scaleRotX, 10, 10 ); + Debug.WriteLine( "Init scaleRotY" ); + scaleRotY = new HScale( 0.0, 359.9, 0.1 ); + scaleRotY.ValuePos = PositionType.Left; + scaleRotY.ValueChanged += new EventHandler( valueChanged ); + fixedLayout.Put( scaleRotY, 10, 100 ); + + oldWidth = 1; + fixedLayout.ShowAll(); + Debug.WriteLine( "MainLoop" ); Application.Run (); *************** *** 57,62 **** } protected void OnResize( object obj, SizeAllocatedArgs args ) { ! resize( glarea, args.Allocation.Height - 150, args.Allocation.Width - 150 ); } --- 72,93 ---- } + protected void valueChanged( object obj, EventArgs e ) { + if (obj==scaleRotX) rotX = (float)scaleRotX.Value; + if (obj==scaleRotY) rotY = (float)scaleRotY.Value; + } + protected void OnResize( object obj, SizeAllocatedArgs args ) { ! if ( (oldWidth!=args.Allocation.Width) || (oldHeight!=args.Allocation.Height) ) { ! oldWidth = args.Allocation.Width; ! oldHeight = args.Allocation.Height; ! OnResize( oldWidth, oldHeight ); ! } ! } ! ! protected void OnResize( int width, int height ) { ! resize( glarea, height - 65, width - 65 ); ! resize( scaleRotX, height - 45, 35 ); ! resize( scaleRotY, 35, width - 20 ); ! move( scaleRotY, 10, height - 45 ); } *************** *** 68,71 **** --- 99,108 ---- } + protected void move( Widget wdg, int x, int y ) { + if ( (fixedLayout!=null) && (wdg!=null) ) { + fixedLayout.Move( scaleRotY, x, y ); + } + } + protected void OnDeleteEvent (object obj, DeleteEventArgs args) { Application.Quit (); |