Пример #1
0
        private static void Activate(IntPtr app, IntPtr data)
        {
            var window = new Window(app);

            window.Title = "Window";
            window.SetDefaultSize(200, 200);
            window.SetBorderWidth(10);

            var grid = new Grid();

            window.AddWidget(grid);

            var button = new Button("Button 1");

            button.ConnectClickedSignal(PrintHello, IntPtr.Zero, FreeData);
            grid.Attach(button, 0, 0, 1, 1);

            var toggleButton = new ToggleButton("Button 2");

            toggleButton.ConnectToggledSignal(PrintToggled,
                                              IntPtr.Zero, FreeData);
            grid.Attach(toggleButton, 1, 0, 1, 1);

            button = new Button("Quit");
            button.ConnectClickedSignalSwapped(WindowDestroy, window.Handle, FreeData);
            grid.Attach(button, 0, 1, 2, 1);
            window.Show();
        }