C++/Tk
A complete C++ interface to the Tk GUI toolkit
SourceForge.net Logo

Home
Download
Documentation
Examples
People
Events
Links
Example: [1] [2] [3] [4] [5] [6]

Screenshot:

Example1

What it does:

It just displays the label.

Source code:

#include "cpptk.h"
#include <iostream>

using namespace Tk;
using namespace std;

int main(int, char *argv[])
{
     try
     {
          init(argv[0]);
         
          label(".l") -text("Hello C++/Tk!");
          pack(".l") -padx(20) -pady(6);
         
          runEventLoop();
     }
     catch (exception const &e)
     {
          cerr << "Error: " << e.what() << '\n';
     }
}