28 July 2022, 00:16 | #1 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
Blitz/Amiblitz ScreenNotify Example?
I have had a look at the screennotify include and unfortunately for clueless OS retards like me, it has no example of how to use it correctly, does anyone know how to correctly use screennotify to detect when workbench is closing and then reopens?
|
28 July 2022, 10:01 | #2 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
It's not a library I've used, but the include is just a very thin wrapper around the actual library interface, so usage should be essentially the same as with C. The Screennotify archive includes autodocs and an example program, so it should just be a matter of porting that to Blitz.
|
30 October 2022, 15:50 | #3 |
Registered User
Join Date: Oct 2022
Location: Sverige
Posts: 4
|
ScreenNotify AmiBlitz code ?!
Hi,
I'm been trying to convert the c example from screennotify10 archive with no luck... I'm getting to the point where I read out 3, Workbench Then I should read out true or false ?! Any Pro that could help me out here ? XINCLUDE "screennotify.include.ab3" Port.l = CreateMsgPort("AB3_TemplateII.1") succ2.l = screennotify_AddWorkbenchClient{Port.l} snm.l = GetMsg_(Port) ; message ? If snm <> 0 Then snm_Type.l = GetMsg_(snm) ; get message NPrint snm If snm_Type = 3 ; workbench ? value = ????? if value = false CloseGUI{} NPrint "close" end if if value = true OpenGUI{} NPrint "open" end if ReplyMsg_(snm) End If Last edited by super; 30 October 2022 at 15:58. |
31 October 2022, 15:32 | #4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
I don't speak Basic too well. I just used this to find out how to work with pointers and structs in Basic: https://eab.abime.net/showpost.php?p...69&postcount=4
If I adopt it right it should be like this: Code:
*snm.ScreenNotifyMessage = GetMsg_(Port) if *snm type.l = Peek.l(*snm\snm_Type) value.l = Peek.l(*snm\snm_Value) if type = 3 if value = 0 CloseGUI{} NPrint "close" else OpenGUI{} NPrint "open" end if end if ReplyMsg_(*snm) end if |
31 October 2022, 21:33 | #5 | |
Registered User
Join Date: Oct 2022
Location: Sverige
Posts: 4
|
Quote:
*snm 1076732392 type 4194312 value 0 hmmmmm |
|
01 November 2022, 09:44 | #6 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
|
I guess you dont have to Peek.l() the values of the struct:
type.l = *snm\snm_Type will be enough. Do you know if the screennotify.library still works with AmigaOS 3.2 ? I tried to do a working example, but I do not get any messages when calling the menu item "Close Workbench". |
01 November 2022, 09:58 | #7 | |
Registered User
Join Date: Oct 2022
Location: Sverige
Posts: 4
|
Quote:
ReplyMsg_(*snm.ScreenNotifyMessage) and values 0 & 1 works as well Last edited by super; 01 November 2022 at 10:25. |
|
02 November 2022, 22:33 | #8 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
|
You dont have to add the datatype .ScreenNotifyMessage everytime just the first time to init it.
I do not get any message, how do you produce it? Just trying to close the Workbench? |
02 November 2022, 22:37 | #9 |
Registered User
Join Date: Oct 2022
Location: Sverige
Posts: 4
|
Change screen mode
|
03 November 2022, 08:58 | #10 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
|
Thanks!
That worked. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitz/Amiblitz - Simple way to detect if workbench screen is active/loaded? | DisasterIncarna | Coders. Blitz Basic | 2 | 31 October 2021 01:33 |
Blitz Basic / AmiBlitz on AmigaCoding.com | Daedalus | Coders. Blitz Basic | 8 | 08 January 2021 15:56 |
Screennotify.library ? | utukku | support.Other | 0 | 07 January 2021 14:44 |
Can amiblitz (blitz basic2) blit an image per bitplane? | Michael Parent | Coders. General | 7 | 29 October 2009 17:59 |
Blitz Basic 2.x (AmiBlitz, now?) in ADF format? | Unregistered | Amiga scene | 1 | 30 November 2001 10:46 |
|
|