File: beeps.c

package info (click to toggle)
xbae 4.60.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 5,452 kB
  • ctags: 2,046
  • sloc: ansic: 21,858; sh: 8,195; makefile: 577; tcl: 1
file content (53 lines) | stat: -rw-r--r-- 1,376 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* $Id: beeps.c,v 1.3 2001/04/22 19:28:27 amai Exp $ */

/* 
   A code sample for
   SF [ #229550 ] Beeps using a pattern and XbaeInput on Linux.
   submitted by Tobias Oed
   
   "When using an XbaeInput widget that has a pattern defined I get beeps
   when I move the window that contains the widget, as well as when the window 
   looses focus etc... 
   I observe this behaviour on intel686 running linux+lesstif, 
   but not on alpha machines running digital unix+motif."
*/

#include <stdlib.h>
#include <stdio.h>

#include <X11/Intrinsic.h>
#include <Xm/Xm.h>

#include <Xbae/Matrix.h> /* for version info */
#include <Xbae/Input.h>


int
main (int argc, char **argv)
{

  Arg wargs[3];
  int m;
  Widget toplevel, input;

  /* Print run-time version of libXbae to stdout */
  printf("Using Xbae %s\n", XbaeGetVersionTxt());
  printf("This example was build with %s\n", XbaeVersionTxt);

  /* Print compile-time version of libXm to stdout */
  printf("Xbae was build with %s\n", XbaeGetXmVersionTxt());
  printf("and is running with %s\n", XmVERSION_STRING);

  toplevel = XtInitialize (argv[0], "TestXbaeInput", NULL, 0, &argc, argv);

  m = 0;
  XtSetArg (wargs[m], XmNpattern, "[d][d][d][d][d]");
  m++;
  input = XbaeCreateInput (toplevel, "XbaeInput", wargs, m);

  XtManageChild (input);
  XtRealizeWidget (toplevel);
  XtMainLoop ();

  return (EXIT_SUCCESS);
}