Cabbage Logo
Back to Cabbage Site

Defining macros that determine widget type?

This appears to work just fine, I just want to make sure it SHOULD work and isn’t likely to change in the future… or if it might be a bad idea for some other reason, perhaps breaking the widget maker tools or something (didn’t test there, since I don’t really use full GUI cabbage at all).

I’d like to define a macro that would include the widget type… for example:
#define GROUPBOX groupbox colour(30,30,30,255), line(1)

Obviously it would end up being used at the beginning of a line and with other stuff behind it, such as bounds() and text(), like so:
$GROUPBOX bounds(10, 10, 360, 80), text("In/Out"), plant("io") {

Would this considered bad cabbaging? :thinking:

This certainly wasn’t by design :wink: I think the rule here is that you can do whatever you like, if it works, so long as you are not using the GUI editor. The macro system is pretty basic so I don’t think this could potentially make a wreck of it in the future.

That works for me… most of what I’ve working on isn’t really meant to be manually tweaked with the gui editor anyway. I think it will make for more concise and readable/understandable code if I do it this way.

Hopefully it doesn’t end up being a headache for either of us in the future :slight_smile: