コード例 #1
0
ファイル: gears.cs プロジェクト: GNOME/gtkglext-sharp
        public GearsArea(GdkGL.Config glconfig)
        {
            // Enable GL Widget and schedule context creating
            m_gl = new GlWidget (this, glconfig);

            // Events
            ExposeEvent += new ExposeEventHandler (OnExpose);
            ConfigureEvent += new ConfigureEventHandler (OnConfigure);
            Realized += new EventHandler (OnRealize);
            MapEvent += new MapEventHandler (OnMap);
            UnmapEvent += new UnmapEventHandler (OnUnmap);
            VisibilityNotifyEvent += new VisibilityNotifyEventHandler (OnVisible);
            AddEvents ((int)Gdk.EventMask.VisibilityNotifyMask);

            // Timers
            Timeout.Add (s_timerPeriod, new Function (OnTimer));
        }
コード例 #2
0
ファイル: shapes.cs プロジェクト: GNOME/gtkglext-sharp
        public ShapesArea(Config config)
        {
            m_gl = new GlWidget (this, config);

            AddEvents (	(int)(Gdk.EventMask.Button1MotionMask |
                        Gdk.EventMask.Button2MotionMask |
                        Gdk.EventMask.ButtonPressMask |
                        Gdk.EventMask.ButtonReleaseMask |
                        Gdk.EventMask.VisibilityNotifyMask) );
            Realized += new EventHandler (OnRealize);
            ConfigureEvent += new ConfigureEventHandler (OnConfigure);
            ExposeEvent += new ExposeEventHandler (OnExpose);

            ButtonPressEvent += new ButtonPressEventHandler (OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler (OnButtonRelease);
            MotionNotifyEvent += new MotionNotifyEventHandler (OnMotionNotify);

            MapEvent += new MapEventHandler (OnMap);
            UnmapEvent += new UnmapEventHandler (OnUnmap);
            VisibilityNotifyEvent += new VisibilityNotifyEventHandler (OnVisibilityNotify);
            KeyPressEvent += new KeyPressEventHandler (OnKeyPress);

            int i = 0;
            shapeArray = new ShapeProp [9];
            shapeArray[i++] = new ShapeProp ("Cube");
            shapeArray[i++] = new ShapeProp ("Sphere");
            shapeArray[i++] = new ShapeProp ("Cone");
            shapeArray[i++] = new ShapeProp ("Torus");
            shapeArray[i++] = new ShapeProp ("Tetrahedron");
            shapeArray[i++] = new ShapeProp ("Octahedron");
            shapeArray[i++] = new ShapeProp ("Dodecahedron");
            shapeArray[i++] = new ShapeProp ("Icosahedron");
            shapeArray[i  ] = new ShapeProp ("Teapot");
            shape_current = i;
            mat_current = (MaterialProp)materialList[0];

            /*
            * Popup menu.
            */
            CreatePopupMenu ();
            ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressPopupMenu);
        }