I have some old code using XmStringDrawImage which does not work  
anymore under lesstif.

It works fine with OpenMotif, but as Lesstif is the Motif version of  
Fedora Core 10, I would rather stick to Lesstif

If I replace the call to XmStringDrawImage with XmStringDraw, it works  
fine, but of course, it does not paint the background. The sgc and gc  
graphic context are used in other places in my code and seems to work,  
so I am quite puzzled.

Any issues with XmStringDrawImage which I should be aware off?

Here is an example of the code.

Thanks in advance,

void draw_node(Widget w, Draw_Data *dd, int x, int y, int wi, int h,  
Gnode *n, PBoolean sel)
{
      Display *dpy = XtDisplay(w);
      Window win = dd->window;
      Node *node = n->node;

      int xs, ys;

      xs = x - dd->left;
      ys = y - dd->top;

      XFillRectangle(dpy, win, dd->sgc,
                    xs, ys, wi, h);

      XDrawRectangle(dpy, win,  dd->gc ,
                    xs + 1, ys + 1,
                    n->swidth + 2, n->sheight + 2);

      XmStringDrawImage(dpy, win, dd->fontlist, n->xmstring,
                  (sel ? dd->sgc : dd->gc),
                  xs + 4, ys + 3, n->swidth - 2,
                  XmALIGNMENT_BEGINNING,
                  XmSTRING_DIRECTION_L_TO_R,
                  NULL);

      if (node->join) {
          XDrawLine(dpy, win,  dd->gc,
                    xs + 1, ys + 2,
                    xs + n->swidth + 3 , ys + 2);
          XDrawLine(dpy, win,  dd->gc,
                    xs + 1, ys + 3,
                    xs + n->swidth + 3 , ys + 3);
      }

      if (node->split) {
          XDrawLine(dpy, win,  dd->gc ,
                    xs + 1, ys  + n->sheight + 2,
                    xs +  n->swidth + 3 , ys + n->sheight + 2);
          XDrawLine(dpy, win,  dd->gc ,
                    xs + 1, ys + n->sheight + 1,
                    xs + n->swidth + 3 , ys + n->sheight + 1);
      }

}

-- 
      Felix
Sarko et la recherche:
http://tinyurl.com/bj63q3


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Lesstif-discuss mailing list
Lesstif-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lesstif-discuss

Reply via email to