[haiku-development] Re: Set a custom icon for a BAlert

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 1 Aug 2012 15:35:16 -0400

On Wed, Aug 1, 2012 at 3:16 PM, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
>
> Humdinger summed it up already: All information you'd display in the about
> box are already in the system about box. So there's little point in having
> one in the first place.

Fair enough, I'm convinced. Especially if we can still provide some
niceties for application authors to more easily make good about boxes
(such as the custom icons described here.)

> A cool alternative would be to provide a specific parameter class for each
> parameter for which different alternatives exist. The parameter class would
> have a non-explicit constructor for each alternative parameter type. So in
> the end you'd only need one main class constructor and the user could pass in
> any combination of parameter types. It's quite a bit of additional work
> though.

Or maybe just add a constructor for the case of having no icon at
construction time (or no type really in this case.) Then the setters
for whatever was actually wanted could be used without the wasteful
overhead of setting up an icon at construction time which would be
quickly replaced.

Actually looking at the code one can achieve the above by passing
B_EMPTY_ALERT for the type.

So maybe for this we really just need an icon getter and setter added to BAlert.

-- 
Regards,
Ryan

Other related posts: