File: 0rows.c

package info (click to toggle)
xbae 4.60.4-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,020 kB
  • sloc: ansic: 22,089; sh: 8,293; makefile: 522; tcl: 1
file content (52 lines) | stat: -rw-r--r-- 1,234 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
/* $Header: /cvsroot/xbae/Xbae/examples/tests/0rows.c,v 1.2 2005/03/28 17:47:33 tobiasoed Exp $
 * if a table is initialized, filled with some rows, cleared to 0 rows (is empty) 
 * and then realized and mapped, a sigsev error occures,
 *
 */

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

#include <Xm/Xm.h>
#include <Xbae/Matrix.h>

#include <XbaeConfig.h>

static String fallback[] = {
        "XbaeTest.height:           250",
        "XbaeTest.width:            250",
        NULL
};

String	rows[] = { "1" , "a" , "3" , "b" , NULL};

int
main(int argc, char *argv[])
{
	XtAppContext app;
	Widget shell, w;

	shell = XtAppInitialize(&app, "XbaeTest", NULL, 0, &argc, argv, fallback, NULL, 0);

	w = XtCreateWidget("mw", xbaeMatrixWidgetClass, shell, NULL, 0);
	XtVaSetValues(w,
			XmNrows, 0,
			XmNcolumns, 0,
			XmNcolumnLabels, 0,
			XmNxmColumnLabels, 0,
			XmNcolumnMaxLengths, 0,
			XmNcolumnAlignments, 0,
			XmNcolumnFontBold, 0,
			XmNcolumnButtonLabels, 0,
			XmNcolumnLabelAlignments, 0,
			XmNshowColumnArrows, 0,
			XmNcolumnWidths, 0,
			NULL);
	XbaeMatrixAddRows(w, 0, rows, NULL, NULL, 2);
	XbaeMatrixDeleteRows(w, 0, 2);
	XtManageChild(w);
	XtRealizeWidget(shell);
	XtAppMainLoop(app);
	exit(0);
}