[ author: Sascha Leuthold ]
[link to pic comming today]
UNDER CONSTRUCTION 4 May 2006
Using MFC Controls as Tk widgets and Combining GUI applications developed with Tk and 'native' Windows toolkits gives you an introduction, but it is not really a copy-paste implementation I was always looking for.
I saw this implemented in commercial applications, and asked myself: How did that work?
Somebody could ask, why embedding an MFC-Control into a Tk-toplevel:
I will show you one complete implementation on the windows platform. It would be great, if somebody would do something similar on Unix/Linux(X11). I used VC++6.0, Tcl/Tk 8.4 and build this successfully on Win98 and WinXP. Maybe MFC and VC++6.0 is out of fashion, but I think it is still a nice topic, and it can result in a nice designed application. And at the end, the Win32-API is older than MFC, so for me, Tk is the real out of date problem in this marriage. This design makes it possible, to build applications for Linux and Windows, with minimum platform-dependence.
[Tk frame in MFC] gives you an implementation on the other direction.
Comments are welcome considering implementation-details and discussions on the subject itselfs (widget embedding).
Is it possible to achieve the same aim easier?
We will end up in a *.exe, that sources a *.tcl.
Features
MFCinTk.tcl
code comming soon
comment
Derive CWinApp to host the application/thread/event-loop
CMfCinTk.h
code comming today
comment
CMfCinTk.cpp
code comming today
comment
Derive CFrameWnd, the MFC Control
CMainFrame.h
code comming today
comment
CMainFrame.cpp
code comming today
comment
The implementation is straight forward, but it took some time for me, to make it work. And I'm not so familar with MFC. I did not cut any code out, so you can see everything, e.g. the command-line proccessing. As a side note, I have no tcl installation on my machine. So consider defining tcl_library, and look for some fixed path-names in the code.
What do you think?