Connecting a non python activity to sugar
Bert Freudenberg
bert at freudenbergs.de
Tue Apr 1 09:55:40 EDT 2008
On 31.03.2008, at 14:52, Paul Fox wrote:
> bert wrote:
>> http://wiki.laptop.org/go/Low-level_Activity_API
>>
>> Also, try the sugarize script and library:
>>
>> http://lists.laptop.org/pipermail/devel/2008-January/009387.html
>>
>> (maybe that should be added to the Wiki)
>
> indeed -- that would be a nice addition. i'm using that script,
> along with the little libsugarize shared lib hook, with good
> success. i think many people have found versions of that script
> via the forums, but it would be good to have it in a
> quasi-official place. (i didn't realize where it had originated.)
Well, just add it then. It's a Wiki :)
> on that subject, i've been wondering about a related issue.
>
> my activity (RoadMap, which is a GPS-enabled street-mapping
> program) runs in a single X-window (modulo the occasional
> dialog box). it has the ability to spawn a second program (a GPS
> "console", which gives an "available satellite" display) which
> of course creates a second X-window. this is fine, as long as you
> quit from the spawned program before doing something sugary to
> move away from its window (e.g., alt-tab). but if you obscure its
> window, you can never get back to it, since sugar knows nothing
> about it. this isn't really a program that should be a
> full-fledged activity -- it can run standalone, but one
> usually invokes it from RoadMap ("Hmm -- I'm not getting a fix --
> where are my satellites?"). is there a way of wrapping the
> second application in a shared lib similar to libsugarize such
> that sugar would know about its window in at least some minimal
> way? without this, the program gets "lost" from a UI point of
> view.
>
> (i realize that needing a second window is rather un-sugary. in a
> new activity, it would probably be a tab, for instance.)
Sugar maintains a strict 1:1 relation between top-level windows marked
as activity and activities. Any other top-level window should get an
"unknown" icon, currently a gray circle. I guess marking an arbitrary
top-level window as activity would severely confuse Sugar. What you
could try is running it as dialog window, then it will even receive a
window border that can be dragged around etc., similar to the object
chooser dialog.
- Bert -
More information about the Devel
mailing list