I hate to be a spoiler but it's not clear to an outside reader what exactly you're referring to. A web page? Tk programming? Gtk programming? Can you give us a bit more context?
| [reply] |
I'm assuming that you are working with Tk? You can create your own custom widget with the functionality you want. If you are not familiar with how to do this, then I suggest you do some reading. Here are a couple of links that will point you in the right direction.
http://www.perltk.org/
http://hell.org.ua/Docs/oreilly/
Hope this helps. | [reply] |
create X listboxes side by side? or have a detached listbox? | [reply] |
You could try something like this: A Scrolled Pane filled with checkboxes. You may need to test the height of your font, to get the right height for the Pane, I just hardcoded in 45. Also remember, you need a minimum Pane height to show the scrollbar arrows, unless you make your own custom ones.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
require Tk::Pane;
my $mw = MainWindow->new;
my $text = $mw->Scrolled("Text",
-relief => 'sunken',
-borderwidth => 2,
-setgrid => 1,
-height => 10,
-width => 20,
-scrollbars => 'oe')->pack();
$mw->Label(-text=>'Select from choices below')->pack();
my $pane = $mw->Scrolled('Pane',
-height => 45,
-bg => 'lightgreen',
-scrollbars=>'osoe',
)->pack(-fill => 'x',-expand=>'yes');
for my $choice(1..30){
my $b1 = $pane->Checkbutton(
-text => $choice,
-relief => 'flat',
-command=> sub{
$text->insert('end',"$choice\n");
},
)->pack(-side => 'top', -pady => 1 ,-anchor => 'w');
}
$pane->focus;
MainLoop;
| [reply] [d/l] |