GNOME Bugzilla – Bug 527466
gtk_assistant_set_current_page records wrong visited page
Last modified: 2008-04-11 17:23:14 UTC
Please describe the problem: The function gtk_assistant_set_current_page records the next current page as the last visited page, instead of the actual current page. Steps to reproduce: See the attached example program. Actual results: Press "Enter" to activate the text entry, then click the back button. An empty page is presented. Expected results: The first page of the assistant should be presented instead. Does this happen every time? Yes. Other information: See attached patch. Note: The function gtk_assistant_set_current_page is intended to be used by custom buttons added to the action area. This works to simulate the forward button, but it can not be used to simulate the back button, which affects the visited pages list differently (it removes rather than adds a page), and which needs to access the content of the visited pages list. I suggest to add a mechanism to allow to trigger the default buttons in the action area programmatically. Also, I want to suggest to implement a function similar to gtk_dialog_set_default_response. In fact, I was kind of surprised that an assistant is not sub-classed from a dialog, but I am not an expert in toolkit design.
Created attachment 109034 [details] Test program to reproduce gtk_assistant_set_current_page() bug.
Created attachment 109035 [details] [review] Patch to fix gtk_assistant_set_current_page bug
Good catch Marcus. Matthias, the patch looks right to me, it's ok to commit?
Yes, looks right. Please commit to both branches
Thanks Matthias! I've just committed to trunk and gtk-2-12. Marcus, I'd recommend you to open independent bugs for each issue you find, so it's easier to keep track of them. Regarding having the buttons marked as default, I've just opened #527583, Now I think this one can be closed :)