[Pythonmac-SIG] How to tell if a .app is clicked again?
kevino at tulane.edu
Tue Aug 16 21:45:04 CEST 2005
On Aug 16, 2005, at 12:31 PM, Chris Barker wrote:
> Hi all,
> I'm working on a project in which we're trying to write a Web app that
> can also be run stand-alone on a non-networked machine.
I can't answer the questions you posed below, as I do almost all of
my Mac work with wxPython, but when I read about what you're trying
to do I couldn't help but think that this is exactly what ActiveGrid
AppBuilder is for:
Granted, it's wxPython and thus not as lightweight, but apps you
create with it can be run locally on the user's machine or can be
deployed to a server with their server components installed. It
allows you to use SQLite, Oracle, MySQL, or PostGreSQL for the
database. It's also pretty nice for point-and-click creation of full-
fledged database apps, so the apps are easy to customize. (See their
Petstore demo that comes with the app.) Not sure what your exact
needs are, but this might be at least worth a look if you haven't
seen it already.
> so far, I've got
> a little demo that creates a tiny little database-backed web site
> If it's run as __main__, it starts up a little server (using Quixote
> SimpleServer) listening to localhost:8080, then uses the webbrowser
> module to start up a web browser pointing to that address. This all
> works great. In fact, I can use py2app to bundle it all up, and get a
> nice distributable clickable app that the user can click on and it
> up the web browser and away we go..
> NOTE: Thanks Bob for py2app: It worked absolutely flawlessly for this,
> with no tweaking or anything...I'm not looking forward to the py2exe
> So here's the issue:
> When you start the app, it puts a little icon on the dock, and
> fires up
> the browser, all is good. However, if you try to start the app
> again, it
> doesn't do anything, as it's already running. I don't want it to start
> up again, but it would be nice if it would bring up the browser again.
> I'm imagining that some sort of event is sent to the app when the user
> tries to start it up again. I'd like to catch that event and then
> up the browser again. How would I do that...I've really only
> in Linux/Unix style and with wxPython, so I have no clue about Apple
> events and the like.
> Another issue:
> It puts an icon in the dock, but I don't have any wxWindows or
> so it doesn't do much. The only way I can figure out how to stop it is
> to right click on the icon in the dock and select force quit. I see
> possible solutions:
> 1) Have it not put an icon in the dock, and just run in the
> then it would just keep running forever, which would probably be
> OK, or
> I could have it automatically quit if it hadn't been used for some
> period of time. How do you have an app started with a double-click run
> without an icon in the dock?
> 2) Give it a menu, with a the usual quit, etc. items. As it doesn't
> a window, I'm not sure it this is so good, but it might be a little
> Mac-like. If I do this, what is the lightest weight way to give it a
> menu with the basic items.
> Any thoughts are welcome.
> Christopher Barker, Ph.D.
> NOAA/OR&R/HAZMAT (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
> Chris.Barker at noaa.gov
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
More information about the Pythonmac-SIG