Sunday, October 08, 2006

March of progress in action: wxAboutBox()

Finally, 13 years after its beginning, wxWidgets has gained this mostly indispensable feature of any modern GUI toolkit: the possibility to show the standard "About" dialog with one line of code. As of today, wxAboutBox() function can be used to create a dialog box like this
GTK+ About Dialog
or like that
Mac OS X About Dialog
or, if all else fails, like this
Generic About Dialog under Windows


The generic dialog is not finished however as the best way to implement is seems to be using yet another new control: the hypothetical wxCollapsiblePane. The hope is to have it soon, finish wxGenericAboutDialog next, and release 2.7.1 immediately thereafter.

5 comments:

Ryan Norton said...

Nice! Like the images :D.

You could always leave as is with the caveat (that the generic is somewhat unfinished) for 2.7.1 due to the new release schedule though...

Anonymous said...

I don't get the point of encapsulating arguments to a function that 99% applications will call in one place in the code, namely in the Help|About menu item handler. I think that either wxAboutBox should (be overloaded to) take name,desc,ver,(C) as separate arguments, or wxAboutDialogInfo should support the named parameters idiom.

VZ said...

Encapsulating arguments is done simply because there are too many of them and passing them to one function would be unwieldy. Also, having the parameters in a struct allows to have computed default values for some of them.

So basically wxAboutDialogInfo is the named parameter idiom.

Ryan Norton said...

An idea maybe is to make some more constructors for wxAboutDialogInfo; for example one with just a single string? That way you could do something like

wxAboutBox(wxT("XXX"));

Anonymous said...

"Encapsulating arguments is done simply because there are too many of them and passing them to one function would be unwieldy."

IMHO havig to type:

info->SomeProperty=MyValue;

for each property we're going to set is even more unwieldy. Chainable setters maybe?