From 63f266c9054ab2b3f7b2982a7e5bb052105c673f Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Tue, 5 Jan 2021 15:55:12 +0100 Subject: [PATCH] add sample file for custom menu additions --- src/Makefile.in | 2 +- src/add_custom_menu.tcl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/add_custom_menu.tcl diff --git a/src/Makefile.in b/src/Makefile.in index e8567b8a..39a90f58 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 } diff --git a/src/add_custom_menu.tcl b/src/add_custom_menu.tcl new file mode 100644 index 00000000..f0016a6b --- /dev/null +++ b/src/add_custom_menu.tcl @@ -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 +