Example #1
0
void
onExpose(Widget w, XtPointer udata, XtPointer cdata)
{
  Widget mgr = (Widget) udata;

  /* draw into window */
  XmeDrawArrow(XtDisplay(w), 
               XtWindow(w), 
               Prim_BottomShadowGC(w), /* bottom gc */
               Prim_TopShadowGC(w),    /* top gc */
               MGR_BackgroundGC(mgr), /* fill gc */
               5, 5, 21, 22, 1, XmARROW_DOWN);
}
Example #2
0
/* Wrapper around XmeDrawArrow to calculate sizes. */
static void
DrawArrow(XmArrowButtonWidget aw,
	  GC		      top_gc,
	  GC		      bottom_gc,
	  GC		      center_gc)
{
  Position x, y;
  Dimension width, height;
  Dimension margin = (aw->primitive.highlight_thickness + 
			  aw->primitive.shadow_thickness);
  
  /* Don't let large margins cause confusion. */
  if (margin <= (Dimension)(aw->core.width / 2))
    {
      x = margin;
      width = aw->core.width - (margin * 2);
    }
  else
    {
      x = aw->core.width / 2;
      width = 0;
    }
  
  if (margin <= (Dimension)(aw->core.height / 2))
    {
      y = margin;
      height = aw->core.height - (margin * 2);
    }
  else
    {
      y = aw->core.height / 2;
      height = 0;
    }
  
  /* The way we currently handle 1 shadowThickness in XmeDrawArrow 
     is by drawing the center a little bit bigger, so the center_gc has
     to be present. Kinda hacky... */
  if (!center_gc && 
      aw->arrowbutton.detail_shadow_thickness == 1) 
      center_gc = aw->arrowbutton.arrow_GC ;

  if (center_gc)
    XSetClipMask(XtDisplay((Widget)aw), center_gc, None);

  XmeDrawArrow (XtDisplay ((Widget) aw), XtWindow ((Widget) aw),
		top_gc, bottom_gc, center_gc,
		x, y, width, height, 
		aw->arrowbutton.detail_shadow_thickness, 
		aw->arrowbutton.direction);
}