getting the forground and background colours of a window (widget) 
Author Message
 getting the forground and background colours of a window (widget)

Has anyone found a good way to determine the foreground or background
colour of a window created using Xpw, e.g. the rc_graphic window.

Thanks.
Aaron



Sat, 02 Dec 1995 08:31:55 GMT  
 getting the forground and background colours of a window (widget)

Quote:

> Has anyone found a good way to determine the foreground or background
> colour of a window created using Xpw, e.g. the rc_graphic window.

The RGB values of a pixel can be returned with -XpwQueryColor- like
this:

    uses rc_graphic;
    rc_start();

    ;;; Get pixel of bg
    vars bg_pixel = rc_window(XtN background);
    bg_pixel=>
    ** 5

    ;;; Return RGB values (scaled to 0--255 inclusive)
    vars rgb = [% XpwQueryColor(rc_window, bg_pixel) %]
    rgb=>
    ** [135 206 250]

Is this enough?


ObDisclamer: Poplog pay my wages



Sat, 02 Dec 1995 19:22:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Determining forground and background

2. background colours in dos progs

3. Background Colours

4. Text, Tags and background colours.

5. default background colours (option add?)

6. Help with foreground/background colours

7. newbie: Getting widget sizes after scaling window.

8. GIF colours displayed wrong on other than 256-colours

9. DevicePaint class and reversing colours for widgets.

10. Reversing colours on widgets

11. Tkinter - Widget Colours

12. Listbox widget - colours

 

 
Powered by phpBB® Forum Software