PreviousUpNext

15.4.1242  src/lib/tk/src/c_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: $Date: 2001/03/30 13:39:04 $
   Revision: $Revision: 3.0 $
   Purpose of this file: Functions related to Canvas Items in Widget Tree

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

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


            exception CANVAS_ITEM_TREE  String;

            fun get wid cid =
                {
                    widg = widget_tree::get_widget_gui wid;
                    cit  = canvas_item::get widg cid;
                
                    cit;
                };

            fun upd wid cid cit =
                {
                    widg  = widget_tree::get_widget_gui wid;
                    nwidg = canvas_item::upd widg cid cit;
                
                    widget_tree::upd_widget_gui nwidg;
                };

            #  ### das ist noch falsch !!! 
            #  jetzt ist es besser --- aber ist es auch wirklich richtig ? 
            fun add wid (cit as (CANVAS_WIDGET _)) =>
                {
                    my (window, p) = paths::get_int_path_gui wid;
                    np      = p + ".cnv." + (canvas_item::get_canvas_item_id cit);
                    wids    = canvas_item::get_canvas_item_subwidgets cit;
                    widg    = widget_tree::get_widget_gui wid;
                    nwidg   = canvas_item::add widget_tree::pack_widget widg cit;
                
                    { widget_tree::upd_widget_gui nwidg;
                     apply (widget_tree::add_widget_path_ass_gui window np) wids;};
                };
               add wid cit =>
                {
                    widg  = widget_tree::get_widget_gui wid;
                    nwidg = canvas_item::add widget_tree::pack_widget widg cit;
                
                    widget_tree::upd_widget_gui nwidg;
                }; end;

            fun delete wid cid =
                {
                    widg           = widget_tree::get_widget_gui wid;
                    nwidg          = canvas_item::delete widget_tree::delete_widget_gui widg cid;
                
                    widget_tree::upd_widget_gui nwidg;
                };


            fun get_configure wid cid =
                {
                    widg = widget_tree::get_widget_gui wid;
                    cit  = canvas_item::get widg cid;
                    cl   = canvas_item::sel_item_configure cit;
                
                    cl;
                };

            fun add_configure wid cid cf =
                {
                    widg  = widget_tree::get_widget_gui wid;
                    nwidg = canvas_item::add_item_configure widg cid cf;
                
                    widget_tree::upd_widget_gui nwidg;
                };

            fun print_canvas cid confs =
                    canvas_item::print_canvas_widget cid confs;

            fun get_naming wid cid =
                {
                    widg = widget_tree::get_widget_gui wid;
                    cit  = canvas_item::get widg cid;
                    cl   = canvas_item::sel_item_naming cit;
                
                    cl;
                };

            fun add_naming wid cid bi =
                {
                    widg  = widget_tree::get_widget_gui wid;
                    nwidg = canvas_item::add_item_naming widg cid bi;
                
                    widget_tree::upd_widget_gui nwidg;
                };


            fun get_coords wid cid =
                {
                    widg = widget_tree::get_widget_gui wid;
                    col  = canvas_item::get_coords widg cid;
                
                    col;
                };

            fun set_coords wid cid col = 
                {
                    widg = widget_tree::get_widget_gui wid;
                
                    canvas_item::set_coords widg cid col;
                };

            fun get_width wid cid =
                {
                    widg = widget_tree::get_widget_gui wid;
                    w  = canvas_item::get_width widg cid;
                
                    w;
                };

            fun get_height wid cid =
                {
                    widg = widget_tree::get_widget_gui wid;
                    w  = canvas_item::get_height widg cid;
                
                    w;
                };

            get_icon_width  = canvas_item::get_icon_width;
            get_icon_height = canvas_item::get_icon_height;



            fun move wid cid delta
                = 
                {
                    widg = widget_tree::get_widget_gui wid;
                
                    canvas_item::move widg cid delta;
                };

        end;

    };


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext