newsuser@oliver.SUBLINK.ORG (Ugo Cei) (03/15/91)
I have some problems regarding the specificaton of resources for applications written using the OLIT widget set under OW 2.0 (SunOS 4.1.1). Specifically, if I initialize my application calling OlInitialize like this: toplevel = OlInitialize("appl", "Appl", ... where "appl" and "Appl" are meant to be the application's name and class respectively, I can never get my app to understand resources like: Appl*OblongButton.widht: 100 as I did with Athena widgets and XtInitialize, but only: appl*OblongButton.width: 100 I have also tried to use XtInitialize and XtAppInitialize, but I only get core dumps when I try to create a widget. I could let this pass, but I have also problems in specifying resources for some kinds of widgets. For instance, the reference manual says that the OblongButton widget class has three color resources: "background" for the button's background, "fontColor" for the label and "foreground" for the border. However, I can only change the label's color through the "foreground" resource and the background color through the "background" one, while "fontColor" has no visible effect. Moreover, my buttons are contained in a ControlArea widget, for which I cannot set neither the foreground nor the background, and I am thus forced to have it white. -- **************** | Ugo Cei | SUBLINK: newsuser@oliver.sublink.org * OLIVER * | Via Colombo 7 | INTERNET: cei@ipvvis.unipv.it **************** | 27100 Pavia ITALY | "Real Programs Dump Core"
mls@cbnewsm.att.com (mike.siemon) (03/19/91)
> I have some problems regarding the specificaton of resources for > applications written using the OLIT widget set under OW 2.0 (SunOS 4.1.1). > Specifically, if I initialize my application calling OlInitialize like > this: > > toplevel = OlInitialize("appl", "Appl", ... > > where "appl" and "Appl" are meant to be the application's name and > class respectively, I can never get my app to understand resources > like: > > Appl*OblongButton.widht: 100 Sorry, this is a bug in the OPEN LOOK 2.0 (USL's designation) or OpenWindows 2.0 (Sun's designation) toolkit. The details are a bit murky (in other words I don't recall exactly what is wrong), but it has to do with the internals of OlInitialize: OlInitialize(...) { ... fake_top_level = XtInitialize(..., classname, ...); real_top_level = XtCreateApplicationShell("BaseWindowShell", ...); ... return (real_top_level); } > I have also problems in specifying resources for some kinds of > widgets. For instance, the reference manual says that the OblongButton > widget class has three color resources: "background" for the button's > background, "fontColor" for the label and "foreground" for the border. > However, I can only change the label's color through the "foreground" > resource and the background color through the "background" one, while > "fontColor" has no visible effect. This is a rare case where the documentation was ahead of the code :-) The OPEN LOOK 4.0 (USL) / OpenWindows 2.5 (Sun) release of the toolkit has added support for this resource. > Moreover, my buttons are contained > in a ControlArea widget, for which I cannot set neither the foreground > nor the background, and I am thus forced to have it white. Hmmm, this seems strange since that should work. One bug, though, is the class name for the ControlArea widget is Control, not ControlArea. This is contrary to both the documentation and the suggested Xt conventions. Steve Humphrey UNIX System Laboratories
newsuser@oliver.SUBLINK.ORG (Ugo Cei) (03/22/91)
mls@cbnewsm.att.com (mike.siemon) writes: >> Moreover, my buttons are contained >> in a ControlArea widget, for which I cannot set neither the foreground >> nor the background, and I am thus forced to have it white. >Hmmm, this seems strange since that should work. One bug, >though, is the class name for the ControlArea widget is >Control, not ControlArea. This is contrary to both the >documentation and the suggested Xt conventions. Thank you very much, this was indeed the reason for my not being able to change it. I have changed my resource file to use Control instead of ControlArea and now I can set its background, but only if I specify: appl*Control*background: red whereas if I say: appl*Control.background: red this has no effect (???). This poses a problem, since my ControlArea widget contains some OblongButtons, whose background is changed to red even if I say: appl*OblongButton.background: blue I thought that this second specification should override the former, since it seems more specific, but I am not sure. However, I am still trying to have a red control area with blue buttons while I only manage to get either a white control area with blue buttons or a red area with red buttons. Any help ? (And please don't flame me for my color choices, they are only for exemplificative purposes.) -- **************** | Ugo Cei | SUBLINK: newsuser@oliver.sublink.org * OLIVER * | Via Colombo 7 | INTERNET: cei@ipvvis.unipv.it **************** | 27100 Pavia ITALY | "Real Programs Dump Core"