English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 30 January 2024, 12:33   #41
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Nightfox View Post
texteditor.gadget is a big one. It's not even fully implemented in its AmigaOS 3.2 form. Some features in the autodocs I dont think are even implemented yet like for example it says you can use escape sequences to change the pen but I can't get that to work at all

I dont think regular gadtools has anything super cool like layout.gadget either
Problematic indeed. This is still possible to do by hand and is much less work than doing whole own GUI library, but...

Do you know which gadget causes the issue ? You may want to remove them all, then put them back one by one to find out.
meynaf is offline  
Old 30 January 2024, 12:39   #42
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,640
As Nightfox surmised, that feature is currently unimplemented in texteditor.gadget.
Minuous is offline  
Old 30 January 2024, 12:45   #43
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by Minuous View Post
Alas not, see screenshot...
Exactly, I mean about kick 3.X (handmade, perhaps with Remus). Which was identical to kick 3.9 (again handmade kick) plus some fixes (?) from Aminet. Except some hand edited texts in exec.library. For system files You can have what You want, this is not important, You can copy files from OS 3.9 if You need. If any system files crashes then program can check for version of these files. Or patch loaded system file.
Don_Adan is offline  
Old 30 January 2024, 13:56   #44
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
Quote:
Originally Posted by Don_Adan View Post
Then perhaps can be trashing memory problem. You can alloc more memory that is necessary for work.
f.e alloc 2MB fast, if You need only 100KB.
Fill this memory with ID, f.e "WTWT" And save to file when quit from program.
Later look at this memory.
I went to every call of AllocVec() and allocated 10x than what was needed. Still the same crash unfortunately.

Also sorry but can you clarify what you mean by "Fill this memory with ID, f.e "WTWT" And save to file when quit from program." If this is a tool then I'd like to learn about it.
Nightfox is offline  
Old 30 January 2024, 13:58   #45
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
Quote:
Originally Posted by meynaf View Post
Problematic indeed. This is still possible to do by hand and is much less work than doing whole own GUI library, but...

Do you know which gadget causes the issue ? You may want to remove them all, then put them back one by one to find out.
I think it's a problem with clicktab.gadget and how it handles pages. I created a test tab with just a single button on the page that it loads up.. and crash
Nightfox is offline  
Old 30 January 2024, 14:00   #46
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
You can see in the screenshot attached. This tab is supposed to open just a page with a single button but when I click it, the system freezes and no button is shown before the freeze
Attached Thumbnails
Click image for larger version

Name:	image001.png
Views:	58
Size:	52.6 KB
ID:	81505  
Nightfox is offline  
Old 30 January 2024, 14:07   #47
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by Nightfox View Post
I think it's a problem with clicktab.gadget and how it handles pages. I created a test tab with just a single button on the page that it loads up.. and crash
OK, then this is not kick 3.X problem. But OS 3.X problem. This is different thing. Perhaps this is possible to overwrite clicktab.gadget with version from OS 3.9 and check effects.
Don_Adan is offline  
Old 30 January 2024, 14:20   #48
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
Here are some relevant parts of the code if anyone sees an error:

Code:
modeSelectionTabList = AllocVec(sizeof(struct List), MEMF_CLEAR);
	NewList(modeSelectionTabList);
	chatTabNode = AllocClickTabNode(TAG_DONE);
	SetClickTabNodeAttrs(chatTabNode,
	 TNA_Number, MODE_SELECTION_TAB_CHAT_ID,
	 TNA_Text, "Chat",
	 TNA_TextPen, isPublicScreen ? ObtainBestPen(screen->ViewPort.ColorMap, 0x00000000, 0x00000000, 0x00000000, OBP_Precision, PRECISION_GUI, TAG_DONE) : 1,
	 #ifdef __AMIGAOS4__
	 TNA_HintInfo, "Have a text conversation with ChatGPT",
	 #endif
	  TAG_DONE);
	imageGenerationTabNode = AllocClickTabNode(TAG_DONE);
	SetClickTabNodeAttrs(imageGenerationTabNode,
	 TNA_Number, MODE_SELECTION_TAB_IMAGE_GENERATION_ID,
	 TNA_Text, "Image Generation",
	 TNA_TextPen, isPublicScreen ? ObtainBestPen(screen->ViewPort.ColorMap, 0x00000000, 0x00000000, 0x00000000, OBP_Precision, PRECISION_GUI, TAG_DONE) : 1,
	 #ifdef __AMIGAOS4__
	 TNA_HintInfo, "Generate an image from a text prompt",
	 #endif
	  TAG_DONE);
	AddTail(modeSelectionTabList, chatTabNode);	
	AddTail(modeSelectionTabList, imageGenerationTabNode);
Code:
if ((chatModeLayout = NewObject(LAYOUT_GetClass(), NULL,
		LAYOUT_Orientation, LAYOUT_ORIENT_HORIZ,
		LAYOUT_SpaceInner, TRUE,
		LAYOUT_SpaceOuter, TRUE,
		LAYOUT_AddChild, conversationsLayout,
		CHILD_WeightedWidth, 30,
		LAYOUT_AddChild, chatTextBoxesLayout,
		CHILD_WeightedWidth, 70,
		TAG_DONE)) == NULL) {
			printf("Could not create main layout\n");
			return RETURN_ERROR;
	}

	if ((imageGenerationInputLayout = NewObject(LAYOUT_GetClass(), NULL,
		LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
		LAYOUT_SpaceInner, TRUE,
		LAYOUT_SpaceOuter, TRUE,
		LAYOUT_AddChild, openSmallImageButton,
		CHILD_WeightedHeight, 10,
		LAYOUT_AddChild, openMediumImageButton,
		CHILD_WeightedHeight, 10,
		LAYOUT_AddChild, openLargeImageButton,
		CHILD_WeightedHeight, 10,
		LAYOUT_AddChild, openOriginalImageButton,
		CHILD_WeightedHeight, 10,
		LAYOUT_AddChild, saveCopyButton,
		CHILD_WeightedHeight, 10,
		LAYOUT_AddChild, textInputTextEditor,
		CHILD_WeightedHeight, 40,
		CHILD_NoDispose, TRUE,
		LAYOUT_AddChild, createImageButton,
		CHILD_WeightedHeight, 10,
		TAG_DONE)) == NULL) {
			printf("Could not create image generation input layout\n");
			return RETURN_ERROR;
	}

	if ((imageGenerationTextBoxesLayout = NewObject(LAYOUT_GetClass(), NULL,
		LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
		LAYOUT_SpaceInner, TRUE,
		LAYOUT_SpaceOuter, TRUE,
		LAYOUT_AddChild, imageGenerationInputLayout,
		CHILD_WeightedHeight, 90,
		LAYOUT_AddChild, statusBar,
		CHILD_WeightedHeight, 10,
		CHILD_NoDispose, TRUE,
		TAG_DONE)) == NULL) {
			printf("Could not create chat layout\n");
			return RETURN_ERROR;
	}

	if ((imageGenerationModeLayout = NewObject(LAYOUT_GetClass(), NULL,
		LAYOUT_Orientation, LAYOUT_ORIENT_HORIZ,
		LAYOUT_SpaceInner, TRUE,
		LAYOUT_SpaceOuter, TRUE,
		LAYOUT_AddChild, imageHistoryButtonsLayout,
		CHILD_WeightedWidth, 30,
		LAYOUT_AddChild, imageGenerationTextBoxesLayout,
		CHILD_WeightedWidth, 70,
		TAG_DONE)) == NULL) {
			printf("Could not create image generation layout\n");
			return RETURN_ERROR;
	}

	if ((modeClickTab = NewObject(CLICKTAB_GetClass(), NULL,
		GA_ID, CLICKTAB_MODE_SELECTION_ID,
		GA_RelVerify, TRUE,
		CLICKTAB_Labels, modeSelectionTabList,
		CLICKTAB_AutoFit, TRUE,
		CLICKTAB_PageGroup, NewObject(PAGE_GetClass(), NULL,
            PAGE_Add,       chatModeLayout,
            PAGE_Add,       imageGenerationModeLayout,
        TAG_DONE),
		TAG_DONE)) == NULL) {
			printf("Could not create mode click tab\n");
			return RETURN_ERROR;
	}

	if ((mainLayout = NewObject(LAYOUT_GetClass(), NULL,
		LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
		LAYOUT_DeferLayout, TRUE,
		LAYOUT_SpaceInner, TRUE,
		LAYOUT_SpaceOuter, TRUE,
		LAYOUT_AddChild, modeClickTab,
		TAG_DONE)) == NULL) {
			printf("Could not create main layout\n");
			return RETURN_ERROR;
	}

	idcmpHookMainWindow.h_Entry = (HOOKFUNC)processIDCMPMainWindow;
	idcmpHookMainWindow.h_Data = NULL;
	idcmpHookMainWindow.h_SubEntry = NULL;

	idcmpHookCreateImageWindow.h_Entry = (HOOKFUNC)processIDCMPCreateImageWindow;
	idcmpHookCreateImageWindow.h_Data = NULL;
	idcmpHookCreateImageWindow.h_SubEntry = NULL;

	appPort = CreateMsgPort();

	#ifdef __AMIGAOS4__
	refreshOpenAIMenuItems();
	#endif

	if ((mainWindowObject = NewObject(WINDOW_GetClass(), NULL,
		WINDOW_Position, WPOS_CENTERSCREEN,
		WA_Activate, TRUE,
		WA_Title, "AmigaGPT",
		WA_Width, (WORD)(screen->Width * 0.8),
		WA_Height, (WORD)(screen->Height * 0.8),
		WA_CloseGadget, TRUE,
		WA_DragBar, isPublicScreen,
		WA_SizeGadget, isPublicScreen,
		WA_DepthGadget, isPublicScreen,
		WA_NewLookMenus, TRUE,
		WINDOW_AppPort, appPort,
		WINDOW_IconifyGadget, isPublicScreen,
		WINDOW_Layout, mainLayout,
		WINDOW_SharedPort, NULL,
		WINDOW_Position, isPublicScreen ? WPOS_CENTERSCREEN : WPOS_FULLSCREEN,
		WINDOW_NewMenu, amigaGPTMenu,
		WINDOW_IDCMPHook, &idcmpHookMainWindow,
		WINDOW_InterpretIDCMPHook, TRUE,
		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE,
		WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_GADGETUP | IDCMP_GADGETDOWN | IDCMP_MENUPICK | IDCMP_RAWKEY,
		WA_CustomScreen, screen,
		TAG_DONE)) == NULL) {
			printf("Could not create mainWindow object\n");
			return RETURN_ERROR;
	}

	if ((mainWindow = (struct Window *)DoMethod(mainWindowObject, WM_OPEN, NULL)) == NULL) {
		printf("Could not open mainWindow\n");
		return RETURN_ERROR;
	}
Nightfox is offline  
Old 31 January 2024, 09:46   #49
Olaf Barthel
Registered User
 
Join Date: Aug 2010
Location: Germany
Posts: 532
Quote:
Originally Posted by Nightfox View Post
Here are some relevant parts of the code if anyone sees an error:
The error, or rather the combined collection of errors, is likely found in the ClassAct and ReAction classes which you intend to make good use of.

We spent years (wish I was kidding, wish I hadn't been knuckle-deep in code that nobody seemed to have had enough love for) fixing bugs in the ReAction classes which shipped with AmigaOS 3.2, etc. just so that the handful of programs which made use of them did not crash or stumble into a cascade of undefined behaviour for no apparent reason.

You may get lucky with AmigaOS 3.2, etc. but you may need more than luck, perhaps providence, to run the same code on AmigaOS 68k and AmigaOS 4 and not have it let you down because the ReAction class foundations are not as robust as they may appear to be. The further back you go from ReAction in the direction of ClassAct, the less robust these foundations will become.

Please take the advice given by Minuous, who is one of the AmigaOS 3.2 developers and whose work on the ReAction classes was essential in getting them into a sufficiently stable state. Your code might work with AmigaOS 3.2 and AmigaOS 4: check the class library version numbers and reject those versions which are older than what shipped with AmigaOS 3.2 and AmigaOS 4. If you want your program to be stable, you will likely have to pick and choose which class libraries you can safely use. It is that bad
Olaf Barthel is offline  
Old 31 January 2024, 10:21   #50
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,640
Olaf is right; I would just add that the OS3.9+BB2 version of ReAction is mostly OK too (though inferior to 3.2 of course), H&P fixed a lot of bugs. It's just the earlier ones than that (eg. the ones in "AmigaOS 3.X") that are really problematic.
Minuous is offline  
Old 31 January 2024, 12:11   #51
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
I tried adding the 3.2 clicktab.gadget to the 3.X environment as an experiment and it crashes immediately. I'm guessing it needs a newer ROM to work.

I've given up on this. I'm going to instead detect if the user is on 3.X and display a popup letting the user choose which mode to run in. If they want to switch modes they won't have a clicktab for it so they will just have to quit and select the other mode
Nightfox is offline  
Old 31 January 2024, 14:19   #52
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
You tried wrong attempt. OS 3.X is OS3.9 clone/copy, not OS 3.2. Then You can try using clicktab.gadget from OS 3.9, not from OS 3.2. But if this is real bug in old ReAction code and simple copy file(s) from OS 3.9 to OS 3.X does not help/work.
Then You can use:
1. different method for handling OS 3.X buggy gadgets.
2. Search net (Aminet mostly) if fixed version of ReAction buggy gadget(s) are already available
3. Ask Cloanto to fix buggy gadgets in OS 3.X
4. Ask good coder from EAB to find and fix buggy gadget(s) and realease this later as Spatch version for Aminet.
Don_Adan is offline  
Old 31 January 2024, 16:07   #53
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
Just released a new version of AmigaGPT which removes the clicktab if it's 3.X and will instead just let the user select a mode at startup.

Moral of the story: Dont spend too much time getting things to work for 3.X. Instead just give those users a dirty workaround.
Nightfox is offline  
Old 31 January 2024, 17:43   #54
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by Nightfox View Post
Just released a new version of AmigaGPT which removes the clicktab if it's 3.X and will instead just let the user select a mode at startup.

Moral of the story: Dont spend too much time getting things to work for 3.X. Instead just give those users a dirty workaround.
Yes, but check library version is better/cleaner solution for me. OS 3.X user can have installed newest version of necessary files from OS 3.9.
Don_Adan is offline  
Old 31 January 2024, 22:39   #55
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 386
Quote:
Originally Posted by Don_Adan View Post
Yes, but check library version is better/cleaner solution for me. OS 3.X user can have installed newest version of necessary files from OS 3.9.
That’s what I did do actually. It checks if the version of clicktab.gadget > 44
Nightfox is offline  
Old 31 January 2024, 22:49   #56
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Very good. I understood wrong, sorry.
Don_Adan is offline  
Old 05 April 2024, 01:49   #57
Nonefornow
Registered User
 
Join Date: Mar 2022
Location: Westlake Village CA
Posts: 11
Quote:
This means that a "Libs/workbench.library" file must be present on the boot disk, as detailed below."
https://www.amigaforever.com/kb/16-125
I wanted to follow up on this. I read that page and saw that the referred library can then be downloaded from here https://www.amigaforever.com/classic/download/

Now checking into the Install 3.1 diskette I can see that library is not there, but there is no space in the diskette to save a copy of it.

Does anyone have any suggestion on how to resolve this? Or what files can then be removed from the install diskette? Because are included in the 3.X ROM?
Nonefornow is offline  
Old 05 April 2024, 02:07   #58
Snoopy1234
Registered User
 
Snoopy1234's Avatar
 
Join Date: Apr 2022
Location: Australia
Age: 52
Posts: 844
Quote:
Originally Posted by Nonefornow View Post
I wanted to follow up on this. I read that page and saw that the referred library can then be downloaded from here https://www.amigaforever.com/classic/download/

Now checking into the Install 3.1 diskette I can see that library is not there, but there is no space in the diskette to save a copy of it.

Does anyone have any suggestion on how to resolve this? Or what files can then be removed from the install diskette? Because are included in the 3.X ROM?
The 3.X workbench.library could be added to any disk in the WB set that has space, eg storage. The Install disk Install script would need to be edited to include the file/location. The Install disk itself doesn't have Workbench files on it iirc.
Snoopy1234 is offline  
Old 05 April 2024, 16:36   #59
Nonefornow
Registered User
 
Join Date: Mar 2022
Location: Westlake Village CA
Posts: 11
Quote:
Originally Posted by Snoopy1234 View Post
The 3.X workbench.library could be added to any disk in the WB set that has space, eg storage.
Indeed. However in the OS 3.1 set of disks, both the Install and Workbench disks are supposed to be bootable. If the workbench.library file is not in there, and you have kickstart 3.x, the disk will boot with no icons on the workbench.
Nonefornow is offline  
Old 05 April 2024, 20:58   #60
No.3
Registered User
 
Join Date: Sep 2022
Location: Switzerland
Posts: 115
Quote:
Originally Posted by Nightfox View Post
You can see in the screenshot attached. This tab is supposed to open just a page with a single button but when I click it, the system freezes and no button is shown before the freeze
What does Enforcer say?
No.3 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you like or dislike Cloanto/Amiga Forever? MarioMario456 Amiga scene 206 22 May 2019 15:28
Cloanto's Amiga Forever Emu Amiga project.ClassicWB 9 22 June 2012 12:57
Cloanto and Amiga Forever alexh Amiga scene 13 01 October 2006 12:09
clock in cloanto amiga forever... zACK! support.WinUAE 2 08 April 2006 20:36
Save State on Cloanto Amiga Forever 3.0 NeutralizeR New to Emulation or Amiga scene 7 14 November 2002 14:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:26.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11679 seconds with 16 queries