PreviousUpNext

15.4.1305  src/lib/tk/src/text_item_tree.pkg

/* ***********************************************************************

# Compiled by:
#     src/lib/tk/src/tk.sublib

   Project: sml/Tk: an Tk Toolkit for sml
   Author: Stefan Westmeier, University of Bremen
  $Date: 2001/03/30 13:38:59 $
  $Revision: 3.0 $
   Purpose of this file: Functions related to Text Widget Annotations 
                         in Widget Tree

   *********************************************************************** */

package   text_item_tree
: (weak)  Annotation_Tree               # Annotation_Tree       is from   src/lib/tk/src/text_item_tree.api
{
        stipulate
            include package   basic_tk_types;
        herein


            exception ANNOTATION_TREE  String;

            fun get wid tn
                =
                {
                    widg = widget_tree::get_widget_gui wid;
                    an  = text_item::get widg tn;
                
                    an;
                };

            fun upd wid tn an
                =
                {
                    widg  = widget_tree::get_widget_gui wid;
                    nwidg = text_item::upd widg tn an;
                
                    widget_tree::upd_widget_gui nwidg;
                };


            #  ### das ist noch falsch !!! 
            #  jetzt ist es besser --- aber ist es auch wirklich richtig ? 
            fun add wid (an as (TEXT_ITEM_WIDGET { text_item_id, ... } ))
                =>
                {
                    my (window, p) = paths::get_int_path_gui wid;
                    np      = p + ".txt." + text_item_id;
                    wids    = text_item::get_text_widget_subwidgets an;
                    widg    = widget_tree::get_widget_gui wid;
                    nwidg   = text_item::add widget_tree::pack_widget widg an;
                
                    { widget_tree::upd_widget_gui nwidg;
                     apply (widget_tree::add_widget_path_ass_gui window np) wids;};
                };

               add wid an
                =>
                {
                    widg  = widget_tree::get_widget_gui wid;
                    nwidg = text_item::add widget_tree::pack_widget widg an;
                
                    widget_tree::upd_widget_gui nwidg;
                }; end;

            fun delete wid tn
                =
                {
                    widg           = widget_tree::get_widget_gui wid;
                    nwidg          = text_item::delete widget_tree::delete_widget_gui widg tn;
                
                    widget_tree::upd_widget_gui nwidg;
                };


        end;

        fun get_configure wid tn
            =
            {
                widg = widget_tree::get_widget_gui wid;
                an   = text_item::get widg tn;
                cl   = text_item::sel_annotation_configure an;
            
                cl;
            };

        fun add_configure wid tn cf
            =
            {
                widg  = widget_tree::get_widget_gui wid;
                nwidg = text_item::add_annotation_configure widg tn cf;
            
                widget_tree::upd_widget_gui nwidg;
            };

        fun get_naming wid tn
            =
            {
                widg = widget_tree::get_widget_gui wid;
                an   = text_item::get widg tn;
                bl   = text_item::sel_annotation_naming an;
            
                bl;
            };

        fun add_naming wid tn bi
            =
            {
                widg  = widget_tree::get_widget_gui wid;
                nwidg = text_item::add_annotation_naming widg tn bi;
            
                widget_tree::upd_widget_gui nwidg;
            };


        fun read_selection wid
            =
            {
                widg = widget_tree::get_widget_gui wid;
                ml   = text_item::read_selection widg;
            
                ml;
            };

        fun read_marks wid
            =
            {
                widg = widget_tree::get_widget_gui wid;
                ml   = text_item::read_marks widg;
            
                ml;
            };



    };


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext