that’s because just writing Drawable normalImage is not allowed somehow.
edit: from my understanding i need a bunch of drawable-objects to declare how my buttons should look in different states. so all i’m trying to do is draw on a drawable, but i don’t even get so far, and i can’t even find a single tutorial or resource where anyone ever tried to make a drawableButton without getting all fancy.
most forum topics about drawables start at the point where the people already have their drawables working and ask about less trivial things like bounds. but i can’t even use my method yet… not even sure what’s working about it and what isn’t.
it is in the constructor before addAndMakeVisible and also before setSize().
running it brings me to the following exception:
ImagePixelData::ImagePixelData (Image::PixelFormat format, int w, int h)
: pixelFormat (format), width (w), height (h)
jassert (format == Image::RGB || format == Image::ARGB || format == Image::SingleChannel);
jassert (w > 0 && h > 0); // It's illegal to create a zero-sized image!
even thought the expected behaviour is that it draws a yellow rectangle of the bounds that i have set in the image
edit: oh ofc. the resized comes after this so it doesn’t have bounds yet… yeah^^ brain fart… but still… when i put numbers into the bounds and run the programm no state of the button is a yellow rectangle… it’s just either transparent or has the typical juce background colour if toggleOn. it seems normalImage doesn’t have changed anything about it
hmmmm… damn… that sounds much more reasonable than what i’m currently trying to do… because i already had one button working perfectly fine as toggleButton but then ran into problems when i tried to make another button due to the drawButton-method not being able to draw 2 buttons differently depending on the button’s name
edit: yeah good idea! i will move “learning drawables” a little back in my to do list of juce things to learn and rather get stuff done now finally. thx!