static void Main(string[] args) { // Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero); Debug.Assert(oleres == 0); // Create the window var wnd = new SciterWindow(); wnd.CreateMainWindow(1500, 800); wnd.CenterTopLevelWindow(); wnd.Title = "Sciter Bootstrap"; wnd.Icon = Properties.Resources.IconMain; // Prepares SciterHost and then load the page var host = new Host(); host.SetupWindow(wnd); host.RegisterBehaviorHandler("DrawBitmap", typeof(DrawBitmapBehavior)); host.RegisterBehaviorHandler("DrawText", typeof(DrawTextBehavior)); host.RegisterBehaviorHandler("DrawGeometry", typeof(DrawGeometryBehavior)); host.AttachEvh(new HostEvh()); host.SetupPage("index.html"); // Show window and Run message loop wnd.Show(); PInvokeUtils.RunMsgLoop(); }
public override void DidFinishLaunching(NSNotification notification) { wnd = new SciterWindow(); wnd.CreateMainWindow(800, 500); wnd.CenterTopLevelWindow(); wnd.Title = "SciterSharp from OSX"; host = new Host(); host.SetupWindow(wnd); host.AttachEvh(new HostEvh()); host.SetupPage("index.html"); //host.DebugInspect(); wnd.Show(); }
static void Main(string[] args) { #if WINDOWS // Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero); Debug.Assert(oleres == 0); #endif #if GTKMONO PInvokeGTK.gtk_init(IntPtr.Zero, IntPtr.Zero); #endif DbgHandler = new DebugHandlerGTK(); /* 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. */ // Check minimum Sciter version required for this app if(SciterX.API.SciterVersion(1) < 0x00030003 || SciterX.API.SciterVersion(0) < 0x00010002) throw new Exception("Sciter shared library is outdated."); // Create the window var wnd = new SciterWindow(); wnd.CreateMainWindow(800, 600); wnd.CenterTopLevelWindow(); wnd.Title = "Font Lister"; #if WINDOWS wnd.Icon = Properties.Resources.IconMain; #endif // Prepares SciterHost and then load the page var host = new Host(); host.SetupWindow(wnd); host.AttachEvh(new HostEvh()); host.SetupPage("index.html"); host.DebugInspect(); HostInstance = host; FontLister.Data.GAPI.Setup(); // Show window and Run message loop wnd.Show(); PInvokeUtils.RunMsgLoop(); }
static void Main(string[] args) { // TODO: think Andrew corrected child window creation PInvokeWindows.OleInitialize(IntPtr.Zero); // Create the window var wnd = new SciterWindow(); wnd.CreateMainWindow(1500, 800); wnd.Title = "Sciter Bootstrap"; wnd.CenterTopLevelWindow(); wnd.Icon = Properties.Resources.Icon1; //wnd.EnableDwmClientArea(); //wnd.AfterWindowCreate(); // Prepares SciterHost and then load the page var host = new Host(); host.SetupWindow(wnd); host.AttachEvh(new HostEvh()); host.SetupPage("index.html"); //host.DebugInspect(); // get the page <body> var se_body = wnd.RootElement.SelectFirst("body"); // append a <h1> header to it se_body.TransformHTML("<h1>Wow, this header was created natively!</h1>", SciterXDom.SET_ELEMENT_HTML.SIH_INSERT_AT_START); // set <h1> color to blue se_body[0].SetStyle("color", "#00F"); /*SciterWindow wnd_popup = new SciterWindow(); wnd_popup.CreatePopupAlphaWindow(400, 400, wnd._hwnd); wnd_popup.LoadHtml("<html><body><style>html { background: red; }</style></body></html>"); wnd_popup.Show();*/ // Show window and Run message loop wnd.Show(); PInvokeUtils.RunMsgLoop(); }