On Jun 10, 2010, at 11:08 AM, William Stein wrote:
> On Thu, Jun 10, 2010 at 8:07 AM, Robert Bradshaw
> <rober...@math.washington.edu> wrote:
>> On Jun 9, 2010, at 11:53 PM, Georg S. Weber wrote:
>>> On 10 Jun., 02:37, Jason Grout <jason-s...@creativetrax.com> wrote:
>>>> 
>>>> Karl-Dieter just showed me how to get the OSX App built using sage
>>>> -bdist:
>>>> 
>>>> export SAGE_APP_BUNDLE=yes
>>>> sage -bdist 4.4.2-app
>>>> 
>>>> There are people I know that would *love* to have a clickable app on
>>>> OSX.  Why do we not have this as a download option on the webpage?
>>> 
>>> As far as I remember, there was no consensus reached as to *what
>>> exactly* should happen if you "just click" on some Sage App Icon. As
>>> of now, there are at least three different possibilities:
>>> 
>>> a.) A "Sage shell" opens, i.e. a terminal that is already cd'ed to
>>> $SAGE_ROOT and "./sage -sh" is executed.
>>> b.) A "Sage interpreter" opens, i.e. a terminal that is already cd'ed
>>> to $SAGE_ROOT and  "./sage" is executed.
>>> c.) A "Sage notebook" opens, i.e. a terminal that is already cd'ed to
>>> $SAGE_ROOT and  "./sage -notebook" is executed.
>> 
>> I think for the vast majority of people wanting a double-clickable app
>> rather than the command line, (c) would be the way to go. The tricky part is
>> how to quit.
>> 
> 
> Many of us use OS X, so let's just assume we can program anything if
> we want.  What would be the best UI for Sage?
> 
> The first thing that pops into my mind is that Sage runs as some sort
> of server, kind of like say DropBox or any of the many other programs
> running with an icon in the bar at the top of the screen.   So I
> imagine that when one double clicks on the Sage icon,
> 
>   (1) the default browser opens with the Sage notebook running,
>   (2) a small Sage icon appears in the bar at the top of the screen.
>   (3) When clicked, the Sage icon in the bar has at least two options:
>              - Sage Notebook (which just opens the browser to the
> notebook server)
>              - Quit (which quits the Sage notebook server and makes
> the icon vanish)
> 
> It could (but probably shouldn't) also have some slightly more advanced 
> options:
>              - Log (pop up a Terminal window with "tail -f" on the
> notebook server log)
>              - Kill all running Sage sessions
> 
> This is basically how I use the Sage notebook on my laptop anyways,
> but with the bar/icon above replaced by a screen session.
> 
> Regarding (1), the notebook itself could be slightly modified to
> provide a reminder to the user about how to control the notebook
> server.

Okay, I created a simple application (none of the copyright is set for example) 
that does the following:

1. On launch it runs sage -notebook (which will open the default browser etc. 
(unless there is a server running))
2. It only appears as a menu extra which allows opening notebooks, the log, and 
several shell sessions (am I missing anything -- reveal SAGE_ROOT in Finder 
perhaps?).
3. On quit it stops the server (should there be an option to quit without 
stopping the server?).

If you want to try it, I have put it up at
http://math.byu.edu/~gvol/files/SageMenu.zip
and a screen shot at
http://math.byu.edu/~gvol/files/sage-menu-screenshot.png

For testing purposes it creates a symlink in Contents/Resources/ to a local 
sage root directory.  In the distributed version I imagine that the sage root 
would reside there (like it does in the app created currently).  Because of 
this, if you have problems running, it may be that sage is not in your path.  
If this is the case then you will need to edit  Targets > SageMenu > Run Script 
 and change the default sage root directory.

Right now I created it completely outside of Sage, but I can of course replace 
the app that is in Sage, or add this in addition.  Does anyone prefer the 
application that is currently created?  Obviously sage -bdist will have to be 
changed as well, but that shouldn't be hard.

I'm not a Cocoa expert by any means, so if someone knows how to improve things 
please let me know and/or send patches.  One thing that I would like it to do 
is turn red while the server is starting (is there a good way to detect this?).

Also, is there a way to do something like the following:
./sage -browse http://localhost:8000/
What I'm doing is
sage -c 'import sage.misc.viewer as b; os.system(b.browser() + " 
http://localhost:8000/";)'

Phew.  I don't know why my emails always turn out to be novels.

-Ivan

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to