Scrolled listbox problem

From: Anirban (anirban.sarkar_at_cescltd.com)
Date: 02/03/05


Date: 2 Feb 2005 20:03:42 -0800

Hi all,

I have a listbox in a frame. The listbox is populated with values from
the backend. Since there will be many items in the list, I want to add
a vertical scrollbar to the list box. I am giving below the code that I
have used for the purpose, but the scrollbar does not show up as a
result of which I am not able to scroll.

###########################CODE##################################

#Creating a Frame
frame .f -width 230 -height 270
pack .f
pack propagate .f 0

#creating a listbox with a scroll bar
label .f.name -text "Select consumer no." -font $fnt11b
place .f.name -x 10 -y 5
listbox .f.l -yscrollcommand {.f.s set} -font $fnt9
place .f.l -x 10 -y 40 -width 220 -height 130

#Defining a scroll bar for the listbox
scrollbar .f.s -orient vertical -command {.f.l yview}
place .f.s -x 230 -y 40 -width 10 -height 130

# Fetching and populating values from backend
set connection_no { }
set stmt "select con_no from mri;"
db1 eval $stmt {} {
lappend connection_no $con_no
.f.l insert end $con_no
}

Kindly help.

Regards,
Anirban Sarkar



Relevant Pages

  • Scrolled listbox problem
    ... I have a listbox in a frame. ... the backend. ... result of which I am not able to scroll. ... # Fetching and populating values from backend ...
    (comp.lang.tcl)
  • Scrolled listbox problem
    ... I have a listbox in a frame. ... the backend. ... result of which I am not able to scroll. ... # Fetching and populating values from backend ...
    (comp.lang.tcl)
  • Re: Using mouse to scroll down a combo list
    ... the ListBox does not have the focus then read on. ... Scroll a ListBox to a specific row. ... the highlight bar up and down, rather than have the laist itself move up ... values, it will show a selection of the one under the pointer, ...
    (microsoft.public.access.forms)
  • Re: Any way to scroll list box left/right propgrammatically?
    ... Private Sub lstAvailable_MouseDown(Button As Integer, Shift As Integer, X As ... horizontal scroll bar is required but it is well behaved in that every column ... in the mouse down event of the listbox. ... Dim intColNumber As Integer, intColWidthSum As Integer ...
    (microsoft.public.access.formscoding)
  • Re: Scroll to specific list box entry
    ... Scroll a ListBox to a specific row. ... Dim intDesiredRow As Integer ... Private Declare Function GetFocus Lib "user32" As Long ...
    (microsoft.public.access.forms)