Xref: news2.mv.net comp.os.msdos.djgpp:3371 From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro and GUI Routines Date: Thu, 2 May 1996 20:12:31 +0100 Organization: The University of York, UK Lines: 31 Message-ID: NNTP-Posting-Host: tower.york.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: Nicholas Marrone In-Reply-To: <4m95c1$c0p@frodo.smartlink.net> DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Thu, 2 May 1996, Nicholas Marrone wrote: > I've been using Allegro with a fair amount of success, and wanted to > make a PGN file reader (it has to do with chess files). I started to > make dialouges, and was able to use things like boxes and text, but > once I started to try out push buttons, DJGPP crashed! It's quite [...] > { d_list_proc, 450, 50, 120, 330, 255, 0, 0, 0, 0, 0, NULL }, This line is the culprit. The d_list_proc() object expects the dp field (the last one) to point to a function, which it calls to get information about the items in the listbox. You have a null pointer here, and calling NULL is a bad move... > { next_proc, 450, 340, 50, 20, 255, 0, 0, 0, 0, 0, "Next" }, > { back_proc, 450, 340, 50, 20, 255, 0, 0, 0, 0, 0, "Back" }, There are a couple of problems with these lines too, although they won't crash. For one thing, you have the two buttons in the same place, so you can only see one of them :-) More importantly, you need to set the object flags (in the middle of your row of five zeros) to D_EXIT. Otherwise the buttons will just toggle on and off, without doing anything when they are clicked. /* * Shawn Hargreaves. Why is 'phonetic' spelt with a ph? * Check out Allegro and FED on http://www.york.ac.uk/~slh100/ */