
- •Contents
- •Preface
- •About This Manual
- •Manual Organization
- •Typographic and Syntax Conventions
- •Platform Support
- •Related Manuals
- •Related Resources
- •Verilog Resources
- •VHDL Resources
- •Overview of NCLaunch
- •Usage Concepts
- •Environment
- •Selection
- •Customization of File Types and Available Commands
- •Tools and Options
- •Saving and Restoring Data
- •Invocation and Command Syntax
- •NCLaunch Components
- •Importing a Design
- •Exporting a Design
- •Using NCLaunch
- •Menu Bar
- •File Menu
- •Edit Menu
- •Tools Menu
- •Utilities Menu
- •Plug-Ins Menu
- •Help Menu
- •File Browser
- •Library Browser
- •Console Window
- •Status Bar
- •Tool Bar
- •Customizing NCLaunch with Plug-Ins
- •Creating Plug-Ins
- •plugIndex File
- •The Initialization Script
- •Using Tk in Plug-ins
- •Hello World: A simple example
- •Editing and Creating Buttons

NCLaunch User Guide
Customizing NCLaunch with Plug-Ins
Object types can be any string. NCLaunch uses the following types: FILE, LIBRARY,
CELL, VIEW, and SNAPSHOT. Each of these types may have a subtype associated with it in the following form: FILE.vlog or VIEW.vhdl.
Valid selection types are replace, extend, deselect, deselect_all, begin_trans, and end_trans.
ncl_showhelp action helptext X Y
Shows balloon help and a message in the status region of the main window. Valid actions are enter, leave, motion, and button. X and Y should be specified in screen coordinates.
For example:
button .b
bind .b <Enter> {ncl_showhelp enter “this is help” %X %Y} bind .b <Motion> {ncl_showhelp motion “this is help” %X %Y} bind .b <Leave> {ncl_showhelp leave ““ %X %Y}
bind .b <Button> {ncl_showhelp button ““ %X %Y}
ncl_toolbar
Requests a frame from the NCLaunch tool bar. A toplevel embedded in the tool bar is returned.
ncl_queryselect pattern ...
Retrieves the current set of selected objects from NCLaunch. This includes any objects selected in plug-ins. The pattern is a glob style string which defaults to “*” if none is provided. The search is automatically extended to search subtypes. For example, ncl_search FILE finds all instances of FILE and FILE.* and merges the result into a sorted list. A list of objects is returned in the following form: {{name type index}
...} where index is the selection index.
removelistener event script
Removes a script from the list of scripts that are invoked when the specified event occurs.
Using Tk in Plug-ins
Tk is a Tcl graphical Tool Kit. Tk defines commands for buttons, windows, text entry fields, menus, etc.
December 2000 |
65 |
Product Version 3.2 |

NCLaunch User Guide
Customizing NCLaunch with Plug-Ins
To load Tk into a plug-in, call the ncl_loadtk command. The command loads Tk into the plug-ins interpreter and initializes various default colors and key bindings to work within
NCLaunch.
By default, a normal Tk application contains a top-level window named “.”. This window is reserved for future use and is not shown to the user. Any widgets added to “.” are ignored by NCLaunch. Use the toplevel command to create a top-level window for your plug-in. For example, toplevel .top -title “Top” creates a top-level window with Top written in the border surrounding the window.
Plug-in access to the NCLaunch main window is limited to requesting a menu from the main menu bar, or adding an icon to the tool bar.
Hello World: A simple example
#Title: Hello World
#File: plugIndex
#Author: J. Q. Programmer
#Version: 1.0 name hello_world version 1.0
description “Hello World example plug-in” author “J. Q. Programmer”
contact “Send mail to jqp@acompany.com\or call (555) 555-1212”
#defer the hard work to another file
#by using Tcls source command as the initialization script script [list source [file join $dir init.tcl]]
#Title: Hello World
#File: init.tcl
#Author: J. Q. Programmer
#Version: 1.0
puts “Hello World” ; # printed during initialization
addlistener shutdown {puts “Goodbye World”}
User Defined Buttons: A Sample NCLaunch Plug-In
The User Buttons plug-in was developed using the API described above. The plug-in allows you to define a set of buttons that invoke commands in the NCLaunch I/O region.
The User Buttons plug-in adds a Button menu to the NCLaunch Menu bar and requests space on the NCLaunch Tool bar for the buttons that are created. The buttons look as if they
December 2000 |
66 |
Product Version 3.2 |

NCLaunch User Guide
Customizing NCLaunch with Plug-Ins
are a part of NCLaunch, incorporating tool tips, and expanded help in the status bar. When you click one of these new buttons, the command is echoed into the I/O region and evaluated.
The plug-in writes out its button definitions to a file when it is shutdown. When the plug-in starts, it reads the button definition file and adds the buttons back into the main window. The button definition file is stored in your home directory in .nclaunch/userbuttons.ncb (on Windows platforms the leading period is removed). The plug-in also supports importing and exporting button definition files so that they can be shared between users.
Editing and Creating Buttons
Use the Button-Edit menu command to add, edit, delete, reorder, hide, or show buttons. The Edit Buttons window appears, as shown in Figure 3-1 on page 67.
Figure 3-1 Edit Buttons Window
December 2000 |
67 |
Product Version 3.2 |

NCLaunch User Guide
Customizing NCLaunch with Plug-Ins
Buttons that are hidden are removed from the tool bar, but are still stored in the button definition file.
Click the New... button to create a new button. The New Button window appears, as shown in Figure 3-2 on page 68.
Figure 3-2 New Button Window
A button should have a descriptive label. The command associated with the button can be any valid Tcl command. To invoke external programs, the exec Tcl command should be used. For example, exec netscape.
A button may have help text, which is shown as a tool tip and a message in the status bar. The help text is usually a longer description of the functionality of a button.
A button can be sensitive to selection. By default, the button is always enabled. Buttons can be enabled based on selection of files, libraries, cells, views, or snapshots. If the button is sensitive to selection, then the buttons Command field should contain %o or %O as a placeholder for the selected objects. %o represents the first selected object. %O represents all of the selected objects in the order that they were selected.
December 2000 |
68 |
Product Version 3.2 |