Page 1 of 1
Current page, active tab ?
Posted: 19 May 2013 17:44
by mbncp
How do you figure out on which page you are and also on which page is a given control ?
Same question for tabs within a container, and objects within these tabs.
And beside getting the attribute list count and attributes names, is there a better way to know which type of control you are dealing with ?
thanks
btw, lemur is crashing when calling getattributelist with the interface object ( top parent object)
Re: Current page, active tab ?
Posted: 20 May 2013 07:27
by Softcore
For the page, I believe you are looking for the built in current_interface variable (Lemur manual, page 125)
As for container tabs, the fact that there is no way to access which one is visible, and lots of other limitations have convinced me that the BEST way to deal with tabbed containers is to hide the tab bar and select-choose tabs only with scripted switches - pads. This way you can build some way to detect the currently visible tab around the current status of the button.
More about this here:
http://forum.liine.net/viewtopic.php?f=34&t=3022
Re: Current page, active tab ?
Posted: 20 May 2013 11:24
by mbncp
Thanks, totally missed the interface internal variable
Using a menu or switches does the trick, but how could they miss something so basic?
I've been fooling around with getfirst, getnext and all these indirect obj function, warning, easy to crash lemur, but a few things are leaving me a bit speechless. First there's no way to figure out what type of object you get ( there are some workarounds), then there is no way to figure out on which page is a given control, same thing for containers pages.
Also it's a bit funny that the template keeps running while in the edit mode or did I just enter the twilight zone ?
Re: Current page, active tab ?
Posted: 20 May 2013 11:56
by Softcore
Its true, container tabs arer some form of a "invisible" thing for the parser. Even the getnext scripts will get you the next object in a container regardless of the tab hierarchy. For example if you have
tab1 - AAAobject
tab1 - BBBobject
tab2 - AAobject
The next object of AAAobject will be AAobject NOT BBBobject (alphabetical order, regardless of tabs hierarchy)
Re: Current page, active tab ?
Posted: 20 May 2013 13:41
by mbncp
A few basic functions are missing. I also noticed that everything runs at about a 1/60 sec which is a bit slow, at least if you want to run a midi clock.
I guess I'll end using xcode, my dream is to create some utility app that deals with all the midi stuff, probably still using lemur for the interface, but also an app that can communicate with all my ipads as this is getting a bit on my nerves.
Re: Current page, active tab ?
Posted: 21 May 2013 22:12
by mbncp
Got "my" first ios app running, it took 1 minute to run it in the simulator and almost an hour to get it running on an iPad , ok once I
did read the doc I was just a few minutes ago, but still.
And it's nice, it compiles the app directly to the iPad, run it, while debugging it on your laptop
Objective C looks a bit weird sometimes, but the MIDI stuff sounds familiar, found a library called pgmidi which handles most stuff, it looks even easier than in Lemur
Problem is a bit to learn all these core libraries (never coded on osx), but I will probably do all the dirty MIDI job in the app and still use Lemur as an interface, it sounds like a good combo.