[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

681.0. "PRODUCT ICON APPEARS DISTORTED" by TOOLS::HOCHULI () Wed Apr 26 1989 11:03

    We have a pixmap for our product icon and we convert it to pixels and
    do a set value on our top level widget (before the top level widget
    gets realized) to put the icon on our menu bar but the icon appears
    distorted when our application main window comes up (we are using
    BLISS).  If we bring up the icon in paint it looks OK.  Has anyone had
    this problem?
                
    
    
    

T.RTitleUserPersonal
Name
DateLines
681.1VIA::FINNEGANAll of the best intentions are less than one good act.Thu May 04 1989 13:2273
Does it work on a Black and White system?

I had problem where I wasn't creating a pixmap of the right depth.  Here is the
routine I use now: Note I don't thinks this works on a Multihead system but
the fix should be trivial for that.

Neal

#define calc_width 32
#define calc_height 32
static char calc_bits[] = {
   0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x0001, 0x0000, 0x0000, 0x0080,
   0x0001, 0x0000, 0x0000, 0x0080, 0x0081, 0x0001, 0x0000, 0x0080,
   0x0081, 0x0001, 0x0000, 0x0080, 0x0081, 0x0001, 0x0000, 0x0080,
   0x0081, 0x0001, 0x0000, 0x0080, 0x00f9, 0x001f, 0x00fe, 0x0087,
   0x00f9, 0x001f, 0x00fe, 0x0087, 0x0081, 0x0001, 0x0000, 0x0080,
   0x0081, 0x0001, 0x0000, 0x0080, 0x0081, 0x0001, 0x0000, 0x0080,
   0x0081, 0x0001, 0x0000, 0x0080, 0x0001, 0x0000, 0x0000, 0x0080,
   0x0001, 0x0000, 0x0000, 0x0080, 0x0001, 0x0000, 0x0000, 0x0080,
   0x0001, 0x0000, 0x0000, 0x0080, 0x0081, 0x0001, 0x0006, 0x0086,
   0x0081, 0x0001, 0x000e, 0x0087, 0x0001, 0x0000, 0x009c, 0x0083,
   0x0001, 0x0000, 0x00f8, 0x0081, 0x00f9, 0x001f, 0x00f0, 0x0080,
   0x00f9, 0x001f, 0x00f0, 0x0080, 0x0001, 0x0000, 0x00f8, 0x0081,
   0x0001, 0x0000, 0x009c, 0x0083, 0x0081, 0x0001, 0x000e, 0x0087,
   0x0081, 0x0001, 0x0006, 0x0086, 0x0001, 0x0000, 0x0000, 0x0080,
   0x0001, 0x0000, 0x0000, 0x0080, 0x0001, 0x0000, 0x0000, 0x0080,
   0x0001, 0x0000, 0x0000, 0x0080, 0x00ff, 0x00ff, 0x00ff, 0x00ff};

#define sm_calc_width 17
#define sm_calc_height 17
static char sm_calc_bits[] = {
   0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x02, 0x80, 0x00, 0x22, 0x80, 0x00,
   0x22, 0x80, 0x00, 0xfa, 0xbe, 0x00, 0x22, 0x80, 0x00, 0x22, 0x80, 0x00,
   0x02, 0x80, 0x00, 0x22, 0xa2, 0x00, 0x02, 0x94, 0x00, 0xfa, 0x88, 0x00,
   0x02, 0x94, 0x00, 0x22, 0xa2, 0x00, 0x02, 0x80, 0x00, 0xfe, 0xff, 0x00,
   0x00, 0x00, 0x00};

/* routine to make a pixmap stolen from session mgr */
static Pixmap MakePixmap(dpy, root, data, width, height) 
Display *dpy;
Drawable root;
short *data;
Dimension width, height;
{
    Pixmap pid;

    pid = XCreatePixmapFromBitmapData (dpy, root, data,
		(Dimension) width, (Dimension) height, 
		(unsigned long) BlackPixel (dpy, 0),
		(unsigned long) WhitePixel (dpy, 0),
		(unsigned int) DefaultDepth (dpy, 0));
    return(pid);
}


    icon_pixmap = MakePixmap (dpy, XDefaultRootWindow (dpy),
		calc_bits, calc_width, calc_height);
              
    sm_icon_pixmap = MakePixmap (dpy, XDefaultRootWindow (dpy),
       		sm_calc_bits, sm_calc_width, sm_calc_height);

    xtnumber = 0;
    XtSetArg (args [xtnumber],  XtNiconPixmap, icon_pixmap); xtnumber++;
    XtSetArg (args [xtnumber],  XtNiconifyPixmap, sm_icon_pixmap); xtnumber++;
    XtSetArg (args [xtnumber],  XtNcopyright, TRUE); xtnumber++;
    XtSetArg (args [xtnumber],  XtNallowShellResize, TRUE); xtnumber++;
    XtSetValues (toplevel, args, xtnumber);

    XtRealizeWidget (toplevel, 0, NULL);

    XtMainLoop ();
}

681.2Icon Pixmap are Bitmaps according to ICCCM.ENXIO::thomasThe Code WarriorThu May 04 1989 14:572
And Bitmaps are Pixmaps of depth one.