|
From: D-Man <ds...@ri...> - 2001-07-12 14:45:05
|
On Thu, Jul 12, 2001 at 02:13:36PM +0200, Kevin McNamee wrote:
| How do I apply constraints to a GridBag?
|
| >>> from pawt import swing, awt, GridBag
| >>>
| >>> frame = swing.JFrame()
| >>> c = awt.GridBagConstraints()
| >>> button = swing.JButton()
| >>> gridbag = GridBag(frame.contentPane)
| >>> gridbag.setConstraints(button,c)
| Traceback (innermost last):
| File "<console>", line 1, in ?
| AttributeError: setConstraints
| >>>
>>> dir( gridbag )
['defaults', 'frame', 'gridbag']
>>> print gridbag.gridbag
java.awt.GridBagLayout
>>> dir( gridbag.gridbag )
[]
>>> dir( gridbag.gridbag.__class__ )
['__init__', 'addLayoutComponent', 'columnWeights', 'columnWidths',
'getConstraints', 'getLayoutDimensions', 'getLayoutOrigin',
'getLayoutWeights', 'layoutDimensions', 'layoutOrigin',
'layoutWeights', 'location', 'rowHeights', 'rowWeights',
'setConstraints']
>>> gridbag.gridbag.setConstraints(button,c)
^^^^^^^^
I hope the interactive session above gives you a hint how to find
these sort of things out, as well as the answer to your question :-).
-D
|