April 20, 2006
In article <e27ain$gu5$1@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
>
>DBloke wrote:
>
>> I must have missed something somewhere I thought it was not possible to port C++ to D I am sure I read a post somewhere or on the D site saying that it is almost impossible to port C++ to D ??
>

I think what you're referring to is that it is not practical to *mechanically* convert many C++ apps. to D. I don't think there is really anything you could do in C/++ that couldn't also be done with D, with the exception of some compile-time macro/template stuff (which of course doesn't mean you couldn't accomplish the same end-result w/ D, just not at compile time).

>You shouldn't believe all those people telling you what you can't do ;-)
>


April 21, 2006
>> Well I have a Mac and x64 PC so I may be able to lend a hand testing if you like?
> 
> Sure! There's "only" wxD 0.04 at the site at the moment, but I might as
> well upload wxD 0.05 too as a "Release Candidate" or something similar ?
Hi These are test results from samples built.
Tested on Windows XP SP2
1.5 GB Ram
Athlon XP 2800+
128 MB GeForce 4 MX GFX

Controls -- Exists with abnormal termination
Dialogs -- Selecting busy dialog gives abnormal termination
Dnd -- Selecting clipboard gives abnormal termination
Font -- GUI Code requested a wxFontMapper but we only have a wxFontMapperBase
Grid -- When selecting virtual table allocation with default setting exits with abnormal termination
HTML -- when selecting open from file menu and selecting an html file invalid encoding value in wxCSConv ctor -- abnormal termination
HtmlHelp -- When selecting Exit abnormal termination
HTMListbox -- when opening program abnormal termiation
Launcher -- after launching Dialogs and exiting Dialogs just get hourglass no way to quit only task manager
ListBook -- when selecting About program freezes only way to quit Task Manager
ListCtrl -- Selecting Sort program just exits
MDI -- when starting program immediately exits with abnormal termination
Printing -- When selecting Print Setup -- Abnormal termination
TreeCtrl -- program never displays and just runs as a process in Task Manager, only way to quit look through processes in Task Manager and end process
Xrcdemo -- exits immediately before displaying

How does 0.5 compare to 0.4?

DBloke
April 21, 2006
DBloke wrote:

> Hi These are test results from samples built.

Hmm, looking at the bug list like that does seem pretty bad :-)
"Abnormal termination" is pretty common in D programs, though.

Patches happily accepted :-)

> How does 0.5 compare to 0.4?

I fixed the platform macros, the bools, and added some docs.
Also added sound support, and a demo for that. Nothing major.

Email me for the beta of it.

--anders
April 22, 2006
Anders F Björklund wrote:

> Charles Hixson wrote:
> 
>>> I guess the community needs to decide exactly what it would like from a GUI/Framework.
>>> 
>>> Are we looking for
>>> Portability to multiple platforms?
> 
>> ..
>> Work in progress
>> [...]
> 
> BTW; Thunderbird hated this start, it thought your post was one big sig?

Ouch.  OK, I'll bottom post from now on.  Some groups seem to prefer that anyway, though to me it seems more reasonable to intermix things.

> 
>> From my personal perspective, it needs to work well on my personal
>> system,
>> which runs Linux.  It also needs to be easy to set up (or come with the
>> compiler), because I'm not *committed* to D.  I just want to get my
>> project done, and D would be a nice tool.
>> ...
> 
> wxD is intended for Linux (GTK+), Mac OS X (Carbon), as well as Windows.
Nice.
> 
>> Better to start with a simple framework that can later be expanded, and
>> get
>> it working WELL.  (Simple means being able to do dialog boxes.  Ability
>> to use input from a GUI builder, like glade, or SpecTCL would be a real
>> plus, no question, but is LESS necessary that having a solid system.)
> 
> For wxWidgets, there are several editors for the XML-based "XRC" format. One (from the wx author) is: http://www.anthemion.co.uk/dialogblocks/
> 
wxWidgets is well developed, indeed.  I've looked at using it with Python. I haven't considered it with D largely because of the low revision number at SourceForge.  0.3 is a bit scarey.

>>...
> 
> wxD is somewhat huge, but most of the code is rather straight-forward. (not counting some of the voodoo going on with events and such tricks)

For my purposes, size isn't a major consideration.  I've been considering (among other things) C++ & Qt.  I just don't like to need to depend so much on pointers.  And garbage collection is really a VERY nice feature.
>> Another good feature would be documentation that says exactly which
>>...
> 
> I've been working on such a list for wxD 0.05, but it's a lot of demos and I'm testing them on three platforms - so it amounts to some work...
> 
Sorry, here I was talking about D's gui packages in general, which are mainly hosted at DSource.
> I've also started on some minor docs, like http://wxd.sf.net/Hello.html and with adding some API docs with Doxygen, like http://wxd.sf.net/docs/ In the long run there needs to be a tutorial or longer documentation, explaining how to get started - with more words than just a Readme...
Sounds VERY nice.

> ...
>> Also needed is a good way to report bugs.  I think the capability for this is built into dsource, though I haven't tried to use it, since mainly I've been studying and evaluating rather than developing.
> 
> If you mean reporting wxD bugs, there should be a link on the home page:
> 
> http://sourceforge.net/tracker/?group_id=133831
Sorry, here I was talking about D's gui packages in general, which are mainly hosted at DSource.

> 
>> ...
> 
> The *-config scripts output stuff in GCC format, so you need to use GDC - or feed it through some kind of preprocessing filter for DMD syntax... I ended up hardcoding DMs Makefile, and using wx-config for GNUmakefile. But I had to use "gcc" for the actual linking, not the "dmd" command ?
You are clearly MUCH more expert than I am.  I still build makefiles by guess and try, based on what worked previously.  Programming I've done for decades, but I'm in my early days with Linux and assoc GNU utils.
> 
> AFAIK: DMC/DMD doesn't do shared libraries, but for the GNU platforms at least wxWidgets is possible to link as shared (if wanted), for wxD.
> 
>      ****
> 
> I think that wxD could serve as a GUI for D.
> At least until something better is ready...
> 
> It's just an "alpha" in terms of stability,
> but then again so is the D language itself ?
> 
> --anders
Huuu... I would rate D as Beta.  If wxD is on the same level of stability as D, perhaps I should think more seriously about it.  (Perhaps, anyway, I should install gdc and see what can be done that way.  Would gdc link well with wxD?)
-- 
Work in progress
April 22, 2006
On Sat, 22 Apr 2006 13:50:30 +1000, Charles Hixson <charleshixsn@earthlink.net> wrote:

> Anders F Björklund wrote:
>
>> Charles Hixson wrote:
>>
>>>> I guess the community needs to decide exactly what it would like from a
>>>> GUI/Framework.
>>>>
>>>> Are we looking for
>>>> Portability to multiple platforms?
>>
>>> ..
>>> Work in progress
>>> [...]
>>
>> BTW; Thunderbird hated this start, it thought your post was one big sig?
>
> Ouch.  OK, I'll bottom post from now on.  Some groups seem to prefer that
> anyway, though to me it seems more reasonable to intermix things.

No need to for that reason (but for other reasons yes, don't top post please.). The reason that Thunderbird, Opera, and 40Tude saw this as a signature is that the standard for emails is that everything that follows a line that *only* contains two dashes and a space, is the signature.

-- 
Derek Parnell
Melbourne, Australia
April 22, 2006
Charles Hixson wrote:

> I haven't considered it with D largely because of the low revision number
> at SourceForge.  0.3 is a bit scarey.

Hehe, I guess a version number of 0.04 would be just ghostly then :-)

I have been rewriting the http://wxd.sourceforge.net/ page, to make it
less scary, but there is no timeline for when it would reach a "1.0"...

> For my purposes, size isn't a major consideration.  I've been considering
> (among other things) C++ & Qt.  I just don't like to need to depend so much
> on pointers.  

Cutting down on the size is a *big* item on the TODO, but currently
if you link a (stand-alone!) program with wxD it's around 10 MB. :-(

One likely reason is probably that it doesn't strip the "dead code" ?
(if you link to the shared wx libraries, it's instead more like 3 MB)

> And garbage collection is really a VERY nice feature.

I think one of the gripes that people *seem* to have about SWT (& DWT)
is that the resources aren't garbage collected but need to be managed ?

They do have a pretty elaborate rationale why it does, though:
http://www.eclipse.org/articles/swt-design-2/swt-design-2.html

>>The *-config scripts output stuff in GCC format, so you need to use GDC
>>- or feed it through some kind of preprocessing filter for DMD syntax...
>>I ended up hardcoding DMs Makefile, and using wx-config for GNUmakefile.
>>But I had to use "gcc" for the actual linking, not the "dmd" command ?
> 
> You are clearly MUCH more expert than I am.  I still build makefiles by
> guess and try, based on what worked previously.  Programming I've done for
> decades, but I'm in my early days with Linux and assoc GNU utils.

It's the other way around here. I've been using Linux and GNU tools
for a decade, but just trying to figure out Windows... @echo off ?

For the GNU tools, you do things like `wx-config --libs` and so on.
But it doesn't work so easy when working with Windows and Macintosh,
as they often require you to set it up explicitly in a GUI instead ?
(even if you *can* do it the GNU way too, in both MinGW and Darwin)

I think Bero made some progress with using Bakefiles, but it's still
somewhat tricky to get OpenGL or wx shared libraries working with DMD.
So for the moment there are two wxD compilation tracks: "DM" and "GNU"
And I'm mostly doing the three GNU ones, while yet others do the DM...

> Huuu... I would rate D as Beta.  If wxD is on the same level of stability as
> D, perhaps I should think more seriously about it.  

There are some crashes at the moment, but when I meant stability I was
more talking in terms of API and big features etc - D is still adding ?

Once we get the "crashers" out, and polish wxD a little (i.e. lose some wx.NET references and add some better documentation) - then it's a beta.

It's not many items left to decide, one of the last is if the classes should use short names like "Frame", or "wxFrame" - for compatibility ?


A *minor* setback is that the wx.NET project seems to have slowed to a stop, which means that our wxD project needs to pull a heavier load...

Our "wxc" is based on their "wx-c", and our "wxd" is based on "wx.NET",
as noted explicitly in the source code. It has been a big help for wxD.

I do plan on sending most of my D extensions upstream to wx.NET as well,
since I don't really want to fork but rather use the same base for both.


If you're interested in C#, you should definitely check the project out!
http://wxnet.sourceforge.net/ (versions for: Windows, Linux, Macintosh)

All these are open source projects, and pulling in the same direction:
wxWidgets (C++) --> wx.NET (C#) --> wxD (D). With mutual benefits, too ?

All code is released under the LGPL-ish "wxWindows License", by the way.
It should work for everyone ? See http://www.wxwidgets.org/newlicen.htm


>(Perhaps, anyway, I
> should install gdc and see what can be done that way.  Would gdc link well
> with wxD?)

Yes, wxD supports both DMD and GDC. It actually needs to detect which
D compiler is being used, since their ABI for arrays differs a little.

You'll find that the Makefiles do this, and set a __DMD__ or __GDC__
macro. They also add platform versions: __WXMSW__ __WXGTK__ __WXMAC__

(i.e. macros for the C++ library, and versions for the D library...)
wxD 0.04 uses some platform hacks, it has been rewritten for wxD 0.05

--anders
April 22, 2006
In article <e25lku$10bp$1@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...

>I just like using the frameworks using native widgets better myself; even if it would be very cool to have something like Swing, in OpenGL ?

Harmonia + OpenGL backend would be really cool for games. Well, I might have some time on July to ponder this thing further.


April 22, 2006
Anders F Björklund wrote:
> Charles Hixson wrote:
[snip]
>> And garbage collection is really a VERY nice feature.
> 
> 
> I think one of the gripes that people *seem* to have about SWT (& DWT)
> is that the resources aren't garbage collected but need to be managed ?

Hehe; that's what makes it perfectly suited to D :)

(relying on the D GC/dtor construct to release all resources would simply result in seg-faults -- I imagine you'll run into this with wxD, if any of the relevant resources are also GC managed)
April 22, 2006
kris wrote:

>> I think one of the gripes that people *seem* to have about SWT (& DWT)
>> is that the resources aren't garbage collected but need to be managed ?
> 
> Hehe; that's what makes it perfectly suited to D :)

Yeah, the comments were actually from Java (should have read "(& DWT?)",
as I am not very familiar with the differences between SWT and DWT...)

Think it was mostly a critic from proponents of Swing instead of SWT ?
Here was one: http://cld.blog-city.com/comparing_swt_and_swing.htm

I think that you're right that explicit calls are easier to handle in D.

> (relying on the D GC/dtor construct to release all resources would simply result in seg-faults -- I imagine you'll run into this with wxD, if any of the relevant resources are also GC managed)

It has some kind of global wx object registry that keeps track of them,
and I think most of that system was actually ported over from C#... :-)
But in the C++ wrappers, there is usually one ***_ctor and one ***_dtor.
It would be nice if it could be GC'd, but for now it's new and delete.


Looks something like this, in the C++ code:

extern "C" WXEXPORT
wxString* wxString_ctor(const char* str)
{
	return new _wxString(str, wxConvUTF8);
}

extern "C" WXEXPORT
void wxString_dtor(wxString *self)
{
	if (self != NULL)
		delete self;
}

(_wxString is a wrapper class for wxString)


I *think* wxD could be OK with D, asthe external "wxobj" is allocated
outside of the D garbage collector (which should be OK then, right ?)
i.e. as long as you use "auto" objects, or explicit deletes on them...
But we definitely need to dig in deeper in this, before any release.

As I believe that this matter could be a contributor to the wxD crashes,
I understand that the garbage collector works differently in D and C# ?


Maybe Bero can shed some more light on the inner wxD workings of this ?

--anders
April 28, 2006
"Jari-Matti Mäkel?" <Jari-Matti_member@pathlink.com> дÈëÏûÏ¢ÐÂÎÅ:e2diac$21jj$1@digitaldaemon.com...
> In article <e25lku$10bp$1@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
>
>>I just like using the frameworks using native widgets better myself; even if it would be very cool to have something like Swing, in OpenGL ?
>
> Harmonia + OpenGL backend would be really cool for games. Well, I might have

Why only cool for games?  like vista, cool for desktop applications too.

the method, data abstraction + 3D api,  is the future of GUI development.

There are so many OS, but only two 3D api, OpenGL and DirectX