Re: [AD] [GUI] Error using MSG_IDLE |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
here is a very simple program that you can test what i mean. if you comment
the sendmessage line it will work
---
#include <allegro.h>
int my_proc(int msg, DIALOG *d, int c) {
if (msg == MSG_IDLE) {
SEND_MESSAGE(active_dialog + 0, MSG_DRAW, 0);
}
return D_O_K;
}
int main(void) {
static DIALOG dialog[] = {
/* (dialog proc)(x)(y)(w)(h)(fg)(bg)(key)(flags)(d1)(d2)(dp)(dp2)(dp3)
{ d_box_proc, 0, 20, 640, 35, 15, 15, 0, 0, 0, 0, NULL, NULL, NULL },
{ my_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL },
{ NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
allegro_init();
install_keyboard();
install_timer();
install_mouse();
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
do_dialog(dialog, -1);
allegro_exit();
}
END_OF_MAIN();
---
I know it doesnt check many parameters, but it's just an example
compile it with the send_message line commented and uncommented
----- Original Message -----
From: "Javier González" <xaviergonz@xxxxxxxxxx>
To: "Allegro Conductors" <conductors@xxxxxxxxxx>
Sent: Monday, January 29, 2001 2:36 PM
Subject: Re: [AD] [GUI] Error using MSG_IDLE
>
> ----- Original Message -----
> From: "Vincent Penquerc'h" <vincent@xxxxxxxxxx>
> To: "Javier González" <xaviergonz@xxxxxxxxxx>
> Sent: Monday, January 29, 2001 12:24 PM
> Subject: RE: [AD] [GUI] Error using MSG_IDLE
>
>
> > > Hello, when inside one of my gui procs i add
> > > if (MSG_IDLE) {
> > > SEND_MESSAGE(blabla, MSG_DRAW, 0);
> > > }
> > >
> > > this is, when i add the SEND_MESSAGE, the program after x secs crashes
> > > but when i delete that line works correctly
> > > this didnt happened with 3.9.33WIP
> >
> > do you mean if (msg==MSG_IDLE) ?
> > if not, then it's probably stack overflow.
> yes, i meant if (msg == MSG_IDLE)
>
> what do you mean by an stack overflow? i mean, why should that happen?
>