[Sugar-devel] Help Needed - Convert python code into Sugar

Sascha Silbe sascha-ml-ui-sugar-devel at silbe.org
Fri Jun 18 09:48:56 EDT 2010


Excerpts from John Samuel's message of Thu Jun 17 10:28:52 +0000 2010:
> Hi, this is John Samuel here.I am new to Sugar. I've made a small program in python for the viewing of images.It runs perfectly as a standalone program, but when I convert it into Sugar, it runs in a different window coz of which it cannot be stopped.I have to close Xephyr and run it again.I use Sugar .88 on Ubuntu 9.10 KarmicCould anyone please help me?

> I've attached my code along with this mail.
I'd suggest starting by converting the code to use GTK instead of TK. Python-tk is not being installed on most systems running Sugar (see the Sugar Platform page [1] for a list of packages that should be available on all systems). Also with GTK it will be much easier to integrate into Sugar; you can use several GTK-based widgets made specifically for Sugar (the sugar.graphics submodules on [2]), in addition to the regular activity framework (sugar.activity) that I highly recommend to build on. It'll make Sugar integration much easier.
It might be quite a bit of work to switch to GTK, but it'll pay off in the long run. AFAIK nobody has tried making a TK-based application yet and Sugar is still a bit peculiar about how it expects windows to appear.
If you nevertheless decide to keep using TK, the low-level activity API page has some details [3] on what X11 properties need to be set to make Sugar recognize your window.

Sascha

[1] http://wiki.sugarlabs.org/go/0.88/Platform_Components
[2] https://api.sugarlabs.org/
[3] http://wiki.sugarlabs.org/go/Development_Team/Low-level_Activity_API#X_Properties
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100618/312ce503/attachment.pgp 


More information about the Sugar-devel mailing list