Is it possible to align everything to the left in a grid ??

hello,

I want every cell in a grid to be aligned to the left,
for numbers (and maybe others) this doesn't seem to work.
Aligning everything to the right does seem to work.

This is the code I use

      attr1 = gridlib.GridCellAttr()
      attr1.SetAlignment (wx.ALIGN_LEFT, wx.ALIGN_CENTER)
      self.SetColAttr ( 1, attr1 )

thanks,
Stef Mientki

Stef Mientki wrote:

hello,

I want every cell in a grid to be aligned to the left,
for numbers (and maybe others) this doesn't seem to work.
Aligning everything to the right does seem to work.

This is the code I use

     attr1 = gridlib.GridCellAttr()
     attr1.SetAlignment (wx.ALIGN_LEFT, wx.ALIGN_CENTER)
     self.SetColAttr ( 1, attr1 )

Since wx.ALIGN_LEFT is the default in most situations then it has a value of zero, however since there is no bit that is actually set when it is used it breaks for those situations where left is not the default.

You'll probably have to write your own renderer class for this.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Since wx.ALIGN_LEFT is the default in most situations then it has a value of zero, however since there is no bit that is actually set when it is used it breaks for those situations where left is not the default.

You'll probably have to write your own renderer class for this.

thanks Robin,

I'll think for the moment I'll choose the easy way,
align everything to the right :wink:

cheers,
Stef Mientki

Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629