4

Is there a way to program a GUI with tkinter through C++? I'm asking this because I know how to program with tkinter in Python, but for my app I could not use Python.

If not, I want to develop a GUI app in C++ that could use MySQL to display and store info, I want to make some drawings (canvas) that could be scaled like in tkinter and also interact with some hardware. I want to use this in a Raspberry or a Parallella board. I know that there is wxWidgets and GTK+, which of those could be better for my app? Which is easiest to use? Is there any other easier solution?

Antonio Davila
  • 47
  • 1
  • 1
  • 3

1 Answers1

7

Tkinter is just a thin python wrapper around a tcl interpreter with the tk library. Tcl and tk are both libraries written in C, and were originally designed to be embedded in other applications. Tcl/tk has been embedded in Python, Perl, wish (the tcl/tk windowing shell), even some cisco routers and the original tivo boxes. It is also very popular in the EDA world.

For some basic information on what it takes to do the embedding, see Adding Tcl/Tk to a C application on the tcl'ers wiki.

For a tool that is designed to help with the task see Mktclapp: A Tool For Building C/C++ Programs That Use Tcl/Tk

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685