ToolBox questions
Andrew McCarthy (3688) 605 posts |
I’m curious about the ToolBox, I know that it’s distributed with the DDE, and you can also download the individual tools from Packman. Knowing that leads me to ask. Where are the ToolBox C library files, outside of the DDE, located? I don’t see them in PackMan. Are they on GitLab somewhere? I know about OSLib, but I wonder if making the C library files generally available from Packman, might increase the usage of the ToolBox. |
Dave Higton (1515) 3534 posts |
Not sure why you’re asking about them “outside of the DDE” because they are in the APCS-32.Lib.tboxlibs directory, and are only really useful in conjunction with the DDE. I’m a recent convert to the Toolbox – my most recent 2 apps are built with it. |
Jean-Michel BRUCK (3009) 362 posts |
The ToolBox is the right way to build applications. ToolBox is also available on the ROOL website |
Paolo Fabio Zaino (28) 1882 posts |
Toolbox is a module with a set of SWIs and Services, it’s present and available on all RISC OS versions (except the oldest ones). The C Libraries as you call them, are just wrappers to those SWIs, so you can also use ToolBox directly with the way SWI can be accessed as we shown multiple times on different videos on the ROCOG youtube channel (and there are many topics here as well on the matter). Tools to help creating resources for the toolbox are also freely available from ROOL, no need to buy a DDE license for !ResCreate, !ResTest and !resEd (if these are of need here). Or, you can access them through a wrapper like OSLib. OSLib is available already for both DDE and GCC, it’s documented and already freely available in both pre-built and source format. Hope this helps, |
Andrew McCarthy (3688) 605 posts |
The ToolBox C library files are not currently available outside of the DDE. They are not on GitLab or any other public repository. There are a few reasons for this. First, the ToolBox is a proprietary library, and the developers may not want to make it available to the general public. Second, the ToolBox is a complex library, and it may be difficult to use without the documentation and support that is provided with the DDE. It is possible that making the C library files generally available from Packman would increase the usage of the ToolBox. However, it is also possible that it would lead to problems, such as people using the library incorrectly or without understanding the licensing terms. Ultimately, the decision of whether or not to make the C library files available from Packman is up to the developers of the ToolBox. If they decide to do so, they will need to carefully consider the potential risks and benefits. Here are some additional thoughts on the matter: The ToolBox is a powerful library, but it can be difficult to use. Making the C library files available from Packman would make it easier for people to use the library, but it could also lead to more people using it incorrectly. The ToolBox is a proprietary library, and the developers may not want to make it available to the general public. However, if they do decide to make it available, they could charge a fee for the library. If the ToolBox C library files were made available from Packman, they would need to be accompanied by documentation and support. This would help to ensure that people use the library correctly and that they are aware of the licensing terms.Overall, there are both pros and cons to making the ToolBox C library files available from Packman. The decision of whether or not to do so is up to the developers of the ToolBox. EDIT: The text above is generated by an AI. ;) Thanks for the replies. As I’m in a queue waiting, I thought I’d ask an AI, and the answer was not bad. |
Chris Gransden (337) 1207 posts |
What about the one in the RISC OS rom build. |
Andrew McCarthy (3688) 605 posts |
Thanks, Chris. Did you mean this lot? https://gitlab.riscosopen.org/RiscOS/Sources/Toolbox |
Paolo Fabio Zaino (28) 1882 posts |
???? https://gitlab.riscosopen.org/rool/ToolboxLib https://gitlab.riscosopen.org/RiscOS/Sources/Toolbox/Toolbox https://gitlab.riscosopen.org/RiscOS/Sources/Toolbox/ToolboxDocs
Have you checked OSLib oslib.h ? There is a file called toolbox, that is a C wrapper that allows you to access ToolBox in DDE and GCC usign OSLIb an dnot having to use the SWIs directly.
Looks like your AI needs re-training :) |
David Gee (1833) 268 posts |
Is there any good tutorial material on the Toolbox? The only RISC OS tutorial material I’m aware of as far as C is concerned is Steve Fryatt’s pages, but they don’t cover the toolbox. The non-toolbox way of doing things is not dissimilar to Windows API programming, apart from the (to me) unusual terminology like “icons” for “controls” (or “widgets” — no other system calls such things icons) and the absence of Hungarian notation, which does at least mean you don’t need to type things like "lpcszProgName"… lpcsz = long pointer to a zero terminated character string |
Dave Higton (1515) 3534 posts |
The DDE ships with some examples, but whether that counts as good is a matter of opinion. I’m sure it must help to go through the early chapters of the Toolbox manual. As a one-word response (like OFSTED’s one-word reports on schools), my answer would have to be “No”. I was lucky to have a one-on-one tutorial session from Steve Potts last year at a RONWUG meeting, which is what eventually set me on my way. Like many things in programming (and engineering in general), you will understand it if you start from the beginning and persist despite the failures. Persistence is a very important attribute. |
Paolo Fabio Zaino (28) 1882 posts |
Sadly Dave is right, there isn’t a good tutorial, we keep seeing people getting in troubles with the ToolBox, which probably also means it’s not as intuitive as it should have been. But, we are preparing a set of short videos, to learn how to use it. The only “show-stop” I have at the moment is virtualy 0 time available for RISC OS activities, so, if no one wants to help me then it’ll have to wait until I have some time. If you are familiar with event based programming, the API is not that complicated, it’s just a little weird (I guess the word here would be “quirky” maybe) compared to other (more popular) event based programming frameworks. In any case, here are some links to some freely available documentation about it: http://www.riscos.com/support/developers/toolbox/toolintro.html http://www.riscos.com/support/developers/riscos6/toolbox/index.html StrongHelp manual release 131) available here for download: http://www.riscos.info/downloads/stronghelp/manuals/toolbox131.zip And links to all the sources above, I shared them on my previous comment. Here is a bit of help: If you need to understand the basic structs used to represent the Object Class, have a look at the h.toolbox in the tBoxLib in DDE, those structs help a bit to understand how the “objects” work. If instead you don’t have DDE have a look at the structs in OSLib: oslib.h.toolbox Take the “English language” used in the documentation with a pinch of salt, the ToolBox is NOT actually a set of C++ classes (and so, proper Objects, aka using RAII etc.), it’s actually written in C, so the classes are basically a set of method-less structus (with no dynamic memory management) that hold the state of an object and there are a set of SWIs you can use to interact with the ToolBox as a client passing/receiving the state structs. If you (like me) prefer C++, then there is the excellent Alan’s TBX Library (which has nothing to do with DDE and that is only for GNU GCC C++), it comes with documentation and code examples, it’s really well documented and made, probably the best available approach (all round) to use the ToolBox and the best documentated one too. Hope this helps, |
Robert Hampton (1923) 57 posts |
When I was experimenting with the Toolbox a long time ago, I found this Hints & Tips page from Rosemary Miskin quite useful. https://miskin.orpheusweb.co.uk/toolbox/hints.html . Examples are in BASIC, but they show the essentials of how a simple Toolbox app is built. Using this, in conjunction with StrongHelp and the Acorn Toolbox manual (which I had in PDF form on the PRM CD produced by RISCOS Ltd), I was able to muddle through. For C, OSLib has comprehensive coverage of the Toolbox APIs so is probably the way to go for anyone using GCC. I’m not sure how useful the DDE toolbox library would be without the DDE compiler. |
Jean-Michel BRUCK (3009) 362 posts |
@Paolo |
Paolo Fabio Zaino (28) 1882 posts |
@ Jean
This is an excellent idea! :) Let me know if you manage, otherwise I’ll put it in the to-do list for the videos, meanwhile good luck! @ Robert Nice source for BBC BASIC! Thx |
GavinWraith (26) 1563 posts |
Without a copy of Acorn’s User Interface Toolbox manual, it is impossible to use the toolbox, and I found it difficult with it. Joe Taylor spent years on developing and polishing AppBasic. So looking at the innards of AppBasic can be a big help. |
Chris Johnson (125) 825 posts |
I think you probably mean Chris Johns, rather than me. I wouldn’t like to take credit where it is not warrented 8) As far as the toolbox goes, I first used the toolbox from Basic, using my own library of wrappers for the SWIs. It worked very well. Once I was using C as my main programming language, then I used OSLib for the wrappers. OSLibSupport is also very useful, because it provides e.g. an event library, which means your apps can be easily event driven. I now find I have to concentrate when working with the likes of Snapper and DPScan, since they still use Templates and David Pillings own TaskLib for control. I think the toolbox makes things easier once you get in to the correct mindset. |
Chris Johns (8262) 242 posts |
They went from a simple “hello world” applcation to a hypertext card viewer IIRC, with little in between. |
Jean-Michel BRUCK (3009) 362 posts |
@Chris Johns & Johnson |