public GlToggleButton(GdkGL.Config config) { // VBox. VBox vbox = new VBox (false, 0); vbox.BorderWidth = 10; // Drawing area for drawing OpenGL scene. DrawingArea drawing_area = new DrawingArea (); drawing_area.SetSizeRequest (200, 200); // Set OpenGL-capability to the widget. m_gl = new GlWidget (drawing_area, config); drawing_area.Realized += new EventHandler (Realize); drawing_area.ConfigureEvent += new ConfigureEventHandler (Configure); drawing_area.ExposeEvent += new ExposeEventHandler (Expose); drawing_area.Unrealized += new EventHandler (Unrealize); drawing_area.VisibilityNotifyEvent += new VisibilityNotifyEventHandler (VisibilityNotify); vbox.PackStart (drawing_area, true, true, 0); drawing_area.Show (); // Label. Label label = new Label ("Toggle Animation"); vbox.PackStart (label, false, false, 10); label.Show (); Toggled += new EventHandler (ToggleAnimation); // Add VBox. vbox.Show (); Add (vbox); }
public ColorTriangle(GdkGL.Config config) { m_gl = new GtkGL.GlWidget (this, config); Realized += new EventHandler (OnRealize); ConfigureEvent += new ConfigureEventHandler (OnConfigure); ExposeEvent += new ExposeEventHandler (OnExpose); }
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)); }
public WidgetGL() : base() { GdkGL.Config config = new GdkGL.Config(Screen, GdkGL.ConfigMode.Rgb | GdkGL.ConfigMode.Depth | GdkGL.ConfigMode.Double); d_isrealized = false; d_gl = new GlWidget(this, config, null, true, RenderType.RgbaType); Realized += delegate { d_isrealized = true; Reconfigure(); }; }