[Pythonmac-SIG] Extensions for static versus frame
Bob Ippolito
bob@redivi.com
Thu, 18 Jul 2002 17:08:00 -0400
Try your luck with this... Undocumented calls, but I'm 99% sure it will
work. I'm pretty sure CPS gets linked in with Carbon, definitely does
with Cocoa..
/* code below */
struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
};
typedef struct CPSProcessSerNum CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSSetProcessName ( CPSProcessSerNum *psn, char
*processname );
void setMyName(void)
{
CPSProcessSerNum PSN;
CPSGetCurrentProcess(&PSN);
CPSSetProcessName(&PSN,"foobar");
}
/* end code */
On Thursday, July 18, 2002, at 04:54 PM, Jack Jansen wrote:
>
>>>> This needs to be solved. Except for command line use, Python is not
>>>> an
>>>> application. It is a virtual machine or runtime environment, and
>>>> should
>>>> be invisible to users running multiple python programs at once. Is
>>>> the
>>>> above mentioned "Python Launcher.app" the solution to this?
>
> I assume you mean that if you double click foobar.py you want the icon
> in the dock and the menubar to show "foobar" in stead of "Python",
> right?
>
> If this is what you mean: yes, that would be nice. Unfortunately I have
> no idea how this could be done. We can't set argv[0] to the value
> wanted, because argv[0] has to point to the .app bundle otherwise
> things don't work.
>
> Does anyone know of a call we could make to set what the window manager
> thinks is our program name, so it sets the menu and dock name correctly?
> --
> - Jack Jansen <Jack.Jansen@oratrix.com>
> http://www.cwi.nl/~jack -
> - If I can't dance I don't want to be part of your revolution -- Emma
> Goldman -
>
>
>
> _______________________________________________
> Pythonmac-SIG maillist - Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig