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

2010-06-18 Thread Aleksey Lim
On Fri, Jun 18, 2010 at 01:48:56PM +, Sascha Silbe wrote:
> Excerpts from John Samuel's message of Thu Jun 17 10:28:52 + 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.

Polyol[4] is designed exactly for this purpose, these are C libraries
that should cover all sugar related low level routines, starting from
getting sugar environment settings via full featured sugar GUI to high
level stuff i.e. what sugar-toolkit does for python based activities.
It is not yet finished (but already in some useful stage, I'm using it
for C based GCompris and less for Tuxpaint) and contains only python
binding for now.

> [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

[4] http://wiki.sugarlabs.org/go/Activity_Team/Polyol

-- 
Aleksey
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2010-06-18 Thread Sascha Silbe
Excerpts from John Samuel's message of Thu Jun 17 10:28:52 + 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/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2010-06-17 Thread James Simmons
John,

We have a manual which should help you figure out what you're doing wrong:

http://en.flossmanuals.net/ActivitiesGuideSugar/Introduction

James Simmons


> Date: Thu, 17 Jun 2010 03:28:52 -0700 (PDT)
> From: John Samuel 
> Subject: [Sugar-devel] Help Needed - Convert python code into Sugar
> To: Sugar Devel 
> Message-ID: <350718.92048...@web45305.mail.sp1.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> 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.
>
>
> John Samuel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel