Hello,

I try to do a dynamic scrollview, so for each update I want to clean my 
instance of scrollview, I put what I want in et update. But I get an segment 
fault exception. I have been able to reproduce the problem on the agar demo of 
scrollview wich I have juste a little modified the source code.

So if you compile the code joined to this email you will get a scrollview with 
an "Ajouter" button, if you click on it the exception occurs.

Do I something wrong or is it an Agar bug please ?

Here is the code :

/* Public domain */
/*
* This application demonstrates the use of the AG_Scrollview(3) widget.
*/#include<agar/core.h>#include<agar/gui.h>AG_Scrollview 
*sv;voidexecuteAction(AG_Event *event);intmain(
{
AG_Window *win;
AG_Box *hBox;
fprintf(stderr, 
}
printf(
AG_SetBool(agConfig, 
guiFlags |= AG_VIDEO_OPENGL;
} 
printf(
AG_SetBool(agConfig, 
}
}
fprintf(stderr, 
}
AG_BindGlobalKey(SDLK_ESCAPE, KMOD_NONE, AG_Quit);
AG_BindGlobalKey(SDLK_F8, KMOD_NONE, AG_ViewCapture);
win = AG_WindowNew(0);
AG_ButtonNew(win, 0, 
sv = AG_ScrollviewNew(win, 0);
AG_Expand(sv);
AG_ButtonNewFn(win, 0, 
AG_WindowSetGeometryAlignedPct(win, AG_WINDOW_MC, 50, 50);
AG_WindowShow(win);
AG_EventLoop();
AG_Destroy();
}intargc, char*argv[])intguiFlags = AG_VIDEO_RESIZABLE;intx, 
y;if(AG_InitCore("agar-scrollview-demo", 0) == -1) {"%s\n", 
AG_GetError());return(1);if(argc > 1) {if(strcmp(argv[1], "-g") == 0) {"Forcing 
GL mode\n");"view.opengl", 1);elseif(strcmp(argv[1], "-G") == 0) {"Forcing FB 
mode\n");"view.opengl", 0);if(AG_InitVideo(640, 480, 32, guiFlags) == -1) 
{"%s\n", AG_GetError());return(1);"Foo");"Ajouter", executeAction, 
"");return(0);void
{
AG_ObjectFreeChildren(sv);
AG_WidgetUpdate(sv);
}
 executeAction(AG_Event *event)


      
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to