English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 02 November 2023, 20:51   #1
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,368
WorkbenchControlA() - Issue getting selected icons information with just .info files

I'm using WorkbenchControlA() to gather information on the selected icons in Workbench using the WBCTRLA_GetSelectedIconList tag. It works perfectly for standard files whether they have a .info file associated with them or not, but it seems to completely fail if any of the icons selected don't have an associated file. When this is the case, WorkbenchControlA() returns false, and so even if some of the selected icons have associated files, they can't be listed until the file-less icon is found and deselected. The Autodocs say that Dos/IOErr() can be used to query the failure but IOErr() doesn't give any error code (returns 0).

This happens in both 3.9 and 3.2... Is it intended behaviour? Or is it an oversight? Or am I missing something? Sometimes .info files are used without associated files as launching icons for example, and it means my code can't be used whenever such a file is involved.

Interestingly, using ARexx to list the selected icons has no problem gathering the file-less icons, but it's much slower than using workbench.library directly.
Daedalus is offline  
Old 17 November 2023, 15:52   #2
Olaf Barthel
Registered User
 
Join Date: Aug 2010
Location: Germany
Posts: 532
Quote:
Originally Posted by Daedalus View Post
I'm using WorkbenchControlA() to gather information on the selected icons in Workbench using the WBCTRLA_GetSelectedIconList tag. It works perfectly for standard files whether they have a .info file associated with them or not, but it seems to completely fail if any of the icons selected don't have an associated file. When this is the case, WorkbenchControlA() returns false, and so even if some of the selected icons have associated files, they can't be listed until the file-less icon is found and deselected. The Autodocs say that Dos/IOErr() can be used to query the failure but IOErr() doesn't give any error code (returns 0).

This happens in both 3.9 and 3.2... Is it intended behaviour?
Um, sorry for the late answer: this is a mix between a feature and a bug.

The 'C' API produces only those entries for which there is a file, drawer or link present which also happens to be associated with an icon. You might say that having an associated icon is the primary criterion for each list member.
Olaf Barthel is offline  
Old 22 November 2023, 10:07   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,368
Thanks for the reply. Fair enough, it seems to severely limit the usefulness of the function in that case, especially since having an icon without an associated file appears to be treated as an error condition, so even the "valid" selected files aren't listed. I've worked around it by using ARexx whenever the call fails, but that's of course much slower when you have a large number of files involved.
Daedalus 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
AGNUS information files needed aeberbach support.Hardware 4 03 July 2020 09:45
Weid colours for some icons or when holding an icon selected tygre support.Other 7 05 September 2015 20:39
Keep selected ADF files on Quickstart page thomas request.UAE Wishlist 1 18 October 2013 15:47
info on creating info files icons ? Dimlow New to Emulation or Amiga scene 10 16 July 2008 19:28
.info files Aljrob support.WinUAE 5 14 March 2007 15:42

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 05:43.

Top

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