Thanks for the ideas. I tried them all, still the same thing. It all checks
out.
But I have discovered that for some reason, preferredSize is not being used
in the layout, so in the end it is a Swing thing - custom controls are
always "fun" with a new language.
Thanks
-Ed
----- Original Message -----
From: "Kevin Butler" <kb...@ca...>
To: "Edward Povazan" <epo...@te...>
Cc: <jyt...@li...>
Sent: Friday, November 30, 2001 9:56 AM
Subject: Re: [Jython-users] Wacky assignment doesn't take value
> I think you'll probably need to describe what the behavior is when it
doesn't work.
>
> The following:
>
> from javax.swing import JButton
> x = JButton()
> w= x.width + 10
> h= x.height + 10
> x.preferredSize = w,h
> print x.preferredSize
>
> Gives the expected output:
>
> java.awt.Dimension[width=10,height=10]
>
>
> Pure speculation: try printing type( w ) - is it a PyInteger?
>
> kb
>
> Edward Povazan wrote:
> >
> > Hi,
> >
> > Anyone know what is going on here? I am setting preferredSize on a
JButton.
> > This doesn't work:
> > w=self.__tree.width
> > h=self.__nodeRenderer.preferredSize.height
> > self.__nodeRenderer.preferredSize = w,h
> > Changing the last line
> > self.__nodeRenderer.preferredSize = 300,h
> > works.
> >
> > How is this possible? Also, a print statement prints the correct value
in
> > both cases. Very strange.
> >
> > Thanks
> > -Ed
> >
> > _______________________________________________
> > Jython-users mailing list
> > Jyt...@li...
> > https://lists.sourceforge.net/lists/listinfo/jython-users
|