Well this can get very complicated in a hurry, because you are very vague in the question, but here is a start on what I "think" you want. I hard-coded the font size in this example, so you may need to work on that aspect. Just move your mouse over the orange bar on the left.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use Tk::Zinc;
my $mw = MainWindow->new;
$mw->geometry("700x600");
my $zinc = $mw->Zinc(-width => 700, -height => 565,
-backcolor => 'black',
-borderwidth => 3,
-relief => 'sunken',
)->pack;
my $closebutton = $mw->Button(-text => 'Exit', -command => sub{Tk::exi
+t(0)})
->pack;
$zinc->fontCreate(
"fonta",
-family => 'arial',
-size => -30,
-weight => 'normal'
);
my $menugroup = $zinc->add('group',1,
-visible=>1,
-sensitive =>1,
-tags => ['menu'],
);
#move off screen leaving a slight visible bar
$zinc->translate($menugroup,-25 ,0 );
my $menubox = $zinc->add('rectangle',$menugroup,
[[0, 0], [35,700] ],
-filled => 1,
-fillcolor => 'orange',
-linewidth => 2,
-linecolor => '#000000',
-priority => 1,
-tags => ['menu'],
);
my %menuitems;
my $y = 5;
for my $item ('a'.. 'm'){
$menuitems{$item}{'item'} = $zinc->add( 'text', $menugroup,
-position => [ 5, $y ],
-text => $item,
-font => 'fonta',
-tags => ['menuitem','menu',$item]
);
$menuitems{$item}{'location'} = $y;
$y += 40;
$zinc->bind('menuitem', '<1>', sub {&Selected()});
}
$zinc->bind( 'menu', '<Enter>', sub {&Slide_open()});
$zinc->bind( 'menu', '<Leave>', sub {&Slide_close()});
MainLoop;
sub Slide_open{
$zinc->translate($menugroup, 25 ,0 );
}
sub Slide_close{
$zinc->translate($menugroup, -25 ,0 );
}
sub Selected {
my $curr_object = $zinc->find('withtag','current');
my @list =();
my $item;
if(defined $curr_object){
# print "curr->",@$curr_object,"\n"; #array dereference
(@list) = $zinc->gettags($curr_object);
($item) = grep /\b\w{1}\b/g, @list;
print "item->$item\n";
} else {return}
}
| [reply] [d/l] |
Ejecting type effect? hmm, maybe you mean the "clay tablet printer" (from the pink camel book) used by Job to generate his reports about daughters and camels? but then, using Zinc? (Zn, 65.409 g/mol)
What's the "slide part" of a window? what window? may I guess "a browser window"? "would open(eject)" to see the options section from what?
After some minutes of wild guessing I come to the conclusion that you mean something like "hiermenus" in JavaScript. But then, maybe not.
Please read How do I post a question effectively?.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |
I think Tk::Zinc is meant with Zinc...
| [reply] |
Thanks zentara... If you remember me, it's for my rotatable gismo's window(the window/**** that is rotated by the gismo).
Will go through you script soon... Thanks again.
| [reply] |
Hi, it dawned on me that you may be looking for "balloons" on Zinc. Balloons are little windows that "pop up" when your mouse is over an item. There is a trick to making them work on Zinc, so if you are after "balloons", let me know and I'll post a few examples.
| [reply] |