I'm trying to tell Leo to 'fake' what it's currently selected text is, in it's currently selected body, while running Leo in a leobridge.
I'v lookedin leo's code: This is set when creating a Leo bridge : "inBridge"
Obviously, It's checked by leo in some commands that would make no sense if it was not running in a gui. So it makes sure "inBridge" is false.
"g.app.inBridge" is the way it's usually checked...
I'm trying to integrate 'selection state' by overriding the 'wrapper' object ( in c.frame.body ) which would be useful for commands such as 'execute selected script, extract node, etc...
Problem is, in Leo, when about to run 'getScript' or other stuff like the most important method i'm overriding : "getSelectedText", Leo checks first if c.frame.body.wrapper exists, which makes sense, and would be enough, but then it also checks if g.app.inBridge is true, which prevents the call I was expecting Leo to make to the methods in the new 'wrapper' I provided for my commander's frame's body...
I dont wanna force "inBridge" to be false, it's gonna break everything else I presume!
Any thoughts or pointers that could shed some more light on this aspect of Leo's handling of it's gui wrapper interactions when opened via leoBridge?
--
Félix