cathy@cged.co.uk (Cathy Evans) (04/10/91)
I am using Motif 1.1. I am trying to use the labelPixmap and labelInsensitivePixmap resources of an XmLabel to toggle an icon between two states. Setting labelPixmap works okay, but the bitmap I specify using labelInsensitivePixmap never appears. Am I doing something wrong? I don't have the Motif source, so I can't do any more investigations. I am using WCL and the Mri resource file below demonstrates my problem - I include the bitmaps I'm using for completeness, but any two bitmaps will do. However, the problem is not confined to WCL - I have tried using the labelInsensitivePixmap resource with a standard Motif C program with the same result. =========================================================================== # Resource file for use with Mri # buttonOn sets the label to sensitive displaying the 'on' bitmap, # buttonOff to insensitive and should display the 'off' bitmap (it doesn't) # on.h and off.h are both produced using `bitmap' and are in the # current working directory. Mri.wcChildren: rc Mri.title: Test *rc.wcClassName: XmRowColumn *rc.wcChildren: label, buttonOn, buttonOff, quit *label.wcClassName: XmLabel *label.labelType: PIXMAP *label.labelPixmap: on.h *label.labelInsensitivePixmap: off.h *buttonOn.wcClassName: XmPushButton *buttonOn.labelString: On *buttonOn.activateCallback: WcSetSensitiveCB(*label) *buttonOff.wcClassName: XmPushButton *buttonOff.labelString: Off *buttonOff.activateCallback: WcSetInsensitiveCB(*label) *quit.wcClassName: XmPushButton *quit.activateCallback: WcExitCB =========================================================================== Bitmap file on.h: =========================================================================== #define on_width 16 #define on_height 16 static char on_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x84, 0x00, 0x84, 0x26, 0x84, 0x26, 0x84, 0x26, 0x78, 0x2a, 0x00, 0x32, 0x00, 0x32, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; =========================================================================== Bitmap file off.h: =========================================================================== #define off_width 16 #define off_height 16 static char off_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xa2, 0x07, 0xa2, 0x00, 0xa2, 0x38, 0x9c, 0x0b, 0x80, 0x08, 0x80, 0x38, 0x80, 0x08, 0x40, 0x08, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}; =========================================================================== Cathy Evans Computer General ED, Bath BA1 1JR, UK cathy@cged.co.uk
slh@gibdo.engr.washington.edu (04/15/91)
In article <1991Apr10.111948.26461@cged.co.uk> cathy@cged.co.uk (Cathy Evans) writes: |I am using Motif 1.1. I am trying to use the labelPixmap and |labelInsensitivePixmap resources of an XmLabel to toggle an icon |between two states. Setting labelPixmap works okay, but the bitmap I |specify using labelInsensitivePixmap never appears. Am I doing |something wrong? I don't have the Motif source, so I can't do any |more investigations. | I'm not using 1.1, but since no one else answered, I'll guess. labelInsensitivePixmap may only be there for support for subclasses of label and so label never does anything with it (does it make sense for a label to be insensitive? I don't know) Try using XmPushButton; you'll probably also have to set fillOnArm to False or disable the press translation so the the button doesn't do anything when pressed