TABLE OF CONTENTS


TkAda/Option [ Packages ]

[ Top ] [ TkAda ] [ Packages ]

FUNCTION

 Provides code for manipulate Tk command Option

SOURCE

package Tcl.Tk.Ada.Option with
   SPARK_Mode
is

Option/Option.Add [ Subprograms ]

[ Top ] [ Option ] [ Subprograms ]

FUNCTION

 Add a new option to the database

SOURCE

   procedure Add
     (Interp: in Tcl_Interp; Pattern, Value: in String;
      OPriority: in String := "interactive") with
      Pre => Pattern /= "" and Value /= "";

PARAMETERS

 Interp    - Tcl interpreter on which the new option will be added
 Pattern   - The option which will be added
 Value     - Value of the option to add
 OPriority - Priority of the new option. Can be empty. Default value is
             interactive

EXAMPLE

   -- Add option *Button.foreground with value red on current Tcl interpreter
   Add(Get_Context, "*Button.foreground", "red");

COMMANDS

 option add pattern value priority

HISTORY

 8.6.7 - Added

Option/Option.Clear [ Subprograms ]

[ Top ] [ Option ] [ Subprograms ]

FUNCTION

 Clear option's database

SOURCE

   procedure Clear(Interp: in Tcl_Interp);

PARAMETERS

 Interp - Tcl interpreter on which option's database will be cleared

EXAMPLE

      -- Clear the options database on My_Interpreter interpreter
      Clear(My_Interpreter);

COMMANDS

 option clear

HISTORY

 8.6.7 - Added

Option/Option.Get [ Subprograms ]

[ Top ] [ Option ] [ Subprograms ]

FUNCTION

 Get the value of the selected option

SOURCE

   function Get
     (Window: in Tk_Widget'Class; Name, Class: in String) return String with
      Pre => Name /= "" and Class /= "";

PARAMETERS

 Window - Tk_Widget which will be queried for option
 Name   - The name of the option to get
 Class  - The class of the option to get

RESULT

 The value of the selected option or {} if no option was found

EXAMPLE

   -- Get the returnCommand value of the class Command of the window My_Window
   Value: constant String := Get(My_Window, "returnValue", "Command");

COMMANDS

 option get window name class

HISTORY

 8.6.7 - Added

Option/Option.Read_File [ Subprograms ]

[ Top ] [ Option ] [ Subprograms ]

FUNCTION

 Read file and add all the options from it to the options database

SOURCE

   procedure Read_File
     (Interp: in Tcl_Interp; FileName: in String;
      OPriority: in String := "interactive") with
      Pre => FileName /= "";

PARAMETERS

 Interp    - Tcl interpreter on which options will be loaded
 FileName  - Name of the file with options to load
 OPriority - Priority of the loaded option. Can be empty. Default value
             is interactive

EXAMPLE

      -- Read the file .Xdefaults at userDefault priority on My_Interpreter interpreter
      Read_File(My_Interpreter, ".Xdefaults", "userDefault");

COMMANDS

 option readfile fileName priority

HISTORY

 8.6.7 - Added