Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This script creates a button inside a window. When you click this button a new information window will pop up, saying "Hello World!".


Image Added

Panel
borderColor#404040
bgColor#F0F0F0
borderWidth1
titleStart a new script
borderStyledashed
  • Click File > New > Text Editor

This will create a new empty text editor where the graphics window used to be.

...

No Format
borderColor#404040
bgColor#F0F0F0
borderWidth1
titleCreate a toplevel window
borderStyledashed

set w [qwidget ]

A window in QTcl is an instance of a QWidget object, hence the command name. It may be followed by a list of flags. Although rarely used, the flags can be used to modify the widgets look and behaviour. The next statement tells QTcl to delete the widget from memory when it is closed:

...

This command displays a simple information dialog with an 'OK' button, as seen below.
Image Removed

So far we have created the window and the button in memory. No window is yet visible on the screen. To make the window visible we have to invoke the final qshow command.

...