Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!munnari.oz.au!csc!myb100 From: myb100@csc.anu.oz Newsgroups: comp.sys.amiga.tech Subject: Beginner questions - on Gadgets and Menus Message-ID: <2232.26757d10@csc.anu.oz> Date: 12 Jun 90 23:38:56 GMT Organization: Computer Services, Australian National University Lines: 62 G'day y'all ! After being such a great help with my last question, I thought I'd push my luck and ask two (3?) this time. :-) Both are about C, the first is probably simple :-) ? , the second probably a bit trickier. Question (1a): I have a window with two gadgets (TOGGLESELECT), each containing some text. When I select one of the gadgets, I'd like to change the text contained in this gadget. Below is an excerpt. This almost makes sense, but... I realise that I've probably crossed my &s with my .s and ->s, but I'm now going nuts. What am I doing wrong ????? [...] UBYTE gad1str[]="G1"; struct IntuiText text1 {...} struct Gadget gadg1 {...} [ Gadget 1 has been selected..] { printf("Reporting: 1 down\n"); /* No problem here */ strcpy(gad1str,"1g"); /* what I'd like to have in the gadget.*/ text1.IText=&gad1str[0]; /* Is this the right */ gadg1.GadgetText=&text1; /* incantation ? It looks right...but */ /* who am I to say :-) ? */ BeginRefresh(my_window); RefreshGadgets(gadg1,my_window,NULL); EndRefresh(my_window); } (1b) According to the C-manual, RefreshGadgets() starts at the specified gadget, and works its way down the list. In my program, gadg1 is followed by NULL and gadg2 is followed by &gadg1. When I replace gadg1 by gadg2 in the above RefreshGadgets(), I get a guru #3, regardless of anything else I had before it....how come ? (2) I've seen a neat sub-menu used in some programs, like VLT, where the sub-menu items were in a 4x3 grid, i.e. 12 items, 3 to each of 4 lines. Does anyone have some example code they could show me as to how this is done ? Any help on either item will be *greatly* appreciated. [E-mail or Post..] I support any calls for more example code in the Public Domain ! Us beginners with Intuition from C would appreciate it ! ANTICI..(tanx heeps)..PATION... :-) =============================================================================== Markus Buchhorn /// | This space Mt Stromlo and Siding Spring Observatories, Canberra /// | PMB Weston Ck. P.O. A.C.T. 2611, Australia \\\/// | intentionally markus@mso.anu.edu.au -or- nssdca::psi%mssso::markus \XX/ | left blank ------------------------------------------------------------------------------- Phone donations: AUS-6-249-0280 Flames: alt.dev.null Disclaimer: standard ===============================================================================