Path: utzoo!attcan!uunet!mcvax!ukc!eagle!rlh2 From: rlh2@eagle.ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: RE: Problem with Command widget Keywords: Form Widget, Command Widget Message-ID: <5490@eagle.ukc.ac.uk> Date: 4 Sep 88 16:29:20 GMT References: <8809021922.AA22023@hara.fctunl.rccn.pt> Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 58 In article <8809021922.AA22023@hara.fctunl.rccn.pt> spa%hara.fctunl.rccn.pt@MITVMA.MIT.EDU (Salvador Pinto Abreu) writes: >Could someone help me with this one? > I'll try. >..... The purpose is to have a set of >buttons all the same size, which looks nicer. The Command widgets are >children of either a Form or a Box widget. > Fine, except you must remember that these widget classes have geometry managers, which are not to put too fine a point on it, primative. They will get better I am sure. By default they let the child have its own way. >A little later, I try to make the widget insensitive, by calling: > ... >The "sensitive" bit works fine, but the button shrinks down to its >minimum size. I tried: > ... Ah ha. This is because the label part of the command widget asks (during the set_values procedure stage) its parent if it can be its preferred size by making a geometry request. Now because this request is smaller than the size you forced it to be, the parent geometry manager gives the ok and the command widget shrinks... > >To no avail. Is this a bug? Am I doing something wrong? It is not really a bug, just a minor irritation. You just need to get the geometry manager to not allow the child to be resized. With the Form widget this can be achieved using .. XtSetArg(args[i], XtNresizable, FALSE); i++; XtSetValues(cw, (ArgList)args, i); (note: cw is the command widget) However the parent only uses this for geometry requests and will override the size of its children if it is resized. The Form also uses integer division when resizing and therefore gets truncation errors, yuk. Also if the widget is shrunk then the label part of the widget doesn't bother to reposition the label within this new size, now that is a BUG. The Box widget thinks it knows best and colludes with its children so the application doesn't get a look in. My advice is to stick with the Form widget or like me, write a better one. >Salvador Pinto Abreu BITNET/Internet: spa@hara.fctunl.rccn.pt Richard -- Richard Hesketh : rlh2@ukc.ac.uk ..!mcvax!ukc!rlh2 --- Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, England.