Welcome, Guest. Please login or register.

Author Topic: Coding: I would like to be able to "Leave Out" or "Put Away" icons programmatically  (Read 2029 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Does anybody know much about the mechanism behind leaving and icon on the workbench and putting one away? I'd like to programmatically do this technique from within an application but I don't know where to look for APIs or information about the mechanism behind this functionality.

Also, is it possible to add an icon that doesn't represent something on the filesystem. It seems like it should be possible given things like Iconify seem to work similarly. Any info on this would also be appreciated.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline Christian Johansson

  • Full Member
  • ***
  • Join Date: Nov 2004
  • Posts: 247
    • Show only replies by Christian Johansson
im not a programmer but its saved in the .backdrop file saved in root of the partition iirc. So you just need to edit that file.
 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show only replies by Daedalus
    • http://www.robthenerd.com
Quote from: nyteschayde;674906
Does anybody know much about the mechanism behind leaving and icon on the workbench and putting one away? I'd like to programmatically do this technique from within an application but I don't know where to look for APIs or information about the mechanism behind this functionality.


I can't remember 100% off-hand (I'll check when I get home) but I think from 3.5 up you can carry this function out using ARexx commands. Might be the simplest way to do it - issue an "RX ADDRESS 'WORKBENCH' " from your application.

Quote
Also, is it possible to add an icon that doesn't represent something on the filesystem. It seems like it should be possible given things like Iconify seem to work similarly. Any info on this would also be appreciated.


This is called an "App Icon" and it's how YAM puts an icon on the desktop showing the status of your mailbox, PPaint lets you load files by dragging and dropping onto its app icon, and so on. I'm sure there's something in the SDK documents about setting up an app icon. It basically triggers an event which your application then acts upon as you desire.
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Thanks. Let me know what you can. It would be nice to do this without having another dependency like ARexx but worse come to worst I can do that. I modified the .backdrop file but changes didn't take effect so I assume there is something I need to do to make the system recognize the changes. Reset WB didn't do it (what is that good for anyway?!)


Quote from: Daedalus;674911
I can't remember 100% off-hand (I'll check when I get home) but I think from 3.5 up you can carry this function out using ARexx commands. Might be the simplest way to do it - issue an "RX ADDRESS 'WORKBENCH' " from your application.



This is called an "App Icon" and it's how YAM puts an icon on the desktop showing the status of your mailbox, PPaint lets you load files by dragging and dropping onto its app icon, and so on. I'm sure there's something in the SDK documents about setting up an app icon. It basically triggers an event which your application then acts upon as you desire.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline krashan

  • Sr. Member
  • ****
  • Join Date: Jan 2003
  • Posts: 253
  • Country: pl
  • Thanked: 1 times
  • Gender: Male
  • Hardware designer and programmer
    • Show only replies by krashan
    • Personal homepage
Quote from: nyteschayde;674912
Thanks. Let me know what you can. It would be nice to do this without having another dependency like ARexx but worse come to worst I can do that.


Icons can be added to Workbench with AddAppIcon() of workbench.library.

Offline Tension

Quote from: nyteschayde;674912
Reset WB didn't do it (what is that good for anyway?!)


Reset WB is a mysterious and powerful function.

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Quote from: nyteschayde;674912
Thanks. Let me know what you can. It would be nice to do this without having another dependency like ARexx but worse come to worst I can do that. I modified the .backdrop file but changes didn't take effect so I assume there is something I need to do to make the system recognize the changes. Reset WB didn't do it (what is that good for anyway?!)

It's possible to send an ARexx command to a program's ARexx port without "using" ARexx. The port is a standard Amiga Port and the message contents are a standard string (including numbers). The program may open ARexx itself to parse the command that is sent though.

Here is a guide with the Workbench Arexx interface (AmigaOS 3.5+)...

http://www.heywheel.com/matthey/Amiga/WBguide.lha

This guide should already be installed if you are using the unofficial AmigaOS 3.9 BoingBag 3 and up. If installed, you can use the help key at any time from Workbench to bring it up. You can also use the help key while in the menu to bring up help for a particular menu item. It's not very thorough with the help but the Workbench ARexx documentation is quite good. It looks like the icons you want to put away or leave out would have to be selected with the "ICON" command (or let the user do it) then the "MENU INVOKE ICONS.LEAVOUT" or "MENU INVOKE ICONS.PUTAWAY" command used to do the work. Using the "WORKBENCH" ARexx host is a lot better and more reliable than hacking it even if you send the command directly to this port without opening ARexx.
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Wow, that's great info. Perhaps I have been too biased with my slant on doing without dependencies. I'll look into it. The problem is that I am writing some CLI commands for use in very early startup (before Workbench is loaded) but would like to work even after it's come up.

Thanks for all that information. I'll see what I can drum up if my install of CubicIDE ever finishes.

Quote from: matthey;674927
It's possible to send an ARexx command to a program's ARexx port without "using" ARexx. The port is a standard Amiga Port and the message contents are a standard string (including numbers). The program may open ARexx itself to parse the command that is sent though.

Here is a guide with the Workbench Arexx interface (AmigaOS 3.5+)...

http://www.heywheel.com/matthey/Amiga/WBguide.lha

This guide should already be installed if you are using the unofficial AmigaOS 3.9 BoingBag 3 and up. If installed, you can use the help key at any time from Workbench to bring it up. You can also use the help key while in the menu to bring up help for a particular menu item. It's not very thorough with the help but the Workbench ARexx documentation is quite good. It looks like the icons you want to put away or leave out would have to be selected with the "ICON" command (or let the user do it) then the "MENU INVOKE ICONS.LEAVOUT" or "MENU INVOKE ICONS.PUTAWAY" command used to do the work. Using the "WORKBENCH" ARexx host is a lot better and more reliable than hacking it even if you send the command directly to this port without opening ARexx.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline kolla

Quote from: nyteschayde;674931
The problem is that I am writing some CLI commands for use in very early startup (before Workbench is loaded) but would like to work even after it's come up.


Well, you cannot tell Workbench to leave out icons when there is no Workbench around to listen. Sounds to me like you want to edit the :.backdrop files, these will be read by Workbench when it is launched.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline Tension

Quote from: Tension;674921
Reset WB is a mysterious and powerful function.


And it's mystery is exceded only by it's power.

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
So what you're saying is that what it does is undocumented and has no immediately visible effect. Mysterious and powerful indeed.

Quote from: Tension;674945
And it's mystery is exceded only by it's power.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Quote from: nyteschayde;674954
So what you're saying is that what it does is undocumented and has no immediately visible effect. Mysterious and powerful indeed.


Nah, it's in my WB guide ;). ResetWB closes and reopens all Workbench windows. It's even more useful than "Redraw all" 8).