Post Reply 
Custom App handling of events
12-26-2013, 04:29 PM
Post: #1
Custom App handling of events
Tim,

Thanks for the clarification on variables, but since you're on, I thought I'd ask something else that's been confusing to me.

A built-in App like Function responds to soft-menus AND other events (key presses, mouse etc.)

If I write an App that puts up a custom menu bar I need to poll for events within a loop in order to process the soft-menus. There doesn't seem to be an API to pass events I'm not interested in to the system for processing. So if I'm handling my soft-menus, other keys (e.g. View) are basically dead.

I don't want to reproduce the functionality of every key in my App. Is there a way to handle this? Otherwise, I don't see an easy way to create useful soft-menus at the moment.
Find all posts by this user
Quote this message in a reply
12-26-2013, 06:40 PM
Post: #2
RE: Custom App handling of events
I think there is no multithreading or events besides the key functions for custom keys. So you need to build a simple state machine where you check the mouse (or menu?, if available) position and react to that.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-26-2013, 08:09 PM
Post: #3
RE: Custom App handling of events
Eried,

I've already done that. But the problem is that there is no mechanism to respond to "system" events (i.e. ones that I am not explicitly handling).

If you look at the built-in apps they can clearly do this.
Find all posts by this user
Quote this message in a reply
12-26-2013, 08:52 PM
Post: #4
RE: Custom App handling of events
I understand that in this code the programming capabilities are very *sandboxed*, but can you provide an example code?

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-27-2013, 02:50 PM
Post: #5
RE: Custom App handling of events
Eried,

I'm sorry but I'm not ready to release code yet. I don't see how this would help anyway.
Find all posts by this user
Quote this message in a reply
01-02-2014, 08:54 PM
Post: #6
RE: Custom App handling of events
Eried,

If you're interested, I did post an example in the Programs section of the forum:

http://www.hpmuseum.org/forum/thread-308.html

The app works more or less the way I want but it's fairly force-fit into the HP Prime App formalism. The notion of Symbolic/Num/Plot views isn't terrible general IMHO. I did end up writing an event loop to process key presses and mouse events. As you can see, any key events that occur while my custom menus are on screen have to be processed from within the app -- there's no way to get the system to do it currently.

-- jeff
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: