harish tk - GRAPHICAL USER INTERFACES WITH TCL/TK INTRODUCTION Tcl stands for tool command language and is pronounced tickle is a simple scripting

harish tk - GRAPHICAL USER INTERFACES WITH TCL/TK...

This preview shows page 1 - 6 out of 19 pages.

GRAPHICAL USER INTERFACES WITH TCL/TK
Image of page 1

Subscribe to view the full document.

INTRODUCTION Tcl stands for “tool command language” and is pronounced “tickle”; is a simple scripting language for controlling and extending applications. One of the most useful extensions to Tcl is Tk. It is a toolkit for the X Window System,and its name is pronounced “tee-kay”. Tk extends the core Tcl facilities with additional commands for building user interfaces, so that you can construct Motif user interfaces by writing Tcl scripts instead of C code. Tk provides a particularly interesting set of commands to use  with Tcl’s programming tools. Tk’s commands allow you to create  graphical user interface.
Image of page 2
CONTINUE………. If Tcl and Tk have been installed on your system then you can invoke wish from your shell just like tclsh; it will display a small empty window on your screen and then read commands from standard input. The basic building block for a graphical user interface in Tk is a widget . A widget is a window with a particular appearance and behavior (the terms “widget” and “window” are used synonymously in Tk). Widgets are divided into classes such as buttons, menus, and scrollbars. All the widgets in the same class have the same general appearance and behavior. For example, all button widgets display a text string or bitmap and execute a particular Tcl command when they are invoked with the mouse.
Image of page 3

Subscribe to view the full document.

CONTINUE….. Widgets are organized hierarchically in Tk, with names that reflect their position in the hierarchy. The main widget , which appeared on the screen when you started wish, has the name “.”. The name .b refers to a child of the main widget. Widget names in Tk are like file names in UNIX except that they use “.” as a separator character instead of “/”. Thus .a.b.c refers to a widget that is a child of widget .a.b, which in turn is a child of.a, which is a child of the main widget. Widgets are under the control of a geometry manager that controls their size and location on the screen . The main trick with any geometry manger is that you use frame widgets as containers for other widgets. One or more widgets are created and then arranged in a frame by a geometry manager.
Image of page 4
CONTINUE… Pairs of arguments are used to specify the attributes of a widget. The
Image of page 5

Subscribe to view the full document.

Image of page 6
  • Spring '12
  • aaa
  • Frame, Pack, tk, Widget toolkit, widget

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes