www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/03/00:14:50

Xref: news2.mv.net comp.os.msdos.djgpp:3371
From: Shawn Hargreaves <slh100 AT york DOT ac DOT uk>
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: <Pine.SGI.3.91.960502194009.6143D-100000@tower.york.ac.uk>
NNTP-Posting-Host: tower.york.ac.uk
Mime-Version: 1.0
To: Nicholas Marrone <nmarrone AT smartlink DOT net>
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/
 */



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019