fre 2002-09-06 klockan 09.50 skrev Michael Cardenas: > Thanks to Mithrandir, I was able to get the tests working. Great! > - dialogs are now hidden before calling gtk_main_quit, so after > hitting "finish" the dialog goes away It struck me that it would be *much* better if the dialog was "reused", so you'd get a wizard-like interface. I'm not sure how hard this is to achieve, but it would be a big improvement. > There are still some problems with default values, such as selecting > them in the dialogs, filling them in, etc. Yes, I noticed. > Also, the test I was using has only one question per call to go. Is > this similar to how the installer will really flow? I was using > "Finish" if there were no more questions, but it seems that this is > incorrect, and I should use next. But in that case, the frontend needs > the ability to tell the caller to go forward to the next question or > back to the previous one. I was getting confused about when it was back/next and when finish... I'm not sure how this will work. Tollef? I do have a fix: --- gtk.c.orig 2002-09-06 12:03:52.000000000 +0200 +++ gtk.c 2002-09-06 12:04:02.000000000 +0200 @@ -718,21 +718,12 @@ gtk_main(); - i = 0; - - while(*choiceButtons) - { - if(*choiceButtons == radio) - { - selectNum = i; - break; - } - else - { - i++; - choiceButtons++; - } - } + for (i = 0; choiceButtons[i] != NULL; i++) + if (choiceButtons[i] == radio) + { + selectNum = i; + break; + } printf("selected: %d\n", selectNum); When you step choiceButtons forward, you've changed the pointer, so free() will be very unhappy with you! Actually, when using a malloc:ed pointer-to-pointer variable to simulate a dynamic-size array, I prefer subscribing it with an index variable instead of using pointer dereference, but maybe it's just a matter of taste. In many cases in the code you still use an index variable for other things, though, so maybe it's something to think about? I'll check in your new patch with the fix above included. Regards, Martin
Attachment:
signature.asc
Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad meddelandedel