Pmw Megawidgets 0.8.5 - EntryField

Sean seandc at att.net
Wed Feb 28 18:38:30 EST 2001


Thanks.  It turns out to be one line more complicated than you
said.  The default settings in PMW for the grid used to place 
the label and the entry field are (sticky = "nsew").  It's this
that stretches all the fields *even*if*you*set*the*width*!!!

My code now looks like this (and it works as expected):

_e = Pmw.EntryField(Master,
                  labelpos = 'w',
                  label_text = f[0],
                  label_width = 12,
                  value = '2001/02/28',
                  validate = {'validator' : 'date', 'format' : 'ymd'},
                  )
_e._entryFieldEntry.grid( sticky = 'w' ) # Overwrite Pmw default
'nsew'
_e._entryFieldEntry.config( width = ( f[2] + 2 ) )   # Set width

Thanks again.

Sean
====

bernie wrote:
> 
> Sean wrote:
> 
> > In this fragment (creating a date-type EntryField), I have used
> > the undocumented - in Pmw - paramater 'label_width' successfully:
> >
> > _e = Pmw.EntryField(Master,
> >                     labelpos = 'w',
> >                     label_text = f[0],
> >                     label_width = 12,
> >                     value = f[4][0:4] + '/' + f[4][4:6] + '/' + f[4][6:8],
> >                     validate = {'validator' : 'date', 'format' : 'ymd' },
> >                     )
> >
> > *** [Q] Is there any way to control the width of the underlying Entry
> > widget?
> >
> 
> _e._entryFieldEntry.config( width = <what you need>)

<snip>



More information about the Python-list mailing list