1######################################################################
2# Visual Menu Helper Functions - Bertrand Irissou
3######################################################################
4
5###
6###  Add a menu button to the Magic wrapper window for the toolkit
7###
8proc magic::add_menu {framename toolname button_text } {
9   menubutton ${framename}.titlebar.mbuttons.${toolname} \
10		-text $button_text \
11		-relief raised \
12		-menu ${framename}.titlebar.mbuttons.${toolname}.toolmenu \
13		-borderwidth 2
14
15   menu ${framename}.titlebar.mbuttons.${toolname}.toolmenu -tearoff 0
16   pack ${framename}.titlebar.mbuttons.${toolname} -side left
17}
18
19###
20###  Add a command item to the toolkit menu
21###
22proc magic::add_menu_command {framename toolname button_text command} {
23   set m ${framename}.titlebar.mbuttons.${toolname}.toolmenu
24   $m add command -label "$button_text" -command $command
25}
26
27###
28### Add a separator to a menu
29###
30proc magic::add_menu_separator {framename toolname} {
31   set m ${framename}.titlebar.mbuttons.${toolname}.toolmenu
32   $m add separator
33}
34
35