Revision: 42391
http://brlcad.svn.sourceforge.net/brlcad/?rev=42391&view=rev
Author: starseeker
Date: 2011-01-17 14:28:30 +0000 (Mon, 17 Jan 2011)
Log Message:
-----------
Try using package require for itcl/itk in bwish
Modified Paths:
--------------
brlcad/trunk/src/bwish/cadAppInit.c
brlcad/trunk/src/bwish/main.c
Modified: brlcad/trunk/src/bwish/cadAppInit.c
===================================================================
--- brlcad/trunk/src/bwish/cadAppInit.c 2011-01-17 14:26:55 UTC (rev 42390)
+++ brlcad/trunk/src/bwish/cadAppInit.c 2011-01-17 14:28:30 UTC (rev 42391)
@@ -31,10 +31,10 @@
#endif
#include "bio.h"
-#include "itcl.h"
+#include "tcl.h"
#ifdef BWISH
-# include "itk.h"
+# include "tk.h"
# include "dm.h"
# include "fb.h"
#endif
@@ -59,14 +59,14 @@
tclcad_auto_path(interp);
/* Initialize [incr Tcl] */
- if (Itcl_Init(interp) == TCL_ERROR) {
+ if (Tcl_Eval(interp, "package require Itcl") != TCL_OK) {
bu_log("Itcl_Init ERROR:\n%s\n", Tcl_GetStringResult(interp));
return TCL_ERROR;
}
#ifdef BWISH
/* Initialize [incr Tk] */
- if (Itk_Init(interp) == TCL_ERROR) {
+ if (Tcl_Eval(interp, "package require Itk") != TCL_OK) {
bu_log("Itk_Init ERROR:\n%s\n", Tcl_GetStringResult(interp));
return TCL_ERROR;
}
Modified: brlcad/trunk/src/bwish/main.c
===================================================================
--- brlcad/trunk/src/bwish/main.c 2011-01-17 14:26:55 UTC (rev 42390)
+++ brlcad/trunk/src/bwish/main.c 2011-01-17 14:28:30 UTC (rev 42391)
@@ -31,9 +31,7 @@
#include "tcl.h"
#ifdef BWISH
-# include "itk.h"
-#else
-# include "itcl.h"
+# include "tk.h"
#endif
#include "bu.h"
@@ -50,8 +48,10 @@
* the global namespace.. allow for easy means to disable the import.
*/
#define IMPORT_ITCL 1
-#define IMPORT_ITK 1
-#define IMPORT_IWIDGETS 1
+#ifdef BWISH
+# define IMPORT_ITK 1
+# define IMPORT_IWIDGETS 1
+#endif
extern int cmdInit(Tcl_Interp *interp);
extern void Cad_Main(int argc, char **argv, Tcl_AppInitProc (*appInitProc),
Tcl_Interp *interp);
@@ -121,7 +121,7 @@
/* Initialize [incr Tcl] */
Tcl_ResetResult(interp);
- if (init_itcl && Itcl_Init(interp) == TCL_ERROR) {
+ if (init_itcl && Tcl_Eval(interp, "package require Itcl") != TCL_OK) {
if (!try_auto_path) {
try_auto_path=1;
/* Itcl_Init() leaves initialization in a bad state
@@ -134,13 +134,12 @@
bu_log("Itcl_Init ERROR:\n%s\n", Tcl_GetStringResult(interp));
return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "Itcl", Itcl_Init, Itcl_SafeInit);
init_itcl=0;
#ifdef BWISH
/* Initialize [incr Tk] */
Tcl_ResetResult(interp);
- if (init_itk && Itk_Init(interp) == TCL_ERROR) {
+ if (init_itk && Tcl_Eval(interp, "package require Itk") != TCL_OK) {
if (!try_auto_path) {
try_auto_path=1;
continue;
@@ -148,7 +147,6 @@
bu_log("Itk_Init ERROR:\n%s\n", Tcl_GetStringResult(interp));
return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "Itk", Itk_Init, (Tcl_PackageInitProc *)
NULL);
init_itk=0;
#endif
@@ -280,6 +278,7 @@
{
/* Create the interpreter */
INTERP = Tcl_CreateInterp();
+ Tcl_FindExecutable(argv[0]);
Cad_Main(argc, argv, Cad_AppInit, INTERP);
return 0;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits