Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!osf.org!wwang From: wwang@osf.org ("Weidong Wang from OSF") Newsgroups: comp.windows.x.motif Subject: Re: How to create separate windows ?? Message-ID: <9104221643.AA03084@osfsun> Date: 22 Apr 91 09:42:37 GMT References: <1991Apr22.015111.19629@hubcap.clemson.edu> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 47 > > I want to create an application that has a control panel and another > completely separate window also. > What you should do is to create two shells, not just two widgets under one shell. > > Here is a code fragment with many extras taken out: > > XtToolkitInitialize(); > app_context = XtCreateApplicationContext(); > display = XtOpenDisplay(app_context, NULL, argv[0], "MNSFEdit", > NULL, 0, &argc, argv); > toplevel = XtAppCreateShell (argv[0], NULL, applicationShellWidgetClass, > display, arglist, n); > XtManageChild(XmCreateFileSelectionBox(toplevel, "fb", args, 0)); shell2 = XtCreateWidget("shell2", topLevelShellWidgetClass, toplevel, args, 0); > mainW = XmCreateMainWindow (shell2, "mainW", arglist, n); > XtManageChild (mainW); > > controlW = XmCreateBulletinBoardDialog (toplevel, "PageDisplayControlPanel", > arglist, n); > > XtRealizeWidget(toplevel); > XtRealizeWidget(shell2); XtManageChild(controlW); > XtAppMainLoop(app_context); > ------------------------------------- > This will give you a shell with a file selectionbox in it, another shell with a main window init, and a dialog bulletin board shell. 3 windows. Hope this helps. Weidong Wang Systems, Engineering, OSF