i am running a project since a very long time, now its time to port it peace by peace into the Haiku environment.
i hope that i can publish my project during this year, maybe somewhere in the end.
now the questions:
how can i put an icon to a menuitem, to a window, into a button?
i need a component like a canvas to draw on it. which component is useable for that target and does haiku have onboard drawing commands or do i need an external lib for? i would wish using onboard command, instead of third-party libs.
is there a component to edit mulltine-text onboard or do i need to code it by myself or need a third-party lib?
Windows don’t have icons by themselves under Haiku, only applications do. The Application icon can be set in a resource file in rdef format. As an example how this looks like you can look at my app “Peggy” at GitHub - andimachovec/Peggy: a board game for the Haiku operating system inspired by Mastermind(tm) . Icon-O-Matic can export in rdef format and I think WonderBrush too. As far as buttons are concerned you can use the BButton class and use a bitmap as icon via the SetIcon function or use the BPictureButton class which lets you specify a BPicture (a set of drawing instructions) as an icon. I don’t know if you can set icons on menu items, I don’t remember seeing it in any Haiku application I’ve used so far
You can put icons in menuitems but you will have to create your own subclass of BMenuItem and do your icon drawing yourself. You can find an example of this in the Vision IRC client.
Not quite, BPictureButton will draw only the BPicture with nothing around it. BButton::SetIcon is what you should use unless you don’t want your button to look like normal buttons at all.
Thanks for pointing that out. I´ve never used BPicturebutton myself, only looked at the API description. I always used BButton::SetIcon if i needed a button with an image.