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

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

Hello,

I would like to add the ability to add a custom icon to a BAlert by
passing a BBitmap into the constructor.

The constructor I'd like to add would look like this:

BAlert::BAlert(const char *title, const char *text, const char *button1,
                const char *button2, const char *button3, button_width width,
                button_spacing spacing, BBitmap* icon)

You don't specify the alert_type in this constructor because you are
setting your own icon so you don't need it.
The icon has to be 32x32 pixels or it won't fit in the dialog
correctly, I could even demand this requirement.

Below is a screenshot of the DeskCalc about dialog where I'm currently
planning to use this functionality:

http://25.media.tumblr.com/tumblr_m82q62Px151r0f0hfo1_400.png

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?

John Scipione

Other related posts: