Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!sdd.hp.com!wuarchive!csus.edu!ucdavis!csusac!unify!openlook!openlook-request From: Amy.Moore@Corp.Sun.COM (Amy) Newsgroups: comp.windows.open-look Subject: Re: OLIT BaseWindow ala' OPEN LOOK App Style Guidelines Message-ID: Date: 30 May 91 18:01:22 GMT Lines: 122 >>Anyone have a short code fragment using OLIT that builds a Base Window, >>as described in the Application Style Guidelines? For example, page 68 >>contains a couple good examples. Unfortunately the OLIT widget set does >>not contain a widget that creates a base window for you. >> >>I want a menubar, a bulletin board with horizontal and vertical scrollbars >>that operate on AS-NEEDED policy, and a footer area. If I don't get a >>pointer to a better way, I'll build this as follows: Try building the following instance tree: toplevel | footerPanel (this automatically gives the sizing behavior you want) | | Form StaticText (this is the footer message) | ---------------------------- | | ControlArea(menubar) ScrolledWindow (attached to bottom of ControlArea) | | MenuButton1, ... BulletinBoard See code below... Regards, Amy Moore aim@sun.com --------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include /*****************************************************************/ main(argc, argv) int argc; char **argv; { Widget toplevel, footerpanel, form, menubar, scrollwin, bb, errortext; toplevel = OlInitialize(argv[0], "Test", NULL, 0, &argc, argv); footerpanel = XtVaCreateManagedWidget("footer", footerPanelWidgetClass, toplevel, NULL); /* * Create Topchild (first child): form */ form = XtVaCreateManagedWidget("topform", formWidgetClass, footerpanel, NULL); /* * Create FooterChild (second child): staticText */ errortext = XtVaCreateManagedWidget("errortext", staticTextWidgetClass, footerpanel, XtNstring, (XtArgVal)"errors:", XtNgravity, (XtArgVal)WestGravity, NULL); /* Here I could add other widgets to the "form"...*/ menubar = XtVaCreateManagedWidget("menubar", controlAreaWidgetClass, form, NULL); /* Here I'd add MenuButtons to menubar...*/ XtVaCreateManagedWidget("File", menuButtonWidgetClass, menubar, NULL); /* Add Scrolled Bulletin Board....*/ scrollwin = XtVaCreateManagedWidget("scrollwin", scrolledWindowWidgetClass, form, XtNyRefWidget, (XtArgVal)menubar, XtNyAddHeight, (XtArgVal)True, XtNxResizable, (XtArgVal)True, XtNyResizable, (XtArgVal)True, XtNyAttachBottom, (XtArgVal)True, XtNxAttachRight, (XtArgVal)True, NULL); bb = XtVaCreateManagedWidget("bulletinboard", bulletinBoardWidgetClass, scrollwin, XtNheight, (XtArgVal)500, XtNwidth, (XtArgVal)500, NULL); XtRealizeWidget(toplevel); XtMainLoop(); } /*******************************END EXAMPLE******************************/