Path: utzoo!attcan!uunet!mcsun!ukc!harrier.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: Re: resource lookup problem Message-ID: <5603@harrier.ukc.ac.uk> Date: 4 Oct 90 12:06:34 GMT References: <1239@cluster.cs.su.oz.au> <27499@bellcore.bellcore.com> Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 62 In article <27499@bellcore.bellcore.com> aw@cellar.bae.bellcore.com writes: >In article <1239@cluster.cs.su.oz.au>, >> xman*vertical.Translations: : StartScroll(Backward) \n\ > ^^^^^^^^ >I couldn't find any widgets/subwidgets named vertical in xman. "vertical" is a sub-widget instance of a Scrollbar in the Viewport widget class. >The scrollbar in xman is actually a subwidget of a compound widget >called ScrollByLineWidget. According to OReilly Vol. 4, >you can't directly set the resources of a compound widgets subwidget. You can in resource files but not "directly" in applications unless you know the widget id. Some widget classes have resources which are the widget id.s of their sub-objects or have convenience routines to return these ids. Once you have the id. you can *try* setting resource values using a call to XtSetValues(). However the compound widget will normally have final say over which resources can be changed (i.e. refusal of geometry changes). You may also *never* be able to change resources even using the resource database because the compound widget creates its sub-objects with hard-wired resource values given as arguments to XtCreate{Managed}Widget(). Widget programmers ought to be discouraged from hard-wiring-in sub-object resource settings, however the Xt Intrinsics currently does not have any real support for "Widget Class Defaults" for setting overridable defaults on sub-objects, (R5 wish?). >However, I tried the following variations of setting the >scrollbar subwidgets resources: > [ deleted ] > >So, if you aren't allowed to directly access a subwidgets resources, >why did all four of the "foreground" resource settings work? >Also, why does setting "Translations" work when you specify >xman as part of the resource, and fail when you don't? Setting resources via entries in a user defaults database requires that these entries override any similar entries given in application and user *Class* defaults files. To override a default the entry must have a resource name binding that is the same as or "tighter" than the one given in the app-defaults file. If you examine the Xman defaults file (normally installed in somewhere like /usr/lib/X11/app-defaults/Xman), you will see that it sets translations for quite a few widgets. The Xman defaults file has "Xman" prepended to all the resource entries, this is a bit of overkill and isn't really necessary. It is probably also the reason why adding "xman" to your resource entries makes them work .. (hint: instance names have a tighter binding than class names). >Thanks, >Andrew Moral: text editors aren't resource editors; you need to know too much 8-} Richard Hesketh : @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk : rlh2@ukc.ac.uk ..!{mcsun|mcvax}!ukc!rlh2 Computing Officer, Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, United Kingdom. Tel: +44 227 764000 ext 7620/7590 Fax: +44 227 762811