Two more wimp programming questions
|
When waltzing around in my c code like a gerbil on too much sugar, I’ve come across two more things that I can’t quite wrap my head around: 1. In research for the program I’m working on, I came across 2. My icon bar menu feels a bit crowded, and many applications solve this by adding a divider. Is this some sort of sprite icon that you add as a menu entry (in the terminology of Steve Fryatt’s tutorial 1, not sure if they’re officially called entries) or how is it supposed to be done? 0: https://www.riscosopen.org/wiki/documentation/show/Message_WindowInfo |
|
I’ve no idea how to do it in C, but generally, to put a line under a menu item, you set bit 1 of the item flags for that menu entry. |
|
When investigating this many (many) yearrs ago, I came across this and have been using it ever since (in BASIC). PROCmake_menu("My Menu",window_update%!0-150,518,"Option1/Option2/______/OptionA/OptionB",") The row of _ characters gives an adequate divider. And just needs the corresponding mouse click procedure to ignore the menu option. Could use – characters or even just spaces I think |
|
I’d not (yet) covered this in the OSLib tutorial, as the menu chapters were already getting a little heavy going. It’s already pencilled in for a later chapter, when time permits. The short answer is that you set one of the
See this chapter for details of the menu structure. If you open your iconbar menu using a routine like the Which is, as Andrew says, setting bit 1 of the menu item flags – just with a little bit of sugar coating to make it clear what’s going on.
Please, no. Just follow the Style Guide – it’s not hard to do. 1 Or, indeed, using the comparable functions in libraries like SFLib, DeskLib and so on. If you’re calculating your iconbar menu height by hand in 2021, you’re doing it wrong. |
|
The types are To receive it, you listen out for Events 17 and 18 (that’s Once you’ve got the message, you can update the
where It’s late, and that’s all off the top of my head, so take it with a pinch of salt. |
|
If you’ve got one icon for any iconized window, then no messages are needed. Put a sprite called “ic_tailwimplite” in the sprites file that you *IconSprites, and the Pinboard will use that automatically. If you do want different icons for different windows, or want to try out the messages anyway,
I think you might be noticing here that the union in wimp_message doesn’t have a member of type wimp_message_window_info. Not all messages do. For these I cast the wimp message,
or
and then cast it back for the replying wimp_send_message(). |
|
I am amazed at how quick and how detailed help you get in this forum. Thanks everyone! I went with @Julie’s default-icon suggestion for the first issue, and adding separators worked fine as per @Steve’s suggestion. |
|
All right, another Wimp/OSLib question. Currently I’m capturing the Now for the problem – I don’t understand the
The Does anyone have experience with this part of the API? Perhaps this isn’t the right SWI for what I want to accomplish? |
|
The KeyInput API is part of RISC OS Select and is not in RISC OS 5 (yet). It is intended to supersede some of the OS_Byte calls, as detailed in the Select PRMs (Input.KeyVExtendedInput). If you use OS_Byte 121 it’s effectively INKEY from BASIC. I haven’t used DeepKeys before, but it does look like what you want. You’ll get your key press messages as before, but they’ll be longer containing detailed information on modifiers. |
|
Thanks! I’m glad I asked before getting too deep into attempting to use
Yes, wow. It looks like a more or less perfect match. I’d really prefer not to rely on non-free third party libraries though, so I think I’ll try to go the |
|
DeepKeys is a free utility. |
|
I didn’t find a license indicating this, and haven’t seen the source anywhere, so I assumed it was non-free (that is to say “proprietary”). I would be happy to be proven wrong, of course. |
|
If you do Twitter (not my thing) then Nemo is on there (check his web site for the specifics) |
|
I used to, but these days I only listen to the tweeting of actual birds. Much better! Anyway, it seems it is some sort of shareware or freeware: one is free to distribute the binary as long as the copyright notice is distributed with it, but not – as far as I can tell – to study the code or modify it`. That is nice to know, and might make it a viable plan B, but I’d prefer to get by on only free software if I can. |