/// <summary> /// ShellWidgetの作成 /// </summary> /// <param name="context"></param> /// <param name="args">コマンドライン引数</param> /// <returns></returns> internal int CreateShell(ApplicationContext context, String[] args ) { InitialzieShell(context); //Applicationの管理リストに追加 AppContext.AddShellWidget(this); //ShellWidgetの作成 selfWidget = new Native.WidgetHandle( ExtremeSports.XtAppCreateShell(ref m_appContext.NativeContext, this.Name, ref args, this.ToolkitResources.ToXtArg())); this.ToolkitResources.Clear(); System.Diagnostics.Debug.WriteLine("CTX: display={0} context={1}", new object[]{context.NativeContext.display, context.NativeContext.context}); //Closeコールバックの追加 this.CallbackQueue.AaddWMCallback( "WM_DELETE_WINDOW", new G.XtCallBack( this.WMCloseCallBack )); //閉じられないように設定 ToolkitResources.Add( Native.Motif.ResourceId.XmNdeleteResponse, Native.Motif.Constant.XmDO_NOTHING ); ToolkitResources.SetWidget(true ); return 0; }
protected void CreateMotifGadget( Native.Motif.CreateSymbol sym, IWidget parent, XResource res) { if (0 == this.Name.Length) { // 名無しは作れないので強制命名 this.Name = AppContext.CreateTempName(this.GetType().Name); } IntPtr w = Native.Motif.XmSports.CallCreate2P(sym, parent, this.Name, (null != res) ? res.ToXtArg() : null); if (IntPtr.Zero == w) { throw new Exception($"{sym.ToString()} failed"); } NativeHandle = new Native.WidgetHandle(w); if (null != res) { res.Clear(); } }