Re: Substitute for routine_id?

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...

When connecting a call_back to a control - say, a button, a valid pointer to the call_back must be available at that time. It's stored in the control structure itself. Naturally, it's easier and neater if you do that connecting at the same time (and place) that you create the control. All other properties of a control can be set at that point without difficulty.

Also, it gets real tedious to have to type "call_back(routine_id("xxx"))" over and over, when something like: connect("OKButton", "clicked", "MyFunction") would be so much nicer.

Having the connect function look up the pointer (handle) to "OKButton" by name is easy, but getting a pointer to "MyFunction" seems impossible.

I think the correct place to change this behavior would be around line 1184 of source/emit.e - that's where the information that tells RoutineId() to stop looking is emitted.

What needs to be done is simple - keep track of every opROUTINE_ID that is emitted, then after the last line of the last file has been processed, go back to these opROUTINE_IDs and replace that information so it points to the end of the code (in the main/file-level scope of the last file) instead.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu