New to Carbon - how to disable a button?

This should be basic, so I'm really not understanding why it doesn't work. I have a simple application with buttons on a window (made using interface builder), and an event handler for when they're clicked. One of them runs this function;
void
MainWindow::Play( TWindow* win, unsigned int x, unsigned int y )
win->SetTitle( CFSTR( "Hello" ) );
ControlRef btn = nil;
ControlID btnID = { 'bn00', 0 };
GetControlByID( (WindowRef) win, &btnID, &btn );
DisableControl( btn );
The first line is my debugging - when the button is clicked the window's title changes to "Hello" so I know it's running fine and the window pointer is correct, but the button isn't getting disabled (no errors either)
bn00 is the button's signature and 0 is it's ID, since that's what I guessed it matched up to. Is that right? if it is then what's wrong?!

To port a Windows app, the best strategy would be to isolate the user interface code from the rest of the app's code. Assuming the Windows code was written in C++, you would keep the non-interface C++ code and use Cocoa for the user interface. Objective C++ lets you mix C++ and Objective C code in your app. You have to give your Objective C files the extension .mm to make them Objective C++ files.
There's nothing stopping you from using Carbon, but Carbon is difficult to learn for someone new to Mac development. There are no up-to-date Carbon books so you have to rely on Apple's documentation for everything. Most people on Mac programming message boards are Cocoa developers, which makes getting answers to your questions difficult. Going with Cocoa is less painful.

Similar Messages

  • How to disable hold button in purchase order creation.

    hi
    how to disable hold button in purchase order creation.

    Select single * from VBAK where clause
    ---It fetches single record from the database, based on the condition you specified in the where clause.
    Where as select * from VBAK up to 1 row
    ---Fetches first record if the condition specified in the where clause is satisfied, otherwise it doesn't fetch any record

  • How to disable save button on selection screen (1000) run from other report

    Hi Experts,
    Can any one let me know how to disable save button on selection screen (1000) run from other report.
    Say I am running from report R1 which submits report R2, but the save button should be disabled on
    report R2(selection screen 100).
    Thanks in advance.
    Regards
    RP.

    Hi RPReddy16 ,
    Try this:
    DATA :BEGIN OF t_extab occurs 0,
                     fcode like rsmpe-func,
                 END OF t_extab.
    REFRESH T_EXTAB.
    MOVE 'SAVE' TO T_EXTAB-FCODE.
    APPEND T_EXTAB.
    CLEAR T_EXTAB.
    SET PF-STATUS 'STATUS' EXCLUDING T_EXTAB.
    Regards,
    José

  • HT201401 New update 7.0.2 disables wifi, button does not turn on. Iphone 4s

    New update 7.0.2 disables wifi, button does not turn on. Iphone 4s

    Hi there, I was just trying to help you and offer some staight forward advice on this issue
    but it seems like Apple didn't like the truth that was being relayed and removed my post!
    there are a number of threads on here about the issue, also do a general search and after reading for a few hours you will find out what I tried to relay to you before Apple unreasonably removed it
    good luck!

  • How to disable Setting button in Tools - Options - Advanced - Network from windows registry?

    Dear support,
    Now, my office use Firefox as default browser to access WebServer. And there are some policy that users must use ProxyServer. I do not want user change proxy setting in Firefox. How to disable Setting button in Tools - Options - Advanced - Network from windows registry?
    Thank you.
    Treky

    You can not use the Windows registry to disable items in Firefox. This link shows how to lock down Firefox proxy settings, change the values to suit your needs:
    http://www.stbernard.com/ip5kb/iPrism/WhatsNew/50SupportFiles/SupportFiles/IP0460.htm
    One minor variation, in step 4 instead of adding that line to all-js, you can create a file called ''local-settings.js'' containing the line shown and save the file in the same folder as all.js

  • How to disable Setting button in Tools - Options - Advanced - Network..i've read an article that solved this problem..but thats problem contains web adress that couldn't be opened..any other solution??? thanks before best regard

    How to disable Setting button in Tools - Options - Advanced - Network..i've read an article that solved this problem..but thats problem contains web adress that couldn't be opened..any other solution???
    thanks before
    best regard
    -ariansyah-

    You can disable or remove that button, but that won't prevent users from making the changes on the about:config page directly.<br />
    You can lock the related network.proxy prefs if you do not want users to change the connection settings.
    See:
    *http://kb.mozillazine.org/Locking_preferences
    * http://kb.mozillazine.org/network.proxy.type
    * http://kb.mozillazine.org/network.proxy.%28protocol%29
    * http://kb.mozillazine.org/network.proxy.%28protocol%29_port

  • How to disable the button in application toolbar in report pgm

    Can anyone help with How to disable the button in application toolbar in report pgm

    Hi,
    You can use it_excluding to disable button on the tool bar.You have to find the function code for the required button and append that function code to the it_excluding .The optional IMPORTING parameter IT_EXCLUDING is an internal table. It is only needed if the caller uses the list tool standard interface but wants to deactivate interface functions which he or she does not need.You can have your defined pf-status using I_CALLBACK_PF_STATUS_SET.
    SAMPLE PROGRAM
    tables spfli.
    type-pools: slis.
    DATA W_FCODE TYPE SLIS_EXTAB-FCODE.
    data: t_spfli TYPE SPFLI OCCURS 0 WITH HEADER LINE.
    select * from spfli into table t_spfli.
    data : t_excluding TYPE SLIS_T_EXTAB .
    W_fcode = '&OUP'.
    append w_fcode to t_excluding.
    W_fcode = '&ODN'.
    append w_fcode to t_excluding.
    call function 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_STRUCTURE_NAME = 'SPFLI'
    IS_LAYOUT =
    IT_FIELDCAT =
    IT_EXCLUDING = T_EXCLUDING
    tables
    t_outtab = T_SPFLI
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/99/49b844d61911d2b469006094192fe3/frameset.htm
    Regards,
    Priyanka.

  • How To Disable Delete Button on AR Customer Search

    hi Guru,
    How to Disable the Delete Button of AR Customer Search Form.

    Hi;
    Duplicate post, please make post once
    How To Disable update Button on AR Customer
    Regard
    Helios

  • How to disable a button

    Hy Experts,
    I am a Basis guy and I want to know how to disable a button from any screen.
    Basically I have to Disable a button "Save as Completed" from the screen of t.code MIR7.
    Is there any way to hide it. If it is then please let me know, I will be thankful to you.

    Dear Aplesh,
    Check this:
    It will give you the description along with screen-shots.
    http://husnie.wordpress.com/
    Regards,
    Rakesh

  • How to disable X button on internet explorer(IE)

    hi ,
    can u please tell me how to disable close button of IE ,if possible send java script code
    thanq

    So you want to annoy your users, eh? You've already annoyed us here, since this is a Java forum, not an ECMAScipt forum. What do you want to do for an encore?

  • How to disable maximize button of the java.awt.Window ????

    How to disable maximize button of the java.awt.Window !!!!
    Help needed

    How to spam the forum with the same fuqin question. Please get lost.

  • How to disable minimize button(icon) of jframe

    how to disable minimize button(icon) of jframe

    HELP!
    I need to do a similar thing. Along with a couple other things.
    I was able to control some windows thru a unix window manager like I would for Motif (the use the window name of AWTapp or AWTdialog are recognized when doing xwininfo) That is all I can seem to get. Nothing changes this.
    Does anyone know how?
    Anyway. mwmDecorations and mwmFunctions settings appear to allow setting of some of the windows. But I need control 100%of the time.
    I need to disable the CLOSE button in all java windows or find a way that the window manager event can get back to the java application. Currently it is not recognized.
    In some windows I need other items disabled such as SIZE & MAXIMIZE.

  • How to disable delete button in a form

    HI
    can anyone show me the procedure to disable the delete button from oracle forms seeded and custom form oracle applications 11i. We are on form patch set level 18
    Regards

    Hi ,
    there are various ways of doing it..
    You can try as the previous post says or also you can try When new block instance trigger and disable the item
    using set_item_property , it all depends on when and how you want to diable that item.

  • How to disable OK button of faces message and make it modal

    Hello all,
    I am using this code for displaying faces messages programatically :
    *public String showMessage() {*
    String messageText=”A prgramatic af:message”;
    FacesMessage fm = new FacesMessage(messageText);
    ** set the type of the message.*
    ** Valid types: error, fatal,info,warning*
    fm.setSeverity(FacesMessage.SEVERITY_INFO);
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage(null, fm);
    return null;
    But the problem here is it is showing an OK button at the bottom but I want to disable that button. How can I disable that button? For closing the message we are using function keys like ' F8 ' and we are using javascript for that.
    Also we can not use dialog there because we are adding the messages programatically and showing the faces message programatically.
    Also I want this message to have modal behavior so that until user press F8 for closing that message, user would not be able to navigate to the main form.
    How can I achieve this?
    Please Suggest.
    Thanks

    Hello All,
    How can I make the faces message Modal so that, until user closes that faces message he should not be allowed to click on or navigate to main page.
    Thanks

  • How to disable Print button on WebDynpro ABAP ALV

    In WebDynpro ABAP, a standard menu appears around the ALV,  that has a PRINT button and an EXPORT button.
    Is there anyway to disable those buttons????
    Thanks
    John

    Hi John,
    Check the interface if_salv_wd_std_functions. It contains methods which are used to hide the standard ALV toolbar buttons.
    Also refer : Removing "print version" button in alv
    How to hide Print and Filter option from dynamic ALV

Maybe you are looking for

  • Error while running Sun Java Webserver 6.1 configtest option

    hi all, Need help on the following. My environment is Liunx OS and Sun Java Webserver installed on Linux I added the following lines to Sun Java Webserver's magnus.conf file to include my NSAPI filter.      Init fn="load-modules" shlib="/space/esnta0

  • EDI seeburger interface

    Dear experts, i have a inbound scenario EDI -> XI -> R3 1. I am thinking of going the BIC mapping way like creating a BIC mappign installing in XI and specifing the mapping name in the module section of the sender file adapter as specified in this bl

  • Wifi Problem - can't get iPod Touch to connect to Internet

    I've seen lots of posts and discussions around this issue but cannot seem to nail down a solution. I have no security or encryption whatsoever with my wireless router & network. Other devices can connect wirelessly with no problem but my iPod Touch,

  • How to make the exchange of data between 2 while loop in real time

    hello I have 2 while loop the 1st while loop includes the data acquisition program the 2nd while loop includes the control program my question is how to make the exchange of data between 2 while loop in real time I tried with the local variable and d

  • HT4623 Iphone 5 is not working.  Why the black screen?

    Why would Iphone stop working suddenly?  Just a black screen.  Is there anyway to reset?