Auto created Toolbox objects/components
Garry (87) 184 posts |
Right, I seem to be falling at the first hurdle here. I have created a UI in !ResED, I’ve gone with the whole auto-create thing, and the interface went together quickly and loads up just fine. However, I registered an event to a button like so:
And that calls my ‘gourlhandler’ function just fine: } So as I understand it, on clicking that button, id_block→this_obj will have the window object in it, and id_block→this_cmp will have the component ID in it. !ResTest would seem to back that up. However, on running, both those values appear to be the same pointer, and not valid. Maybe I’m doing something stupid here, but my event gets called just as I planned, but the information coming to it seems like garbage. Why would the object and the component have the same value? As always many thanks for the help… Cheers Garry |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ll have a look how I do that when I get home. |
Garry (87) 184 posts |
That would be great Malcolm, thanks. In fact the URL I am handling is one of my own creation, i.e. my own protocol, not http:, ftp: etc. so I need to handle it myself. My project is a network service, so I’m handling URLs myself. Cheers Garry |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve just started writing a socket handler, I’ve just started writing the module last night. SYS “QFA_Init”,socket,&handler_no,“news.bbc.co.uk”,“80” OR for http SYS “QFA_Init”,http,&handler_no,“news.bbc.co.uk”,“80”, “/rss/feed.xml”, “SDFS::Harddisc0.$.test.xml” The long term plan is to also include disc I/O and command processing as well as a network stack (imap/pop/dns/ssl/tls etc), but that is a long, long road! Initially it will be wget for RISC OS, I suppose. But designed for RISC OS rather than a “fudge port”. The main reason is my programs are all going to be network related and having to redo basic network handling each time is making the code unmaintainable, sticking it in a module makes it highly portable. |
Steve Revill (20) 1361 posts |
Via a pollword non-zero event? |
Malcolm Hussain-Gambles (1596) 811 posts |
er…Yeah ;-) |
Malcolm Hussain-Gambles (1596) 811 posts |
Well for me I’m using id_block→self_component to get the icon number (component) |
Rick Murray (539) 13840 posts |
Cool. I’m not the only one to mix and mash languages in pseudocode. |
Garry (87) 184 posts |
Hmm, OK, I’m going to have to have another look at this then, id_block→self_obj and id_block→self_cmp appear to be the same thing in my struct, will need to see why that’s not working… Interesting socket stuff, that’ll be something I’ll get to, hopefully once I’ve sorted out my UI stuff… Cheers Garry |
Garry (87) 184 posts |
Hmm, OK, I think I see what is happening. The toolbox_block which supplied to me in the event handler is NULL, however, the toolbox_block I set up when initialising my Toolbox application is populated with the correct info. Not sure if this is normal behaviour, but I can at least make my app work now. Cheers Garry |