home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!.IMD.Sterling.COM!chris
- From: chris@.IMD.Sterling.COM (Chris Olson)
- Subject: Need help with GadTools....
- Message-ID: <1992Sep1.135513.7894@sparky.imd.sterling.com>
- Sender: news@sparky.imd.sterling.com (News Admin)
- Organization: Sterling Software
- Date: Tue, 1 Sep 1992 13:55:13 GMT
- Lines: 70
- X-Md4-Signature: aab2086f91ba494f7590562cec0cdf53
-
- Greetings, and welcome to my problem...
-
- I have been working on a program which is going to use a simple descriptive
- text file to define the gadgets. Everything is working just fine until I
- get to the CreateGadgetA call, which fails. I don't know why. I've had the
- program dump out the structures involved:
-
- Gadget creation failed.
-
- kind = 12 (STRING_KIND)
- struct NewGadget newgad = {
- ng_LeftEdge = 60
- ng_TopEdge = 10
- ng_Width = 160
- ng_Height = 12
- ng_GadgetText = "Name:"
- ng_TextAttr = 0x00279B54 { "topaz", 8, FS_NORMAL, FPF_ROMFONT }
- ng_GadgetID = 1
- ng_Flags = 0x00000001
- ng_VisualInfo = 0x002644EC
- ng_UserData = 0x00000000
- };
- tags {
- 0x8008002D = 0x0027E720 "No Name"
- 0x8008002E = 0x0000003C 60
- 0x00000000
- };
-
- The only item of this structure that I have not verified is the VisualInfo,
- but that had been used by my menu creation routines without any probelm. Here's
- the relevant code for the gadget creations:
-
- .
- .
- .
- struct Gagdet *gad;
- struct Gadget *glist = NULL;
-
- gad = CreateContext(&glist);
- if (gad == NULL) {
- fprintf(stderr, "Creation failed...\n");
- return NULL;
- }
- .
- .
- .
- gad = CreateGadgetA(kind, gad, &newgad, taglist);
- if (gad == NULL) {
- fprintf(stderr, "Gadget creation failed.\n\n");
- dump_newgad();
- dump_tags();
- return NULL;
- }
- .
- .
- .
-
- Note that 'kind', 'newgad' and 'taglist' are static globals.
-
- Anybody got a clue as to why this is failing on a regular basis, or maybe
- a working example of a call to CreateGadgetA with a string_kind? Any clues as
- to what is happening? Any help would be greatly appreciated.
-
- AtDhVaAnNkCsE,
- Chris Olson
- ---
- ____/ / __/ chris@IMD.Sterling.COM
- / __ / __/ / ___/
- / / / / / ___ / "It's intuitively obvious to the most
- ______/ __/ __/ __/ __/ ______/ casual observer..."
-