1 /*---------------------------------------------------------------------------- 2 -- 3 -- Module: xitCreArrPu 4 -- 5 -- Project: xit - X Internal Toolkit 6 -- System: xit - X Internal Toolkit 7 -- Subsystem: <> 8 -- Function block: <> 9 -- 10 -- Description: 11 -- Creates an arrow push button. 12 -- 13 -- Filename: xitCreArrPu.c 14 -- 15 -- Authors: Roger Larsson, Ulrika Bornetun 16 -- Creation date: 1991-10-20 17 -- 18 -- 19 -- (C) Copyright Ulrika Bornetun, Roger Larsson (1995) 20 -- All rights reserved 21 -- 22 -- Permission to use, copy, modify, and distribute this software and its 23 -- documentation for any purpose and without fee is hereby granted, 24 -- provided that the above copyright notice appear in all copies. Ulrika 25 -- Bornetun and Roger Larsson make no representations about the usability 26 -- of this software for any purpose. It is provided "as is" without express 27 -- or implied warranty. 28 ----------------------------------------------------------------------------*/ 29 30 /* SCCS module identifier. */ 31 static char SCCSID[] = "@(#) Module: xitCreArrPu.c, Version: 1.1, Date: 95/02/18 15:10:22"; 32 33 34 /*---------------------------------------------------------------------------- 35 -- Include files 36 ----------------------------------------------------------------------------*/ 37 38 #include <X11/Intrinsic.h> 39 #include <X11/Shell.h> 40 41 #include <Xm/Xm.h> 42 #include <Xm/ArrowB.h> 43 44 #include "xitTools.h" 45 46 47 /*---------------------------------------------------------------------------- 48 -- Macro definitions 49 ----------------------------------------------------------------------------*/ 50 51 52 /*---------------------------------------------------------------------------- 53 -- Type declarations 54 ----------------------------------------------------------------------------*/ 55 56 57 /*---------------------------------------------------------------------------- 58 -- Global definitions 59 ----------------------------------------------------------------------------*/ 60 61 62 /*---------------------------------------------------------------------------- 63 -- Function prototypes 64 ----------------------------------------------------------------------------*/ 65 66 67 68 /*---------------------------------------------------------------------------- 69 -- Functions 70 ----------------------------------------------------------------------------*/ 71 72 Widget xitCreateArrowPushButton(Widget parent,XIT_ARROW_STRUCT * pb)73 xitCreateArrowPushButton( Widget parent, 74 XIT_ARROW_STRUCT *pb ) 75 { 76 77 /* Variables. */ 78 Arg args[ 5 ]; 79 Cardinal n; 80 Widget w; 81 82 83 /* Code. */ 84 85 n = 0; 86 87 XtSetArg( args[ n ], XmNarrowDirection, pb -> direction ); n++; 88 89 if( ! pb -> sensitive ) { 90 XtSetArg( args[ n ], XmNsensitive, False ); n++; 91 } 92 93 w = XmCreateArrowButton( parent, pb -> name, args, n ); 94 95 if( pb -> callback != NULL ) 96 XtAddCallback( w, XmNactivateCallback, pb -> callback, pb -> name ); 97 98 99 return( w ); 100 101 } /* xitCreateArrowPushButton */ 102