PHP-GTK2 Newsletter
|
Sample Code 234: How to setup a dialog box - Part 4 - non integer response id? |
| Written by kksou | ||||||
| Wednesday, 16 May 2007 | ||||||
|
Problem Suppose you have setup a dialog box similar to the example How to setup a dialog box - Part 2 - simple yes no dialog?. Instead of returning 100 and 200, you would like to return 'Yes' and 'No' respectively (i.e. non-integer response IDs) for the buttons as shown below:
Solution If you use the method GtkDialog::response() to exit the dialog, you will find that the response ID has to be an integer. You cannot return a response with a non-integer response. To return a non-integer response, we have to set up the dialog manually.
Sample Code
Explanation We make use of the code from How to setup a dialog box - Part 3 - set up buttons manually? to manually set up the Yes/No buttons. What's new here:
Related Links
|
||||||
| < Prev | Next > |
|---|




