コード例 #1
0
        static void CreateUI()
        {
            var mainWindow = new Window(WindowType.Toplevel);

            mainWindow.DeleteEvent += HandleDelete;

            var videoWindow = new DrawingArea();

            videoWindow.DoubleBuffered = false;
            videoWindow.Realized      += HandleRealized;
            videoWindow.DamageEvent   += HandleDamage;

            var playButton = new Button(Stock.MediaPlay);

            playButton.Clicked += HandlePlay;

            var pauseButton = new Button(Stock.MediaPause);

            pauseButton.Clicked += HandlePause;

            var stopButton = new Button(Stock.MediaStop);

            stopButton.Clicked += HandleStop;

            Slider = new HScale(0, 100, 1);
            ((Scale)Slider).DrawValue = false;
            Slider.ValueChanged      += HandleValueChanged;

            StreamsList          = new TextView();
            StreamsList.Editable = false;

            var controls = new HBox(false, 0);

            controls.PackStart(playButton, false, false, 2);
            controls.PackStart(pauseButton, false, false, 2);
            controls.PackStart(stopButton, false, false, 2);
            controls.PackStart(Slider, true, true, 2);

            var mainHBox = new HBox(false, 0);

            mainHBox.PackStart(videoWindow, true, true, 0);
            mainHBox.PackStart(StreamsList, false, false, 2);

            var mainBox = new VBox(false, 0);

            mainBox.PackStart(mainHBox, true, true, 0);
            mainBox.PackStart(controls, false, false, 0);
            mainWindow.Add(mainBox);
            mainWindow.SetDefaultSize(640, 480);

            mainWindow.ShowAll();
        }
コード例 #2
0
        internal void BindValue(XmlNode node)
        {
            XmlAttribute valueAttribute = node.Attribute("Value");

            if (valueAttribute != null)
            {
                if (valueAttribute.IsBinding())
                {
                    Gtk.Range             range     = (Gtk.Range)Widget;
                    Action <EventHandler> subscribe = func => range.ValueChanged += func;
                    BindingContext.BindProperty(
                        subscribe,
                        () => range.Value,
                        value => range.Value = value,
                        "Value",
                        valueAttribute.Value);
                }
                else
                {
                    throw new NotImplementedException("What possible reason could you have for doing this?");
                }
            }
        }
コード例 #3
0
        static void CreateUI()
        {
            var mainWindow = new Window (WindowType.Toplevel);
            mainWindow.DeleteEvent += HandleDelete;

            var videoWindow = new DrawingArea ();
            videoWindow.DoubleBuffered = false;
            videoWindow.Realized += HandleRealized;
            videoWindow.DamageEvent += HandleDamage;

            var playButton = new Button (Stock.MediaPlay);
            playButton.Clicked += HandlePlay;

            var pauseButton = new Button (Stock.MediaPause);
            pauseButton.Clicked += HandlePause;

            var stopButton = new Button (Stock.MediaStop);
            stopButton.Clicked += HandleStop;

            Slider = new HScale (0, 100, 1);
            ((Scale)Slider).DrawValue = false;
            Slider.ValueChanged += HandleValueChanged;

            StreamsList = new TextView ();
            StreamsList.Editable = false;

            var controls = new HBox (false, 0);
            controls.PackStart (playButton, false, false, 2);
            controls.PackStart (pauseButton, false, false, 2);
            controls.PackStart (stopButton, false, false, 2);
            controls.PackStart (Slider, true, true, 2);

            var mainHBox = new HBox (false, 0);
            mainHBox.PackStart (videoWindow, true, true, 0);
            mainHBox.PackStart (StreamsList, false, false, 2);

            var mainBox = new VBox (false, 0);
            mainBox.PackStart (mainHBox, true, true, 0);
            mainBox.PackStart (controls, false, false, 0);
            mainWindow.Add (mainBox);
            mainWindow.SetDefaultSize (640, 480);

            mainWindow.ShowAll ();
        }