Q: How to Change Pmw.ComboBox width ??

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Fri Sep 26 05:33:24 EDT 2003


On Fri, 2003-09-26 at 10:14, Camilo Olarte wrote:
> Hello list, 
> I was trying to make a Pmw.ComboBox and while using it i
> needed to change its width. 
> I tried to configure it's inner components  directly like _listbox.config 
> but nothing changes.. 
> By default in my computer this combobox width is of 12 (characters)
> and since I am showing number of the month i need only 3 characters.
> i could use a Pmw.Counter but my boss don't likes it's arrows  :(   ...
> 
> Here is some sample code of what i'm doing.
> 
> <PYTHON>
> import Tkinter, Pmw
> class DemoCombo:
>     def __init__(self, parent):
>         parent.configure(background = 'white')
>         arrmes = [1,2,3,4,5,6,7,8,9,10,11,12] 
>         # Create and pack the dropdown ComboBox.
>         self.dropdown = Pmw.ComboBox(parent,label_text = 'Month:',
>                  labelpos = 'n',scrolledlist_items = arrmes,
>                  scrolledlist_usehullsize = 1,)

You need to configure the Entry widget.....


entry_width = 3


so  

self.dropdown = Pmw.ComboBox(parent, label_text = 'Month:',
                 labelpos = 'n', scrolledlist_items = arrmes,
                 scrolledlist_usehullsize = 1, entry_width = 3)


Regards
Martin

-- 
Martin Franklin <mfranklin1 at gatwick.westerngeco.slb.com>






More information about the Python-list mailing list