Article View: comp.windows.interviews
Article #632Re: read option "-monochrome"
From: Woersinger Diplomand von ASK
Date: Tue, 29 Sep 1992 13:30
Date: Tue, 29 Sep 1992 13:30
69 lines
2127 bytes
2127 bytes
hi,
Martin Schmidt started a programm with the monochome option (prog -monochrome)
and wondered why Style::value_is_on ("monochrome") is false.
There is NO styleattribute named "monochrome".
"monochrome" is an attributevalue of attribute "gui"
(see ../iv/src/lib/InterViews/session.c")
static OptionDesc defoptions[] = {
.
{ "-monochrome", "*gui", OptionValueImplicit, "monochrome" },
.
.
};
So, "prog -monochrome" is the same as "prog -xrm gui:monochrome".
(-xrm option see IV-RefMan V3.1Beta, table 1.1)
This programm prints "mono is on", when
* -monochrome or -xrm gui:monochrome option is used,
* or file "prog" in ../app_defaults is containing *gui: monochrome
* or proplist contains {"*gui", "monochrome"} (remove all /* and */ )
__________________________________________________________________
#include <stdio.h>
#include <InterViews/session.h>
#include <InterViews/style.h>
/* static PropertyData proplist[] = {
{"*gui","monochrome"},
nil
};
static OptionDesc options[] = {
};
*/
int main(int argc, char** argv)
{
Session* session = new Session("prog", argc, argv /* optlist, proplist */ );
Style *style = session->style();
String val;
if (style_->find_attribute("gui",val))
if (val==String("monochrome"))
printf ("mono is on\n");
...
}
_________________________________________________________________
Rolf-Martin Woersinger Akademische Software Kooperation (ASK)
woersi@lodsun1.lod.uni-karlsruhe.de Karlsruhe, Germany +49-721-695639
Technical Details
Message-ID:
<9209291330.AA03643@lodsun1.lod.uni-karlsruhe.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!LODSUN1.LOD.UNI-KARLSRUHE.DE!woersiShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!LODSUN1.LOD.UNI-KARLSRUHE.DE!woersi From: woersi@LODSUN1.LOD.UNI-KARLSRUHE.DE (Woersinger Diplomand von ASK) Subject: Re: read option "-monochrome" Message-ID: <9209291330.AA03643@lodsun1.lod.uni-karlsruhe.de> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Tue, 29 Sep 1992 13:30:43 GMT Lines: 69