Using Sun WorkShop

Adding a Button to the Button Editor

To add a button to the Button Editor:

  1. Decide whether you want to put text or an icon on the button.

  2. To put text on the button, click the Text radio button and type the text in the corresponding text box.

  3. To put an icon on the button, click the Icon radio button, and type the file name of an icon.

    Click the browse button to display a dialog box you can use to choose an icon file. The icon file must be in the .xpm file format. Sun WorkShop tool bar icons are 20x20 pixels, and use only colors from the Sun WorkShop palette.


    Tip -

    You can use the CDE application dticon to create an .xpm file. Most graphics programs can also save files in .xpm format.


  4. In the Dbx Command text box, type the dbx command you want executed when the button is clicked.


    Tip -

    Type commands in the Dbx Commands window to see what commands are available.


  5. If you want the button to execute a dbx command that takes an argument, you must select one of the radio buttons under Append/Insert(%s) To Command On Button Press to specify the text to append to the command.

    • The Nothing radio button is selected by default indicating that no text is to be added to the command.

    • If you click the Selected Text radio button, the current Sun WorkShop selection is appended to the command.

    • If you click the File: Line Number radio button, the file name and line number of the selection are appended to the command.

  6. If you want the argument embedded in the command rather than appended to it, type %s in the command string to indicate the position of the argument.

    For example, if you type the following command string in the Dbx Command text box

    stop at %s -temp

    and select the File: Line Number of Selection radio button, the button will execute the following command if it is clicked when line 25 in main.cc is selected:

    stop at "main.cc":25 -temp


    Note -

    The command string should contain only one %s, and it cannot contain an escape sequence. For example, stop %%s -temp produces stop %"main.cc":25.


  7. Click Add and the button is added to the button list.