[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal for a "main class" system property
From: |
Thomas Fitzsimmons |
Subject: |
Re: Proposal for a "main class" system property |
Date: |
Fri, 28 May 2004 00:03:27 -0400 |
On Thu, 2004-05-27 at 23:37, Tom Tromey wrote:
> >>>>> "Tom" == Thomas Fitzsimmons <address@hidden> writes:
>
> Tom> What do people think of having a system property that stores the name of
> Tom> the class whose main method is being run? I need this value to properly
> Tom> initialize the GTK peers.
>
> On irc you had an example showing that this is what Sun's AWT does
> under the hood.
>
Yeah, when I take a screenshot of any window created by Sun's AWT, it is
saved as Screenshot-Mainclassname.png. When I take a screenshot of a
pure GTK application, it is saved as Screenshot-Binaryname.png. When I
take a screenshot of our AWT, it is saved as Screenshot-.png. gtk_init
sets the wmclass property of every window it creates to argv[0] (unless
one overrides the value with gtk_window_set_wmclass). The screenshot
mechanism puts that property's value in the filename. We currently set
argv[0] to "" when calling gtk_init, which explains the weird screenshot
name.
> I think it would be fine to have some `gnu.classpath.whatever'
> property that VMs are encouraged to set. My impression is that AWT
> will work even if you don't set this, it just might not be as friendly
> in some situations.
>
Yes, that's right.
Tom