[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jun 21 14:00:09 1993 
Subject:Re: propsheet colours 
From:adrianh (Adrian Howard) 
Volume-ID:930621.04 

> From: "A.Sloman" <A.Sloman@cs.bham.ac.uk>
> 
> Has anyone tried changing foreground and background colours in
> connection with lib propsheet?
> [...]
> All help gratefully received, except advice on which X manuals to read.
> I absolutely refuse to go and read X manuals to find out how to drive
> Pop-11 facilities: it should all be doable using pop-11 idioms.
> 
> Aaron

The following should do what you want:


    define set_tree_colors(fg, bg, root);
        dlvars fg, bg, root;
        applist(
            root.XptWidgetTree.flatten,
            procedure(widget);
                lvars widget,
                    has_fg = XptResourceInfo(widget, XtN foreground),
                    has_bg = XptResourceInfo(widget, XtN background),
                    has_fc = XptResourceInfo(widget, XtN fontColor)
                ;
                if has_fg then fg endif,
                if has_bg then bg endif,
                if has_fc then fg endif
                    -> XptPopValue(
                        widget,
                        if has_fg then XtN foreground endif,
                        if has_bg then XtN background endif,
                        if has_fc then XtN fontColor  endif
                    );
            endprocedure
        );
    enddefine;

    uses propsheet;
    propsheet_init();
    vars mybox=propsheet_new_box('Properties', false, false, false);
    vars mysheet = propsheet_new('Basic Settings', mybox, false);
    propsheet_show([% mysheet, mybox %]);
    propsheet_field(mysheet, [Filename '']);

	set_tree_colors('black', 'white', mybox);


aids (email: adrianh@cogs.susx.ac.uk, phone: [+44] (0)273-678367)
ObDisclamer: Poplog pay my wages