5 Replies Latest reply: Apr 15, 2013 5:31 PM by John_Cummins RSS

    Setting ToolBar button label text

    lfdevjared

      Does anyone know why this code isn't setting a label next to my button?  I would like to create a button with an image and a text label on the right side of the button.  The button is displaying with my image, but the label isn't showing up.

       

      ACCB1 ASBool ACCB2 PluginInit ()

      {

       

          AVToolBar toolBar = AVAppGetToolBar ();

          AVToolButton toolButton, toolsSeparator;

       

          // Set up our toolbutton

          toolsSeparator = AVToolBarGetButtonByName (toolBar, ASAtomFromString("endToolsGroup"));

          toolButton = AVToolButtonNew (ASAtomFromString("ADBE:LFAcroPlugIn"), GetButtonIcon(), true, false); 

       

          // Toolbutton internal by default.

          //AVToolButtonSetExternal (toolButton, TOOLBUTTON_EXTERNAL);

       

          AVToolBarAddButton(toolBar, toolButton, true, toolsSeparator);

          AVToolButtonSetExecuteProc (toolButton,

              ASCallbackCreateProto(AVExecuteProc, &LFAcroPlugInCommand), NULL);

          AVToolButtonSetComputeEnabledProc (toolButton,

              ASCallbackCreateProto(AVComputeEnabledProc, &LFAcroPlugInIsEnabled), NULL);

          AVToolButtonSetHelpText (toolButton, "Save");

         

          //Create Label for Save Button

          ASText tmpText = ASTextNew();

          ASTextSetPDText(tmpText, "Save");

          ASConstText labelText = tmpText;

       

          AVToolButtonSetLabelText(toolButton, labelText, kAVButtonPriorityOnNormal);

       

          return true;

      }