Account Options

  1. Sign in
Google Groups Home
« Groups Home
Message from discussion Tk::JComboBox Question
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
fun...@hello.net  
View profile  
 More options Oct 19 2005, 10:20 am
Newsgroups: comp.lang.perl.tk
From: Fun...@hello.net
Date: Wed, 19 Oct 2005 10:20:54 -0400
Local: Wed, Oct 19 2005 10:20 am
Subject: Tk::JComboBox Question
I have a question about the Tk::JComboBox package. When I run the
script below and click the down arrow to display the drop down list,
the default item ($variable) is NOT selected or hilighted in the list.
If I click anywhere else to make the list go away and then click the
down arrow again to redisplay the list, then the default item
($variable) IS selected and displayed in the list. Why is it NOT
selected and displayed the first time? Thanks for your help.

Here is a sample script:

#!/usr/bin/perl

use strict;
use Tk;
use Tk::JComboBox;

my $variable = "11";
my @choices = ();
my $x = 1;
while ($x < 21)
{
    my $y = $x;
    if (length($y) < 2)
    {
        $y = " " . $y;
    }
    push @choices, $y;
    $x++;

}

my $mw = MainWindow->new;
my $jcb = $mw -> JComboBox (
    -mode         => 'readonly',
    -relief       => 'groove',
    -textvariable => \$variable,
    -choices      => \@choices)
    -> pack (
        -side => 'left');
MainLoop;

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.