Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

vtcl, Tile and VTK

Help
Carlos BR
2007-05-15
2013-05-08
  • Carlos BR
    Carlos BR
    2007-05-15

    Hello, I am using Vtcl for about 6 months and have created an user interface for a scientific application. This was a first step in the process, now I need some help on understanding how I can:

    1) add suport to the Tile lib on Vtcl (http://tktable.sourceforge.net/tile/index.html), to make it look more user friendly and resize the widgets automatically, instead of using fixed TopLevel sizes,

    2) work with VisualTool Kit (VTK - http://www.vtk.org/\) libraries inside Vtcl, so I can see and interact with 3D visualization data.

    I now this is quite ambitious, but the Tile support would be nice to begin with. Any ideas ?

    Thanks a lot!

    Carlos - Brazil

     
    • Nuno João
      Nuno João
      2007-05-16

      Hi Carlos,

      Concerning 1), it can actually be split into 2 different things: a) Make it look better by adding new widgets; b) Make the application "resizable".
      For a), I'm almost sure it is possible, since vTcl already supports several sets of widgets; I'm not inside on how it works but it should be little less than add a new directory under lib/Widgets and instruct vTcl to load the new lib.
      As for b), just the fact of having a different set of widgets isn't enough to create resizeable applications, because the layout is managed by layout managers, which are independent of the widgets themselves. You can create resizable applications with vTcl today, by choosing a layout manager different from "place", however, the interface vTcl provides is very far from friendly (I personally wouldn't recommend using it for anything but a simple 1-toplevel application) and won't change anytime soon. Also, you would have to completely remake the GUI on your application.

      Concerning integration with VisualToolkit, the site is having problems and I'm unable to access it to see exactly what it is.

      Cheers! (adeus ;)!)

       
    • Carlos BR
      Carlos BR
      2007-05-16

      Hey there nmjoao, really appreciate your post.

      I know there might be a way so VTCL can use the Tile lib, but I jus't can't find that information anywhere! In the last version ( I am using version 1.6.1a1 ) there's a file in the /lib directory named "lib_user.tcl" and I figure its there where I can put information about the Tile lib so vtcl uses it. But I just don't understand it... Could you help me, I posted the content of the file at the end of this message.

      I've tried placing "tile.tcl" instead of "lib_user" but it didn't work.

      Well, thanks anyway !

      And the VTK site should work with this link: www.vtk.org

      Carlos

      --------------------------------------------------------------------------------------
      ##############################################################################
      # $Id: lib_user.tcl,v 1.7 2005/12/05 06:58:31 kenparkerjr Exp $
      #
      # lib_user.tcl - User-defined tcl/tk widget support library
      #
      # Copyright (C) 1996-1998 Damon Courtney

      proc vTcl:lib_user:init {} {
          return 1
      }

      proc vTcl:widget:lib:lib_user {args} {
          global vTcl widgets classes

          if {![info exists vTcl(lib_user,classes)]} { return }

          vTcl:lib:add_widgets_to_toolbar $vTcl(lib_user, classes) $vTcl(lib_user,classes)

      --------------------------------------------------------------------------------------

       
      • Nuno João
        Nuno João
        2007-05-18

        Hi Carlos,

        For what I've seen so far, to add a library to vTcl you need to (suppose it's named 'tile'):

        1) Create file lib_tile.tcl
        2) Create directory lib/Widgets/tile, where the library's widget description files will e stored
        3) Open vTcl and go to File -> Preferences -> Libraries (Tab), the new tile lib should be there, but it is still unchecked; check it and re-open vTcl. By now you should have a new entry in the widget toolbar.

        Each widget on the library that you want to use should have a description file under the lib's directory, extension .wgt (like the other libs). But now things get trickier, there's a lot to learn on what should/can be done in the .wgt files...

        The minimal lib_tile.tcl can be:
        ------------------------
        proc vTcl:lib_tile:init {} {
            global vTcl
            if [catch { package require tile }]  {
                return 0
            }
            lappend vTcl(libNames) "Tile Widget Library"
            return 1
        }

        proc vTcl:widget:lib:lib_tile {args} {
        }
        ------------------------

        I detected a small bug when trying these things. If you don't configure an icon image (for the widget toolbar) in the .wgt files, by default vTcl will get an icon_unknown.gif. However, there's a mismatch on the filename, which exists as images/unknown.gif. Just rename it. I'll fix that on the CVS.

        And that's what I can say you now.

        Adeus,
        Nuno

         
    • Nuno João
      Nuno João
      2007-05-18

      Ups, sorry, the correct vTcl:widget:lib:lib_tile is:

      proc vTcl:widget:lib:lib_tile {args} {
          # list of widget names
          set order {
              TileWid1
              TileWid2
          }

          vTcl:lib:add_widgets_to_toolbar $order tile  "Tile widgets"
      }

      The widgets mentioned in order should match the .wgt files.