Pmw ScrolledListBox width

Martin Franklin martin.franklin at westerngeco.com
Fri Aug 17 12:50:32 CEST 2001


I think you could also specify a listbox_width.....


self.box = Pmw.ScrolledListBox(parent,
                 items=('Sydney', 'Melbourne', 'Brisbane'),
                 labelpos='nw',
                 label_text='Cities',
                 listbox_height = 6,
		 listbox_width=80,     # seems to do the trick.....
                 selectioncommand=self.selectionCommand,
                 dblclickcommand=self.defCmd,
         )
# you may also need to allow the listbox to expand
# in the 'x' direction....

self.box.pack(fill='x', expand='yes')

Martin.

David Allen wrote:
> 
> In article <9li3rt$ntm$1 at bob.news.rcn.net>, "Jerry Gitomer"
> <jgitomer at erols.com> wrote:
> 
> > Okay,
> >
> >         I must be overlooking the obvious, but how do I specify the
> > width of the text in a Pmw ScrolledListBox?  I tried reading the docs and
> > then I started experimenting  -- and nothing seems to work.
> >
> >         I used the All.py program in the Pmw/demos directory as a
> > starting point so I have two panes with the left containing the treeList and
> > the right open for my called modules to use.  There must be room to support
> > a width of 90 characters and 30 rows, but all I can get are 7 rows and 20
> > some odd characters of width.
> 
> When you create the ScrolledListBox component, try specifying
> "hull_width" and "hull_height" along with "usehullsize=1".  Example from
> ScrolledListBox.py in the "demo" directory of the Pmw distribution:
> 
>         # Create the ScrolledListBox.
>         self.box = Pmw.ScrolledListBox(parent,
>                 items=('Sydney', 'Melbourne', 'Brisbane'),
>                 labelpos='nw',
>                 label_text='Cities',
>                 listbox_height = 6,
>                 selectioncommand=self.selectionCommand,
>                 dblclickcommand=self.defCmd,
>                 usehullsize = 1,
>                 hull_width = 200,
>                 hull_height = 200,
>         )
> 
> Hope this helps.  I don't know of a way where you can say "make the window
> wide enough to hold 40 characters" - just that you can specify pixel
> widths like this.
> 
> --
> David Allen
> http://opop.nols.com/
> ----------------------------------------
> >This is the `hash' symbol and makes #! at the start of a shell script
> >`hash bang'.
> Yes, and #!/bin/bash is thus pronounced "hash bang slash bin slash
> bash".
>                 -- From comp.lang.lisp



More information about the Python-list mailing list