add sample file for custom menu additions

This commit is contained in:
Stefan Frederik 2021-01-05 15:55:12 +01:00
parent 229241c4a4
commit 63f266c905
2 changed files with 18 additions and 1 deletions

View File

@ -12,7 +12,7 @@ put /local/src {
put /local/install_shares {
keys.help xschem.help xschem.tcl break.awk convert_to_verilog2001.awk
flatten.awk flatten_tedax.awk flatten_savenodes.awk make_sym.awk symgen.awk order_labels.awk
sort_labels.awk spice.awk tedax.awk verilog.awk vhdl.awk hspice_backannotate.tcl
sort_labels.awk spice.awk tedax.awk verilog.awk vhdl.awk hspice_backannotate.tcl add_custom_menu.tcl
change_index.tcl resources.tcl xschemrc ngspice_backannotate.tcl rawtovcd gschemtoxschem.awk
}

17
src/add_custom_menu.tcl Normal file
View File

@ -0,0 +1,17 @@
## Add a custom menu in xschem
## Create a menu entry 'Test'. '.menubar' is xschem's main menu frame.
menubutton .menubar.test -text "Test" -menu .menubar.test.menu -padx 3 -pady 0
menu .menubar.test.menu -tearoff 0
## Create a couple of entries
.menubar.test.menu add command -label "Test entry 1" -command {
puts Hello
}
.menubar.test.menu add command -label "Test entry 2" -command {
puts World
}
## make the menu appear in xschem window
pack .menubar.test -side left