Go to main content

man pages section 3: Extended Library Functions, Volume 1

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Tk_SetAppName (3tk)

Name

Tk_SetAppName - Set the name of an application for 'send' commands

Synopsis

#include <tk.h>

const char *
Tk_SetAppName(tkwin, name)

Description

Tk_SetAppName(3tk)           Tk Library Procedures          Tk_SetAppName(3tk)



______________________________________________________________________________

NAME
       Tk_SetAppName - Set the name of an application for 'send' commands

SYNOPSIS
       #include <tk.h>

       const char *
       Tk_SetAppName(tkwin, name)

ARGUMENTS
       Tk_Window tkwin (in)           Token  for  window in application.  Used
                                      only to select a particular application.

       const char *name (in)          Name under which to register the  appli-
                                      cation.
______________________________________________________________________________

DESCRIPTION
       Tk_SetAppName  associates  a  name with a given application and records
       that association on the display containing with the application's  main
       window.   After  this procedure has been invoked, other applications on
       the display will be able to use the send command to  invoke  operations
       in  the  application.  If name is already in use by some other applica-
       tion on the display, then a new name will be generated by  appending  "
       #2"  to  name;   if this name is also in use, the number will be incre-
       mented until an unused name is found.  The return value from the proce-
       dure is a pointer to the name actually used.

       If  the  application  already  has a name when Tk_SetAppName is called,
       then the new name replaces the old name.

       Tk_SetAppName also adds a send  command  to  the  application's  inter-
       preter,  which  can  be  used to send commands from this application to
       others on any of the displays where the application has windows.

       The application's name registration persists until the  interpreter  is
       deleted  or the send command is deleted from interp, at which point the
       name is automatically unregistered and the application becomes inacces-
       sible  via send.  The application can be made accessible again by call-
       ing Tk_SetAppName.

       Tk_SetAppName is called automatically by Tk_Init,  so  applications  do
       not normally need to call it explicitly.

       The  command  tk appname provides Tcl-level access to the functionality
       of Tk_SetAppName.

KEYWORDS
       application, name, register, send command



ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | runtime/tk-8     |
       +---------------+------------------+
       |Stability      | Uncommitted      |
       +---------------+------------------+

NOTES
       Source code for open source software components in Oracle  Solaris  can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This    software    was    built    from    source     available     at
       https://github.com/oracle/solaris-userland.    The  original  community
       source        was        downloaded        from         https://source-
       forge.net/projects/tcl/files/Tcl/8.6.7/tk8.6.7-src.tar.gz/download.

       Further information about this software can be found on the open source
       community website at https://www.tcl.tk/.



Tk                                    4.0                   Tk_SetAppName(3tk)