Topic options
View mode
Newest First
Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 0:08
#1
Home away from home
Joined: 2006/11/20 16:26Last Login
: Today 3:03
From Norway
Group:
Registered Users
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
#include <intuition/gadgetclass.h>
#include <proto/gadtools.h>
struct Screen * src ;
void GT_configure ( struct NewGadget * ng , int id , int x , int y , int w , int h )
{
bzero ( ng , sizeof ( struct NewGadget ));
ng -> ng_LeftEdge = x ;
ng -> ng_TopEdge = y ;
ng -> ng_Width = w ;
ng -> ng_Height = h ;
ng -> ng_GadgetID = id ;
ng -> ng_VisualInfo = GetVisualInfo ( src , TAG_DONE );
ng -> ng_TextAttr = 0 ;
ng -> ng_Flags = 0 ;
}
int main ()
{
struct NewGadget ng ;
struct Window * win ;
void * head = NULL ;
void * next = NULL ;
src = LockPubScreen ( NULL );
win = OpenWindowTags ( NULL ,
WA_Title , NULL ,
WA_Left , 0 ,
WA_Top , 0 ,
WA_Width , 200 ,
WA_Height , 200 ,
WA_Flags , 0 ,
WA_IDCMP ,
IDCMP_MOUSEMOVE | IDCMP_CLOSEWINDOW | IDCMP_MOUSEBUTTONS |
IDCMP_GADGETUP | IDCMP_GADGETDOWN ,
TAG_END );
GT_configure ( & ng , 2000 , 1 , 1 , 20 , 200 );
next = CreateContext ( ( void *) & head );
next = CreateGadget ( SCROLLER_KIND , next , & ng ,
GTSC_Top , 0 ,
GTSC_Total , 1070 ,
GTSC_Visible , 1020 ,
GTSC_Arrows , 13 ,
GACT_IMMEDIATE , TRUE ,
GACT_RELVERIFY , TRUE ,
PGA_Freedom , 0 ,
TAG_DONE );
CloseWindow ( win );
UnlockPubScreen ( NULL , src );
}
Edited by LiveForIt on 2011/12/12 16:11:27
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Re: Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 0:41
#2
Supreme Council
Joined: 2006/11/19 18:16Last Login
: Yesterday 9:46
From London, England
Group:
Webmasters Registered Users
I'm guessing it's the call to GetVisualInfo() with an uninitialised pointer. You dont assign "scr" to a valid screen pointer until afterwards. Simon
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such.
----
http://codebench.co.uk
Re: Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 1:59
#3
Home away from home
Joined: 2006/11/20 16:26Last Login
: Today 3:03
From Norway
Group:
Registered Users
Thats not it, src is set before GetVisualInfo(), read the code again. if I replace next = CreateGadget(SCROLLER_KIND, next, &ng, ... whit next = CreateGadget(BUTTON_KIND, next, &ng,TAG_DONE); Then every thing works.
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Re: Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 5:41
#4
Quite a regular
Joined: 2006/12/2 0:35Last Login
: 1/19 10:37
From Sydney
Group:
Registered Users
@LiveForIt:
Quote:
That's not the best way to reply when someone offers help. He's unlikely to bother again.
You didn't say where it crashed. That might help.
cheers tony
Re: Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 8:58
#5
Just can't stay away
Joined: 2006/11/30 11:30Last Login
: 11/18 16:17
From Finland
Group:
Registered Users
@LiveForIt
Quote:
GACT_IMMEDIATE, TRUE, GACT_RELVERIFY, TRUE,This part should be:
GA_Immediate, TRUE,
GA_RelVerify, TRUE,
GA_Immediate and GA_RelVerify are tags, GACT_IMMEDIATE and GACT_RELVERIFY are flags used for the Activation field of struct Gadget.
Re: Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 11:52
#6
Home away from home
Joined: 2006/11/20 16:26Last Login
: Today 3:03
From Norway
Group:
Registered Users
@tonyw Excuse me if I sounded rude, not my intention.
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Re: Gadtools crash whit DSI error, what's up.
Posted on:
2011/12/12 11:59
#7
Home away from home
Joined: 2006/11/20 16:26Last Login
: Today 3:03
From Norway
Group:
Registered Users
@salass00 Thanks worked perfectly.
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Currently Active Users Viewing This Thread:
1
(
0 members
and 1 Anonymous Users
)