tk_getOpenFile and a question on close btn

2001-09-21
2002-03-01
  • Mitch Conant

    Mitch Conant - 2001-09-21

    First off, thanks! Contributors to this list got me started in vtcl...what a great product! I havent programmed for about 5 years, I'm having a blast...

    Two questions for you. I'm using the latest vtcl in the Windows environment.

    First, is there a way to disable the close button on the top windows? I create a splash screen that I do not want destroyed. If it gets destroyed (close button) then when I push the About button (it uses the splash screen objects) it fails since the objects have been destroyed.

    Second, is there an equivalent of the tk_getOpenFile module, that will allow me to select multiple files using shift and control-click?

    Thanks in advance,
    Mitch

     
    • Christian Gavin

      Christian Gavin - 2002-02-24

      If using vTcl 1.5.2 / 1.6, you can use the <<DeleteWindow>> virtual event on toplevels.

      Add this event using the bindings editor (Insert / Advanced), then the event code should be:

      break

      This will prevent the vTcl toplevel code from closing the window.

       
      • Mitch Conant

        Mitch Conant - 2002-02-25

        Gavin,

        Thanks for the followup. I am on 1.5.2 VTCL for Windows (NT 4.0 SP 6. When I go into the Binding editor for the toplevel window (.Top41) there is no <<DeleteWindow>> virtual event. The closest thing there is the Destroy event. That doesn't work.

        I tried creating an event named <<DeleteWindow>> but that netted no success either.

        Thank you for your continuing support.

        Do you know anything about wrapping this project to create an EXE file (Prowrap, part of TclPro 1.4)? I use itcl/itk 3.2 (with iwidgets 3.0.1) and the fileutil package. If I do a standard prowrap it can't find the iwidgets 3.0.1 "stuff" and I'm assuming the fileutil "stuff" either (if I could get that far).

        If this is not the correct forum for that discussion, I apologize in advance of your reply.

         
    • Christian Gavin

      Christian Gavin - 2002-02-27

      First, make sure that for your toplevel, there is a _TopLevel tag displayed in the left pane of the bindings editor.

      If not, create a new toplevel and destroy it right away (this will make the tag appear). Then in the bindings editor, select Add / Tag... and select _TopLevel.

      To define a <<DeleteWindow>> handler, select the tag with the toplevel path (eg. .top34) then use Insert / Advanced... In the dialog box, type <<DeleteWindow>> and press the "Add" button.

      I haven't used Prowrap so I don't know the details. Normally there should be a version with Itcl/Tk included. Also if the fileutil package is not included in Prowrap, you need to wrap its files with the project (assuming fileutil has been written in pure tcl). Try asking on the mailing list if someone uses Prowrap.

       
      • Mitch Conant

        Mitch Conant - 2002-02-28

        Gavin,

        I got the Prowrap to work. It's pretty slick. Makes distribution a breeze.

        I figured out that you can actually add virtual events while playing around with the <<Show>> event. Thanks for your input on the <<Delete>> event.

        The other thing that I got working tonight was how to add a generic iwidgets::spinner to the button bar. I just modified the .wgt file for the spinint object and saved it as spinner. next I created the icon_spinner.gif than finally modified lib_itcl.tcl. That procedure seemed to work. Did I miss anything? Is there an easier way?

        The more I work with VTCL the more impressed I am at how easy it is to do some of these things. Some things, like the virtual events come a little slower. Again, thanks for all of your support in this forum, I for one appreciate it.

        Mitch

         
    • Christian Gavin

      Christian Gavin - 2002-03-01

      Your way to add a widget is correct. Create a new .wgt file and a corresponding icon, then modify the lib_itcl.tcl file.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks