Adding button styles to cocoa.macos.m?

BlitzMax Forums/BlitzMax Programming/Adding button styles to cocoa.macos.m?

Garrett(Posted 2006) [#1]
Well, I'm doing something I probably shouldn't, but I just can't help myself! :-)

I've poking around in cocoa.macos.m around line 1618, and I want to add a few
buttons styles.

First one is "NSTexturedSquareBezelStyle" which does work, as I already tried
it by replacing "BUTTON_PUSH"'s style with the "NSTexturedSquareBezelStyle"
style. Kind of cool seeing the metal button style on a BlitzMax app :-)

But! If I try to add
if (style==BUTTON_METAL) [button setBezelStyle:NSTexturedSquareBezelStyle];

I get an notice that I must declare BUTTON_METAL. So I opened up maxgui.h
and added
#define BUTTON_METAL 6

just after
#define BUTTON_PUSH 1
#define BUTTON_CHECKBOX 2
#define BUTTON_RADIO 3
#define BUTTON_OK 4
#define BUTTON_CANCEL 5

and of course, it didn't work :-( I tried browsing around the mods and sources
a bit to see if I could find any other references to the buttons, but can't find
anything.

Does anyone know what else I need to do, to get the additional style working
without having to replace a current style?

Thanks for any help or info,
-Garrett


skidracer(Posted 2006) [#2]
You may also need to add a const definition in maxgui/gadget.bmx.


Garrett(Posted 2006) [#3]
I should mention that I did rebuild modules afterwards.

-Garrett


Garrett(Posted 2006) [#4]
gadget.bmx... Ok, thanks skidracer :-)

-Garrett


Garrett(Posted 2006) [#5]
Initial try shows no results, so instead of just rebuilding the module in question,
i'm rebuilding all modules right now.

-Garrett


Garrett(Posted 2006) [#6]
Well, I must be missing something else in another source file somewhere. Any
other suggested files to look into?

Thanks a bunch,
-Garrett


Garrett(Posted 2006) [#7]
Buy checking out NSButtonCell.h in the appkit, I found some reference numbers
in a type definition that enumerates the NSButtonType. I used those reference
numbers in maxgui.h and gadget.bmx, and it seems to be working.

Thanks for the help,
-Garrett