Revision: 41011
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41011&view=rev
Author:   starseeker
Date:     2010-10-15 22:03:32 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
Archer wasn't working with vanilla Itk now present in cmake branch - work 
around this thanks to Bob Parker by redefining the key class at the startup 
phase of archer.  Still need to examine changes made to itcl/itk in BRL-CAD, 
but we'll try to use this approach to make things work with completely vanilla 
system installs rather than require local itcl/itk builds to run archer.  Very 
good progress - thanks Bob!  Also use package require tkpng everywhere but 
windows - need to use it there too but currently can't verify if it works.

Modified Paths:
--------------
    brlcad/branches/cmake/src/archer/CMakeLists.txt
    brlcad/branches/cmake/src/archer/archer
    brlcad/branches/cmake/src/tclscripts/archer/LoadArcherLibs.tcl

Added Paths:
-----------
    brlcad/branches/cmake/src/archer/itk_redefines.tcl

Modified: brlcad/branches/cmake/src/archer/CMakeLists.txt
===================================================================
--- brlcad/branches/cmake/src/archer/CMakeLists.txt     2010-10-15 21:23:49 UTC 
(rev 41010)
+++ brlcad/branches/cmake/src/archer/CMakeLists.txt     2010-10-15 22:03:32 UTC 
(rev 41011)
@@ -1,4 +1,5 @@
 INSTALL(PROGRAMS archer DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+INSTALL(FILES itk_redefines.tcl DESTINATION 
${${CMAKE_PROJECT_NAME}_INSTALL_DATA_DIR}/tclscripts)
 
 set(archer_plugins
   plugins/utility.tcl

Modified: brlcad/branches/cmake/src/archer/archer
===================================================================
--- brlcad/branches/cmake/src/archer/archer     2010-10-15 21:23:49 UTC (rev 
41010)
+++ brlcad/branches/cmake/src/archer/archer     2010-10-15 22:03:32 UTC (rev 
41011)
@@ -58,6 +58,9 @@
 #\
 exec $WISH $0 $@
 
+# Itk's default class doesn't keep the menu, but Archer needs it - redefine 
itk:Toplevel
+source [file join [bu_brlcad_data "tclscripts"] itk_redefines.tcl]
+
 # Set ttk theme
 if {[tk windowingsystem] eq "aqua"} {
    ::ttk::style theme use aqua

Added: brlcad/branches/cmake/src/archer/itk_redefines.tcl
===================================================================
--- brlcad/branches/cmake/src/archer/itk_redefines.tcl                          
(rev 0)
+++ brlcad/branches/cmake/src/archer/itk_redefines.tcl  2010-10-15 22:03:32 UTC 
(rev 41011)
@@ -0,0 +1,53 @@
+itcl::delete class itk::Toplevel
+
+itcl::class itk::Toplevel {
+    inherit itk::Archetype
+
+    constructor {args} {
+        #
+        #  Create a toplevel window with the same name as this object
+        #
+        set itk_hull [namespace tail $this]
+        set itk_interior $itk_hull
+
+        itk_component add hull {
+            toplevel $itk_hull -class [namespace tail [info class]]
+        } {
+            keep -menu -background -cursor -takefocus
+        }
+        bind itk-delete-$itk_hull <Destroy> [list itcl::delete object $this]
+
+        set tags [bindtags $itk_hull]
+        bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull]
+
+        eval itk_initialize $args
+    }
+
+    destructor {
+        if {[winfo exists $itk_hull]} {
+            set tags [bindtags $itk_hull]
+            set i [lsearch $tags itk-delete-$itk_hull]
+            if {$i >= 0} {
+                bindtags $itk_hull [lreplace $tags $i $i]
+            }
+            destroy $itk_hull
+        }
+        itk_component delete hull
+
+        set components [component]
+        foreach component $components {
+            set path($component) [component $component]
+        }
+        foreach component $components {
+            if {[winfo exists $path($component)]} {
+                destroy $path($component)
+            }
+        }
+    }
+
+    itk_option define -title title Title "" {
+        wm title $itk_hull $itk_option(-title)
+    }
+
+    private variable itk_hull ""
+}


Property changes on: brlcad/branches/cmake/src/archer/itk_redefines.tcl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Modified: brlcad/branches/cmake/src/tclscripts/archer/LoadArcherLibs.tcl
===================================================================
--- brlcad/branches/cmake/src/tclscripts/archer/LoadArcherLibs.tcl      
2010-10-15 21:23:49 UTC (rev 41010)
+++ brlcad/branches/cmake/src/tclscripts/archer/LoadArcherLibs.tcl      
2010-10-15 22:03:32 UTC (rev 41011)
@@ -33,29 +33,24 @@
     if {$tcl_platform(platform) == "windows"} {
        set ext "dll"
        set tkpngdir [bu_brlcad_root "bin"]
+        # can't use sharedlibextension without changing tkpng build
+        if {![file exists [file join $tkpngdir tkpng.$ext]]} {
+          puts "ERROR: Unable to initialize ArcherCore imagery"
+          exit 1
+        }
+        load [file join $tkpngdir tkpng.$ext]
     } else {
-       set ext "so"
-       set tkpngdir [bu_brlcad_root "lib"]
-       if {![file exists $tkpngdir]} {
-           set tkpngdir [file join [bu_brlcad_data "src"] other tkpng .libs]
-       }
+       package require tkpng
     }
 
-    # can't use sharedlibextension without changing tkpng build
-    if {![file exists [file join $tkpngdir tkpng.$ext]]} {
-       puts "ERROR: Unable to initialize ArcherCore imagery"
-       exit 1
-    }
+    package require hv3 0.1
 
-    load [file join $tkpngdir tkpng.$ext]
-
     if { [catch {package require Swidgets} _initialized] } {
        puts "$_initialized"
        puts ""
        puts "ERROR: Unable to load ArcherCore Scripting"
        exit 1
     }
-    package require hv3 0.1
 }
 
 proc LoadArcherLibs {} {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to