+2001-01-31 Fernando Nasser <fnasser@redhat.com>
+
+ * library/plugins/rhabout.tcl: Add load for optional sample C command
+ procedure.
+ * library/plugins/rhabout/rhabout.itcl (constructor): Try calling
+ optional sample C command procedure rhabout_extra_text.
+ * library/plugins/rhabout/rhabout.c: New file. Implement an example
+ plug-in shared library with a sample C command procedure.
+ * library/plugins/rhabout/Makefile: New file. Makefile for the sample
+ shared library above (Linux only).
+
2001-01-28 Fernando Nasser <fnasser@redhat.com>
* library/plugins: New directory. Sample plug-in directory to help
package provide RHABOUT 1.0
set dirname [file dirname [info script]]
lappend auto_path [file join $dirname rhabout]
+catch {load [file join $dirname rhabout rhabout.so]}
--- /dev/null
+TCL_CFLAGS = -I/home/fnasser/DEVO/insight-sourceware/src/tcl/generic
+TCL = -L/home/fnasser/BUILD/insight-sourceware/native/tcl/unix -ltcl8.0
+
+PRE=
+POS= ".so"
+
+rhabout: rhabout.c
+ gcc -fPIC $(TCL_CFLAGS) -I. -o rhabout.o -c rhabout.c
+ gcc -shared -o rhabout$(POS) rhabout.o $(TCL)
--- /dev/null
+/* Sample command procedure library for a plug-in. */
+
+/* You have to include the Tcl headers, of course. */
+#include <tcl.h>
+
+/* Define the functions that implement your commands as required by Tcl */
+
+int extra_text (ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[]);
+
+/* Here you actually do whatever you want, like calling your target
+ libraries etc. Here we just return a string. */
+
+int
+extra_text (ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
+{
+ interp->result = "\nThis is a sample plug-in\n";
+ return TCL_OK;
+}
+
+/* Initialization function required in Tcl libraries. */
+
+int
+Rhabout_Init (Tcl_Interp *interp)
+{
+ /* Register your command as a Tcl command with this interpreter. */
+ Tcl_CreateCommand (interp, "rhabout_extra_text", extra_text,
+ (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+
+ return TCL_OK;
+}
set f [frame $itk_interior.f]
label $f.image1 -bg white -image \
[image create photo -file [file join $gdb_ImageDir insight.gif]]
- message $f.m -bg white -fg black -text [gdb_cmd {show version}] -aspect 500 -relief flat
+
+ # Here we call an interface function provided by GDBTCL
+ set text [gdb_cmd {show version}]
+
+ # Here we call a command procedure that we created, if it exists
+ catch {append text [rhabout_extra_text]}
+
+ message $f.m -bg white -fg black -text $text -aspect 500 -relief flat
pack $f.image1 $f.m $itk_interior.f -fill both -expand yes
pack $itk_interior
bind $f.image1 <1> [code $this unpost]