How do I make a checkbox gui control?

Started by bx83, Fri 30/08/2019 02:06:27

Previous topic - Next topic

bx83

I've tricked taking button_onclick(), and changing the button graphic (from an empty box to a checked box and visa-versa), however it says '.Graphic is read only'.
What do I do? I can't change the button image, so I'm screwed it would appear.

Crimson Wizard

From the manual:
Quote
readonly int Button.Graphic;

Gets the current image on a GUI button. If a value less than 1 is returned, then no image is currently displayed on the button.

This property is read-only; in order to set the image, you must use one of the NormalGraphic, MouseOverGraphic or PushedGraphic properties.

bx83

But will normalgraphic etc. change the image permenantly? Or will it just appears cheked at the moment I push it, and then unchecked?

Crimson Wizard

Yes, it sets it permanently, same for other properties.

Khris

Quote from: manualint Button.NormalGraphic;

Gets/sets the button's normal sprite (ie. the graphic used when the button is not pushed and the mouse is not over it).

SMF spam blocked by CleanTalk