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

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 1 Aug 2012 13:11:48 -0400

On Wed, Aug 1, 2012 at 12:12 PM, Ryan Leavengood <leavengood@xxxxxxxxx> wrote:
> On Wed, Aug 1, 2012 at 8:53 AM, François Revol <revol@xxxxxxx> wrote:
>> On 01/08/2012 13:40, John Scipione wrote:
>>>
>>> Now, I could create a custom AboutWindow class (there already is one
>>> in fact) and reproduce BAlert there with the extra icon functionality
>>> instead, but, I can see how being able to set the icon on an alert
>>> dialog could be useful in other situations.
>>>
>>> Any objections to me adding this feature?
>>
>> I thought we were removing about boxes...

First I've heard of this idea...

> Yes I believe at one point there was discussion of that, but frankly I
> think it is a bad idea. Sure in some cases about boxes are just a
> hard-to-maintain list of who worked on it, but they can and should
> also provide some other useful information. BApplication has an entire
> method dedicated to showing the about box so I think not having them
> in included Haiku applications is bad form.
>
> As for John's idea, I think it is great, and I've wanted to have the
> application icons in the about boxes for a while. In fact the generic
> BAboutWindow class I created in the shared kit could be modified to
> look up the application's icon and pass it in to this new constructor
> in its Show() method.

You must have read my mind because that's exactly how I've implemented
this feature, although, I think I may now create a BWindow subclass
instead of using BAlert. I really don't like that about windows are
model, there is no reason that they should be. Still being able to
change the icon in BAlert does make doing this kind of feature easier.

>> Btw, can't you just override the icon once the object is created ?
>
> I suppose, but it doesn't hurt us to make it a bit easier. I've never
> been a big fan myself of some of the hacky ways of modifying
> OS-provided views in BeOS and Haiku.

Well, you could if the ability to override the icon was added,
although I don't see how that is any better than creating a
constructor for this task and it may be a bit worse because you could
end up allocating 2 bitmaps instead of 1.

John Scipione

Other related posts: