Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!ducvax.auburn.edu!eng.auburn.edu!kkirksey From: kkirksey@eng.auburn.edu (Kenneth B. Kirksey) Newsgroups: comp.windows.x Subject: OL Flat Checkbox Widget Woes Message-ID: Date: 29 May 91 03:09:51 GMT Organization: Auburn University Engineering Lines: 114 Nntp-Posting-Host: lab12.eng.auburn.edu I'm having a terrible time using the OL flat checkbox widget. I've included at the bottom the sample program I wrote to try my hand at using the flat checkbox. When I run it as is, it gives me a bus error. When I use dbx to trace it, I get the following dump: warning: core file read error: address not in data space `FCheckBox`DrawLabel() at 0xf7731774 `FCheckBox`DrawItem() at 0xf7731c10 `Flat`Redisplay() at 0xf7738698 SendExposureEvent() at 0xf76d8d8c CompressExposures() at 0xf76d8cf8 `Event`DispatchEvent() at 0xf76d88cc DecideToDispatch() at 0xf76d913c XtDispatchEvent() at 0xf76d92f4 XtAppMainLoop() at 0xf76d95cc XtMainLoop() at 0xf76d95ac main(argc = 1, argv = 0xf7fffc7c), line 81 in "/home/u2/jstrang/cost/src/FlatTest.c" (dbx) What am I doing wrong? This code is pretty much the sample code given on pages 180-183 of _An Open Look At Unix_. If anyone out there has had this problem before, or if anyone can tell me what I'm doing wrong, you would have my undying gratitude. Thanx in advance, Ken --------------Cut Here------------------------------------------------------- #include #include #include #include #include #include static String itemFields[] = { XtNlabel }; #define NUM_ITEM_FIELDS 1 typedef struct _Item { String label; } Item; Arg args[12]; int n; static Item items[] = { {"CSE100"}, {"foo"}, {"foo"}, {"foo"}, {"CSE120"}, {"foo"}, {"foo"}, {"foo"}, {"CSE200"}, {"foo"}, {"foo"}, {"foo"}, {"CSE2200"}, {"foo"}, {"foo"}, {"foo"} }; #define NUM_ITEMS 16 Widget toplevel, rs_flat_checkbox; main (argc, argv) int argc; char **argv; { /*-----------------------------------------------------------------------+ | Initialize Top Level Shell | +-----------------------------------------------------------------------*/ toplevel = OlInitialize ( "flatTest", "FlatTest", NULL, 0, &argc, argv); n = 0; XtSetArg (args[n], XtNlayoutType, OL_FIXEDCOLS); n++; XtSetArg (args[n], XtNmeasure, 4); n++; XtSetArg (args[n], XtNitems, items); n++; XtSetArg (args[n], XtNnumItems, NUM_ITEMS); n++; XtSetArg (args[n], XtNitemFields, itemFields); n++; XtSetArg (args[n], XtNnumItemFields, NUM_ITEM_FIELDS); n++; XtSetArg (args[n], XtNlabelJustify, OL_RIGHT); n++; rs_flat_checkbox = XtCreateManagedWidget( "rs_flat_checkbox", flatCheckBoxWidgetClass, toplevel, args, n); /*-----------------------------------------------------------------------+ | Go To It ............... | +-----------------------------------------------------------------------*/ XtRealizeWidget (toplevel); XtMainLoop(); }