www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Thread safe GUI/ MFC like Approach

reply BLS <nanali nospam-wanadoo.fr> writes:
During my /investigations/ regarding : What GUI do I need to create an 
realtime/collaboration IDE I found out that the MS MFC approach is not 
that bad.

In case that there is some interest I could add a page to the D WIKI
showing the use of :

CriticalSection/Mutex
Thread Local Storage
CBT (computer based training) Hooks. (in our case, Invoked before 
WM_NCCREATE)

together they'll make a thread safe GUI, using common D stuff like :

class Window
{
package :
   static Window[HWND] wndMap; //

....
etc. The important point is that :

one thread's Window is not present in other threads' HWND-to-wndMap !
=====================================================================
Just let me know if this a matter of interest and I'll give it a go
Bjoern
post scriptum
As you can imagine an IDE needs IDLE events to do all the "lookup-work"
most probabely using fibers... so the code can't be agnostic. Means 
Tango will be used  ... Ahem, hope I'am not picking on your nerves
'cause of the cross posting.
Dec 30 2007
next sibling parent reply "Janice Caron" <caron800 googlemail.com> writes:
On 12/31/07, BLS <nanali nospam-wanadoo.fr> wrote:
 the MS MFC approach
"Microsoft Microsoft Foundation Classes"? Isn't one Microsoft enough? :-)
Dec 30 2007
parent "Bruce Adams" <tortoise_74 yeah.who.co.uk> writes:
On Mon, 31 Dec 2007 07:34:50 -0000, Janice Caron <caron800 googlemail.com>  
wrote:

 On 12/31/07, BLS <nanali nospam-wanadoo.fr> wrote:
 the MS MFC approach
"Microsoft Microsoft Foundation Classes"? Isn't one Microsoft enough? :-)
Isn't one Microsoft too much?
Dec 31 2007
prev sibling next sibling parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
BLS wrote:
 During my /investigations/ regarding : What GUI do I need to create an 
 realtime/collaboration IDE I found out that the MS MFC approach is not 
 that bad.
 
 In case that there is some interest I could add a page to the D WIKI
 showing the use of :
 
 CriticalSection/Mutex
 Thread Local Storage
 CBT (computer based training) Hooks. (in our case, Invoked before 
 WM_NCCREATE)
Will it work on a non-Windows platform? I don't know if this is useful at all or not, but here's a multithreaded GUI lib that's been this one guy's pet project for the past 10 years or so. Nothing to do with D, but I used to hang out on the Fox toolkit where this fellow posted about his TnFOX project regularly. From what I understand using lots of threads for the GUI is a big point of it. --bb
Dec 31 2007
next sibling parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Bill Baxter wrote:
 BLS wrote:
 During my /investigations/ regarding : What GUI do I need to create an 
 realtime/collaboration IDE I found out that the MS MFC approach is not 
 that bad.

 In case that there is some interest I could add a page to the D WIKI
 showing the use of :

 CriticalSection/Mutex
 Thread Local Storage
 CBT (computer based training) Hooks. (in our case, Invoked before 
 WM_NCCREATE)
Will it work on a non-Windows platform? I don't know if this is useful at all or not, but here's a multithreaded GUI lib that's been this one guy's pet project for the past 10 years or so. Nothing to do with D, but I used to hang out on the Fox toolkit where this fellow posted about his TnFOX project regularly. From what I understand using lots of threads for the GUI is a big point of it.
Oops forgot the link: http://www.nedprod.com/TnFOX/ --bb
Dec 31 2007
prev sibling parent reply BLS <nanali nospam-wanadoo.fr> writes:
Bill Baxter schrieb:
 BLS wrote:
 During my /investigations/ regarding : What GUI do I need to create an 
 realtime/collaboration IDE I found out that the MS MFC approach is not 
 that bad.

 In case that there is some interest I could add a page to the D WIKI
 showing the use of :

 CriticalSection/Mutex
 Thread Local Storage
 CBT (computer based training) Hooks. (in our case, Invoked before 
 WM_NCCREATE)
Will it work on a non-Windows platform? I don't know if this is useful at all or not, but here's a multithreaded GUI lib that's been this one guy's pet project for the past 10 years or so. Nothing to do with D, but I used to hang out on the Fox toolkit where this fellow posted about his TnFOX project regularly. From what I understand using lots of threads for the GUI is a big point of it. --bb
Windows only ! Why ? Because : What I want is a GUI especial made to satisfy IDE requirements. thread-safe, multi screen support - tabbed mdi and docking. (fast, and a freaking cool Look and Feel) This is (at least for me) a huge project, means, making it platform independent by a single human beeing is impossible. Happy new year and thanks for the fish, er... link :) Bjoern
Dec 31 2007
parent reply CptJack <cptjack nospam.net> writes:
BLS Wrote:

 Bill Baxter schrieb:
 
 Will it work on a non-Windows platform?
 
 I don't know if this is useful at all or not, but here's a multithreaded 
 GUI lib that's been this one guy's pet project for the past 10 years or 
 so.  Nothing to do with D, but I used to hang out on the Fox toolkit 
 where this fellow posted about his TnFOX project regularly.  From what I 
 understand using lots of threads for the GUI is a big point of it.
 
 --bb
Windows only ! Why ? Because : What I want is a GUI especial made to satisfy IDE requirements. thread-safe, multi screen support - tabbed mdi and docking. (fast, and a freaking cool Look and Feel) This is (at least for me) a huge project, means, making it platform independent by a single human beeing is impossible. Happy new year and thanks for the fish, er... link :) Bjoern
Sorry, I just don't understand your reasoning here. If a GUI toolkit satisfies your requirements, what does it matter if it's "Windows only" or not? It seems to me that Qt fulfills all your requirements, and Qt certainly isn't "Windows only". It's your project, so you don't have build it on any platform you don't want to, but saying your IDE HAS to be "Windows only !" because of your GUI toolkit requirements is not being realistic.
Dec 31 2007
parent BLS <nanali nospam-wanadoo.fr> writes:
CptJack schrieb:
 BLS Wrote:
 
 Bill Baxter schrieb:
 Will it work on a non-Windows platform?

 I don't know if this is useful at all or not, but here's a multithreaded 
 GUI lib that's been this one guy's pet project for the past 10 years or 
 so.  Nothing to do with D, but I used to hang out on the Fox toolkit 
 where this fellow posted about his TnFOX project regularly.  From what I 
 understand using lots of threads for the GUI is a big point of it.

 --bb
Windows only ! Why ? Because : What I want is a GUI especial made to satisfy IDE requirements. thread-safe, multi screen support - tabbed mdi and docking. (fast, and a freaking cool Look and Feel) This is (at least for me) a huge project, means, making it platform independent by a single human beeing is impossible. Happy new year and thanks for the fish, er... link :) Bjoern
Sorry, I just don't understand your reasoning here. If a GUI toolkit satisfies your requirements, what does it matter if it's "Windows only" or not? It seems to me that Qt fulfills all your requirements, and Qt certainly isn't "Windows only".
True. But D is the language of choice, so QT is not available and wxD lacks of too many features. What I meant is that the GUI I have in mind will allready have about 25.000 LOC. (based on the original C++ lib) So creating a platform independent GUI from the scratch is not doable for me. Happy new year to you
 It's your project, so you don't have build it on any platform you don't want
to, but saying your IDE HAS to be "Windows only !" because of your GUI toolkit
requirements is not being realistic.
Jan 01 2008
prev sibling next sibling parent Tom <tom nospam.com> writes:
BLS escribió:
 During my /investigations/ regarding : What GUI do I need to create an 
 realtime/collaboration IDE I found out that the MS MFC approach is not 
 that bad.
Stay away from MFC. Happy new year. -- Tom;
Dec 31 2007
prev sibling parent Jay Norwood <jayn io.com> writes:
BLS Wrote:

 
 True. But D is the language of choice, so QT is not available and wxD 
 lacks of too many features. What I meant is that the GUI I have in mind 
 will allready have about 25.000 LOC. (based on the original C++ lib)
 So creating a platform independent GUI from the scratch is not doable 
 for me.
I'm very familiar with the fox toolkit, having used it for Solaris ports of some commercial tools. I also looked into tnfox for a later project because of its expanded framework support for a number of cross-platform issues that weren't handled by fox. The tnfox objective seems to have been to duplicate all the functionality of qt, and provide it for free. The main blocking issue for me was the build issues for tnfox since, at the time I wasn't familiar with scons and python. Tnfox was also missing the port of the basic fox toolkit examples at that time, and I ported, tested these on windows and linux, and contributed the sources back to Niall at tnfox in 2006. I also sent a fix for a multiicore refresh issue to Niall and to Jeroen at fox in 2006. The windows refresh is fixed, but there was a simiilar symptom on the tnfox linux gui which we couldn't resolve at the time. I was seeing it on a 4 core opteron, but Niall couldn't duplicate it on a dual core system. One other issue about the tnfox code vs fox is that tnfox includes a lot of use of templates, while in fox tools there is almost none, and the tnfox build notes have warnings that several popular compilers, including the mars c++ compiler, couldn't build it correctly. Both fox and tnfox are very clearly written. I don't believe either rely on multiple inheritance. I believe both can be built without supporting library requirements, although both do optionally use other libraries for graphices and compression. There is a java swt port built on top of fox tools, so perhaps a port of dwt on top of a port of fox or tnfox would provide what you want in a gui. I'd like to see dwt on top of a tnfox port because of the added qt type framework. http://swtfox.sourceforge.net/ http://www.fox-toolkit.org/fox.html http://www.nedprod.com/TnFOX/
Jan 06 2008