Home > Archive > PerlTk > January 2007 > checkboxlist
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Petr Vileta 2007-01-06, 7:14 pm |
| Is somebody here who CAN and WANT to help me create a new module?
I was need to have a scrollable list of checkboxes. Screenshoot is here
http://web.practisoft.cz/list.jpg
I tried Frame, Pane, Tlist and Hlist. The last one I select as a good
candidate for new module. I have a working example but writed as program,
not a module. I have never write a module. Please help me. Maybe you find
this module useful for you applications ;-)
If somebody will be interested I put my code here (code is relatively big).
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
| |
| felix.da.ru 2007-01-06, 7:14 pm |
| Hi,
I managed to bind "arrow down" key to <Tab> so pressing down arrow on
checkbox behave exactly as you planned, regardless of wrapper widget.
The issue is that I'm failing to bind "arrow up" key to <Shift-Tab>.
$mw->bind('<Key-Down>' => $mw->bind('all','<Key-Tab>') );
$mw->bind('<Key-Up>' => $mw->bind('all','<Shift-Key-Tab>') );
Maybe somebody can give us a hint?
Thanks,
~Felix_
Petr Vileta wrote:
> Is somebody here who CAN and WANT to help me create a new module?
> I was need to have a scrollable list of checkboxes. Screenshoot is here
> http://web.practisoft.cz/list.jpg
> I tried Frame, Pane, Tlist and Hlist. The last one I select as a good
> candidate for new module. I have a working example but writed as program,
> not a module. I have never write a module. Please help me. Maybe you find
> this module useful for you applications ;-)
> If somebody will be interested I put my code here (code is relatively big).
> --
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail
> from another non-spammer site please.)
| |
| felix.da.ru 2007-01-06, 7:14 pm |
| Yes, I did it:
my $db=$mw->DialogBox(-title=>'example');
my $f=$db->Scrolled('Frame')->pack;
my $i=0;
foreach my $c (qw/one two three something anything/)
{
$f->Checkbutton(-text=>$c)->grid(-row=>$i,-column=>0);
$i++;
}
$db->bind('all', '<Key-Up>' => 'focusPrev');
$db->bind('all', '<Key-Down>' => 'focusNext');
my $reply = $db->Show();
felix.da.ru wrote:[color=darkred]
> Hi,
>
> I managed to bind "arrow down" key to <Tab> so pressing down arrow on
> checkbox behave exactly as you planned, regardless of wrapper widget.
> The issue is that I'm failing to bind "arrow up" key to <Shift-Tab>.
>
> $mw->bind('<Key-Down>' => $mw->bind('all','<Key-Tab>') );
> $mw->bind('<Key-Up>' => $mw->bind('all','<Shift-Key-Tab>') );
>
> Maybe somebody can give us a hint?
>
> Thanks,
>
> ~Felix_
>
> Petr Vileta wrote:
| |
| Petr Vileta 2007-01-06, 7:14 pm |
| "felix.da.ru" <felix.liberman@gmail.com> píse v diskusním príspevku
news:1167774915.215952.197200@v33g2000cwv.googlegroups.com...
> Hi,
>
> I managed to bind "arrow down" key to <Tab> so pressing down arrow on
> checkbox behave exactly as you planned, regardless of wrapper widget.
> The issue is that I'm failing to bind "arrow up" key to <Shift-Tab>.
>
> $mw->bind('<Key-Down>' => $mw->bind('all','<Key-Tab>') );
> $mw->bind('<Key-Up>' => $mw->bind('all','<Shift-Key-Tab>') );
>
> Maybe somebody can give us a hint?
>
Maybe is a not good idea to do $mw->bind('all'...). My code is example only
and in future this code will be a part of other big code. Better will be to
bind to some scrolled widget only.
But back to my main question ... can you help me to make a regular module? I
never create my own module.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
| |
| Petr Vileta 2007-01-06, 7:14 pm |
| "felix.da.ru" <felix.liberman@gmail.com> píse v diskusním príspevku
news:1167776321.936935.283480@n51g2000cwc.googlegroups.com...
> Yes, I did it:
>
> my $db=$mw->DialogBox(-title=>'example');
> my $f=$db->Scrolled('Frame')->pack;
Hmm, strange. I have Perl 5.6.1 and Tk800 and Scrolled('Frame') not work for
me. Many widget I can to make scrolled except Frame ;-)
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
| |
| felix.da.ru 2007-01-06, 7:14 pm |
| My perl is
cygwin: 5.8.7 Tk 804.027
M$Win: 5.8.4 Tk 804.027
Anyway, you can use another wrappers that support 'Scrolled'.
Petr Vileta wrote:
> "felix.da.ru" <felix.liberman@gmail.com> p=EDse v diskusn=EDm pr=EDspevku
> news:1167776321.936935.283480@n51g2000cwc.googlegroups.com...
> Hmm, strange. I have Perl 5.6.1 and Tk800 and Scrolled('Frame') not work =
for
> me. Many widget I can to make scrolled except Frame ;-)
>
> --
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail
> from another non-spammer site please.)
| |
| Slaven Rezic 2007-01-06, 7:14 pm |
| "Petr Vileta" <stoupa@practisoft.cz> writes:
> "felix.da.ru" <felix.liberman@gmail.com> píse v diskusním príspevku
> news:1167776321.936935.283480@n51g2000cwc.googlegroups.com...
> Hmm, strange. I have Perl 5.6.1 and Tk800 and Scrolled('Frame') not
> work for me. Many widget I can to make scrolled except Frame ;-)
Since Tk 804, Scrolled('Frame') will be translated into
Scrolled('Pane'). In earlier Tk versions you have to use the Pane.
--
Slaven Rezic - slaven <at> rezic <dot> de
Berlin Perl Mongers - http://berlin.pm.org
|
|
|
|
|