home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12944 < prev    next >
Encoding:
Text File  |  1992-09-01  |  2.3 KB  |  82 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!.IMD.Sterling.COM!chris
  3. From: chris@.IMD.Sterling.COM (Chris Olson)
  4. Subject: Need help with GadTools....
  5. Message-ID: <1992Sep1.135513.7894@sparky.imd.sterling.com>
  6. Sender: news@sparky.imd.sterling.com (News Admin)
  7. Organization: Sterling Software
  8. Date: Tue, 1 Sep 1992 13:55:13 GMT
  9. Lines: 70
  10. X-Md4-Signature: aab2086f91ba494f7590562cec0cdf53
  11.  
  12. Greetings, and welcome to my problem...
  13.  
  14. I have been working on a program which is going to use a simple descriptive
  15. text file to define the gadgets.  Everything is working just fine until I
  16. get to the CreateGadgetA call, which fails.  I don't know why.  I've had the
  17. program dump out the structures involved:
  18.  
  19.    Gadget creation failed.
  20.  
  21.    kind = 12 (STRING_KIND)
  22.    struct NewGadget newgad = {
  23.       ng_LeftEdge = 60
  24.       ng_TopEdge = 10
  25.       ng_Width = 160
  26.       ng_Height = 12
  27.       ng_GadgetText = "Name:"
  28.       ng_TextAttr = 0x00279B54 { "topaz", 8, FS_NORMAL, FPF_ROMFONT }
  29.       ng_GadgetID = 1
  30.       ng_Flags = 0x00000001
  31.       ng_VisualInfo = 0x002644EC
  32.       ng_UserData = 0x00000000
  33.    };
  34.    tags {
  35.       0x8008002D = 0x0027E720 "No Name"
  36.       0x8008002E = 0x0000003C 60
  37.       0x00000000
  38.    };
  39.  
  40.    The only item of this structure that I have not verified is the VisualInfo,
  41. but that had been used by my menu creation routines without any probelm.  Here's
  42. the relevant code for the gadget creations:
  43.  
  44.    .
  45.    .
  46.    .
  47.    struct Gagdet *gad;
  48.    struct Gadget *glist = NULL;
  49.  
  50.    gad = CreateContext(&glist);
  51.    if (gad == NULL) {
  52.       fprintf(stderr, "Creation failed...\n");
  53.       return NULL;
  54.    }
  55.    .
  56.    .
  57.    .
  58.    gad = CreateGadgetA(kind, gad, &newgad, taglist);
  59.    if (gad == NULL) {
  60.       fprintf(stderr, "Gadget creation failed.\n\n");
  61.       dump_newgad();
  62.       dump_tags();
  63.       return NULL;
  64.    }
  65.    .
  66.    .
  67.    .
  68.  
  69. Note that 'kind', 'newgad' and 'taglist' are static globals.
  70.  
  71. Anybody got a clue as to why this is failing on a regular basis, or maybe
  72. a working example of a call to CreateGadgetA with a string_kind?  Any clues as
  73. to what is happening?  Any help would be greatly appreciated.
  74.  
  75.         AtDhVaAnNkCsE,
  76.             Chris Olson
  77. --- 
  78.     ____/    /           __/            chris@IMD.Sterling.COM
  79.    /        __  /   __/   /    ___/
  80.   /        /   /   /     /  ___  /      "It's intuitively obvious to the most
  81. ______/ __/ __/ __/   __/ ______/        casual observer..."
  82.