#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Zinc; #minimum 8 buttons my $numberbuttons = 8; my $motion_flag = 1; my $delay = 10; my $width = 25*$numberbuttons; my $height = 100; my %bgroup; my $textmessage = 'How\'s the scroll working? Right Click Blue stops scroll.'; my $iconb64 = 'R0lGODdhEAAQAKUAAAAAAC8wL72+vcK8sOCxWfioFeqtO+6sMO6sMuSvTY6Ojt6yXv+lAF5fXu6r L0BAAP/SAA8PD///AP/oAIBSAK+CL0dHR5aAVkApAL+/AP+8AHN0c6ysrM64jvymCcC9s9qzau2s NOauR+auSOSvTtuyZ15eXsK8rcS8rP////////////////////////////////////////////// /////////////////////////////////////////////ywAAAAAEAAQAAAGb0CAUBgQDARIQWDI LBIKhgMioWQKFQuGdrtoWIvbsENgbWTDWzITi05bhQ8IBK0eRgAPiV4yoVTqABYXFBh7EhlvAGZb GnIPiRtnbRxlknRlHW0MY28CHm0dXlYCHyAhIiMkJYBDJkgnAigCCktDQQA7'; my $mw = MainWindow->new; $mw->geometry($width.'x'.$height.'-15-15'); # lower right hand corner $mw->configure(-background => 'black'); $mw->resizable(0,0); $mw->overrideredirect(1); #bottombaricon setup my $mwicon = MainWindow->new; $mwicon->geometry('16x16-80-0'); # lower right hand corner $mwicon->resizable(0,0); $mwicon->configure(-background => 'black', -cursor => 'hand2'); $mwicon->overrideredirect(1); my $icon = $mwicon->Photo(-data => $iconb64); $mwicon->Label(-image => $icon)->pack(-expand => 1, -fill => 'both'); $mwicon->Tk::bind("",sub{$mw->deiconify} ); ################### my $zinc = $mw->Zinc(-width => $width, -height => 100, -backcolor => 'black', -borderwidth => 0, -relief => 'sunken', -cursor => "top_left_arrow", )->pack; # Then we create a wide line, in which we will display messages. my $messagebox = $zinc-> add('curve', 1, [15,60,$width-15,60], -linewidth => 20, -linepattern => "AlphaStipple7", -linecolor => "red", -visible => 1, -priority => 1, ); #make group for scrolling text my $textgroup = $zinc->add('group',1,-visible=> 1); $zinc->translate($textgroup, $width/2, 60); my $text = $zinc->add('text', $textgroup, -position => [0,0], -visible => 0, -anchor => 'w', -color => 'ivory', -font => '-mozilla-arial-bold-r-normal--18-90-100-100-p-93-iso8859-1', #default is -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-* -priority => 1 ); #make button help text my $texthelp = $zinc->add('text', 1, -position => [$width/2,85], -visible => 0, -anchor => 'center', -color => 'cyan', -priority => 2, ); #make buttons my $bgset = $zinc->add('group',1,-visible=> 1); $zinc->translate($bgset,-10,18); $zinc->rotate($bgset,.2,15,15); for (1..$numberbuttons){ $bgroup{'button'.$_}{'name'} = $zinc->clone($bgset); #create top of button $bgroup{'button'.$_}{'top'} = $zinc->add('arc', $bgroup{'button'.$_}{'name'}, [-10,-10,10,20], -fillcolor => "orange", -filled => 1, -linewidth => 2, -linecolor => 'gray', -visible => 1, -extent => 180, -startangle => 180, -pieslice => 1, -priority => 2, # sets it on top layer -tags => "top$_"); $bgroup{'button'.$_}{'subtop'} = "bsubtop$_"; my $id = $bgroup{'button'.$_}{'top'}; my $sub = $bgroup{'button'.$_}{'subtop'}; $zinc->bind($id,"", sub{$zinc->configure(-cursor => 'hand2')}); $zinc->bind($id,"