Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!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.open-look Subject: Re: OL Flat Checkbox Widget Woes Message-ID: Date: 29 May 91 23:58:39 GMT References: <1991May29.182035.26184@cbnewsm.att.com> Organization: Auburn University Engineering Lines: 56 Nntp-Posting-Host: lab8.eng.auburn.edu In article <1991May29.182035.26184@cbnewsm.att.com> merlyn@attunix.att.com (Steve Humphrey) writes: > >I tried your code exactly as sent; it works fine on my '386 running >the OPEN LOOK 4.0 toolkit (equivalent to the OpenWindows 2.5 OLIT). >I have not tried it yet on a Sun. However, the problem MAY be in the >definition of the Item structure. Now the ``Open Look at UNIX'' book >has exactly the same problem, and I thought John Miller tested his >examples on a Sun, so something else may be wrong. > >The XtNitems resource takes an array of items, each of which is >defined by a structure of XtArgVal's. This parallels the way attributes >are passed in regular XtCreateWidget or XtSetValues calls, for exactly >the same reason: The widgets (or Intrinsics) do not know a priori >the type of each value, thus the values must be coerced to a common >type for passing from the client to the widget. > >So the correct code fragment from the above should be: > >> typedef struct _Item >> { >> XtArgVal label; >> } Item; >> >> static Item items[] = { >> { (XtArgVal)"CSE100" }, >> ... > >XtArgVal is defined as a "long" on Suns, versus the "char*" definition >of String. Now I would think this would be OK, but I'm not familiar >with native types of a SPARC chip. > >Even if it turns out this is not the problem at hand, I suggest >using the XtArgVal type in the definition of the XtNitems array's >structure. Eventually this *will* save you a core dump. > >Steve Humphrey >UNIX System Laboratories Steve, Thanks for the tip, but it didn't work. I still get the bus error in the same place. I don't think I mentioned it in my original post, but I`m running OLIT 2.5 under X11R4 on Sun SparcStations, if it makes any difference. Thanx, Ken +-------------------------+---------------------------------------------+ \ Ken Kirksey \ "Genetic Drifter, Quarantined in my own \ \ Computer Engineering \ dimension. \ \ Auburn University \ Hey Look! It Smokes! It Drinks! \ \ \ It Philosophizes! It's Loving this new \ \ kkirksey@eng.auburn.edu \ Attention!" \ \ AOL: kkirksey1 \ -Steve Taylor \ +--------------------------+---------------------------------------------+