Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!stan!imp From: imp@solbourne.com (Warner Losh) Newsgroups: comp.windows.x Subject: Re: need information about XVT Keywords: XVT x-development Message-ID: <1991Jun26.204244.29527@solbourne.com> Date: 26 Jun 91 20:42:44 GMT References: <1991Jun19.173316.18566@alphalpha.com> <1991Jun21.183405.26015@colorado.edu> <1991Jun24.195803.10980@alphalpha.com> Organization: Solbourne, User Interface Group Lines: 77 In article <1991Jun24.195803.10980@alphalpha.com> nazgul@alphalpha.com (Kee Hinckley) writes: >However I am not aware of any >virtual toolkits which allow you to take one of those manager widgets >(Table comes to mind) and put their "virtual" widgets inside of it. While it is true that you can't mix OI and Xt, you do have the same functionality. Since OI version 1.1 (released about a year ago) any object can have a layout method assocaited with it (which is slightly different than the Xt approach where you have to derive your widget from a manager superclass). This layout method tells the object how to layout its children. Isn't that basically the same thing as the manager widget? You work in row,column positions rather than x,y coordinates. The row and column positions are independent of the sizes of the objects. For example, if you wanted to put a glyph inside of a box and have some text centered under it, you could do it in the following 47 lines of code (including comments): #include #include int main (int argc, char **argv) { OI_connection *conp; OI_box *boxp; OI_glyph *glyphp; OI_static_text *textp; // // Initialize OI. // if ((conp = OI_init (&argc, argv, "Hello", "Hello World")) == NULL){ fprintf (stderr, "Can't connect to X server\n"); exit (1); } // // Create a box to put some stuff in. Set the layout method. // boxp = oi_create_box ("container", 1, 1); boxp->set_layout (OI_layout_row); // // Create the glyph to put in the box. Put it in row 1. // glyphp = oi_create_glyph ("glyph", "/usr/include/X11/bitmaps/xlogo32"); glyphp->set_gravity (OI_grav_center); glyphp->layout_associated_object (boxp, 0, 1, OI_ACTIVE); // // Create the text to put in the box. Put it in row 2. // textp = oi_create_static_text ("text", "Hello World"); textp->set_gravity (OI_grav_center); textp->layout_associated_object (boxp, 0, 2, OI_ACTIVE); // // Put the box on the screen and start the interaction. // boxp->set_associated_object (boxp->root(), OI_DEF_LOC, OI_DEF_LOC, OI_ACTIVE); OI_begin_interaction(); OI_fini(); return 0; } As you can see, I didn't need to know the size of anything to get stuff to layout correctly. The user can change the size of either the glyph or the static text through the use of resources (by changing the icon image, or the contents of the text string). The program will still center these two objects in a box. Warner -- Warner Losh imp@Solbourne.COM But it was our hill. And they were our beans.