For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > June 2007 > Balloon on menu items









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]

 

Author Balloon on menu items
nishant

2007-06-14, 4:06 am

Hi ,
I am mtrying to atttach ballloon on the menu item but am not able to
do so.
Following is the program -

use strict ;
use Tk ;

my($mw, $menuBar, $balloon, $menu, $items, $label) ;

$mw = new MainWindow ;

$menuBar = $mw->Frame(-relief => 'raised',
-borderwidth => 1)->pack(-fill => 'x') ;

$items = [ [ 'command' => 'Open' ],
[ 'command' => 'Close' ],
[ 'command' => 'Save' ],
'-', # separator
[ 'command' => 'Quit', -command => sub { destroy $mw } ]
] ;

$menu = $menuBar->Menubutton(-text => 'File',
-menuitems => $items)->pack(-side =>
'left') ;

$balloon = $mw->Balloon(-balloonposition => 'mouse') ;

$balloon->attach($menu->cget(-menu),
-msg => [ undef, # a non message for the 'tear-off'
"Open a new file",
"Close the existing file",
"Save the open file",
undef, # a non message for the separator
"Quit and get me out of here" ]) ;

$items = [ [ 'command' => 'Cut' ],
[ 'command' => 'Copy' ],
[ 'command' => 'Paste' ],
'-',
[ 'command' => 'Undo' ]
] ;

$menu = $menuBar->Menubutton(-text => 'Edit',
-menuitems => $items)->pack(-side =>
'left') ;

$balloon->attach($menu->cget(-menu),
-msg => [ undef, # a non message for the 'tear-off'
"Cut the selected text\nto the clipboard",
"Copy the selected text\nto the clipboard",
"Paste text from the clipboard",
undef, # a non message for the separator
"Undo last change" ]) ;

$mw->Text->pack(-expand => 1, -fill => 'both') ;

MainLoop ;

QoS@domain.invalid

2007-06-15, 4:11 am


nishant <nishant.031@gmail.com> wrote in message-id: <1181795545.312456.80750@i13g2000prf.googlegroups.com>

>
>Hi ,
>I am mtrying to atttach ballloon on the menu item but am not able to
>do so.
>Following is the program -
>
>use strict ;
>use Tk ;
>
>my($mw, $menuBar, $balloon, $menu, $items, $label) ;
>
>$mw = new MainWindow ;
>
>$menuBar = $mw->Frame(-relief => 'raised',
> -borderwidth => 1)->pack(-fill => 'x') ;
>
>$items = [ [ 'command' => 'Open' ],
> [ 'command' => 'Close' ],
> [ 'command' => 'Save' ],
> '-', # separator
> [ 'command' => 'Quit', -command => sub { destroy $mw } ]
> ] ;
>
>$menu = $menuBar->Menubutton(-text => 'File',
> -menuitems => $items)->pack(-side =>
>'left') ;
>
>$balloon = $mw->Balloon(-balloonposition => 'mouse') ;
>
>$balloon->attach($menu->cget(-menu),
> -msg => [ undef, # a non message for the 'tear-off'
> "Open a new file",
> "Close the existing file",
> "Save the open file",
> undef, # a non message for the separator
> "Quit and get me out of here" ]) ;
>
>$items = [ [ 'command' => 'Cut' ],
> [ 'command' => 'Copy' ],
> [ 'command' => 'Paste' ],
> '-',
> [ 'command' => 'Undo' ]
> ] ;
>
>$menu = $menuBar->Menubutton(-text => 'Edit',
> -menuitems => $items)->pack(-side =>
>'left') ;
>
>$balloon->attach($menu->cget(-menu),
> -msg => [ undef, # a non message for the 'tear-off'
> "Cut the selected text\nto the clipboard",
> "Copy the selected text\nto the clipboard",
> "Paste text from the clipboard",
> undef, # a non message for the separator
> "Undo last change" ]) ;
>
>$mw->Text->pack(-expand => 1, -fill => 'both') ;
>
>MainLoop ;


I think you will need to try and use the Subwidget methods to get to
the buttons inside the menus, then attach the balloon to the subwidget.


Boswerth

2007-06-21, 5:03 pm

Shania Twain and Alyssa Milano Crazy On High Heels!
http://www.videomoviesonline.com/watch?id=726648


george w bush funny video free 3gp funny video clean funny video funny dog video funny dirty video clip
http://635-funny-video.info/free-funny-cat-video.html http://635-funny-video.info/funny-basketball-video.html http://635-funny-video.info/funny-o...ideo-watch.html http://635-funny-video.info/flash-f...ruto-video.html http://635-funny-video.info/clip-fr...line-video.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com