Exemplo n.º 1
0
        static void Main(string[] args)
        {
            MessageBox.Show(IntPtr.Zero, "ola", "mnundo");

            // Platform specific (required for GTK)
            SciterPlatform.Initialize();
            // Sciter needs this for drag 'n drop support
            SciterPlatform.EnableDragAndDrop();

#if GTKMONO
            Mono.Setup();
#endif

            /*
             *      NOTE:
             *      In Linux, if you are getting a System.TypeInitializationException below, it is because you don't have 'libsciter-gtk-64.so' in your LD_LIBRARY_PATH.
             *      Run 'sudo bash install-libsciter.sh' contained in this package to install it in your system.
             */
            // Create the window
            AppWindow = new Window();

            // Prepares SciterHost and then load the page
            AppHost = new Host(AppWindow);

            // Run message loop
            SciterPlatform.RunMessageLoop();
        }
Exemplo n.º 2
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            Mono.Setup();

            // Create the window
            AppWindow = new Window();

            // Prepares SciterHost and then load the page
            AppHost = new Host(AppWindow);

            // Set our custom menu with Cocoa
            if (true)
            {
                // From XIB/NIB file (editable in Xcode Interface Builder)
                NSArray arr;
                bool    res = NSBundle.MainBundle.LoadNibNamed("MainMenu", NSApplication.SharedApplication, out arr);
                Debug.Assert(res);
            }
            else
            {
                // Or we can create it programatically
                var menu1 = new NSMenu();
                menu1.AddItem(new NSMenuItem("Hi there"));
                menu1.AddItem(NSMenuItem.SeparatorItem);
                menu1.AddItem(new NSMenuItem("Exit", (sender, e) => NSApplication.SharedApplication.Terminate(menu1)));

                var menu2 = new NSMenu("Second menu");
                menu2.AddItem(new NSMenuItem("What"));
                menu2.AddItem(new NSMenuItem("Hey"));

                var menubar = new NSMenu();
                menubar.AddItem(new NSMenuItem {
                    Submenu = menu1
                });
                menubar.AddItem(new NSMenuItem {
                    Submenu = menu2
                });

                NSApplication.SharedApplication.MainMenu = menubar;
            }
        }