Odd behaviour of MessageDialog on GTK2

Hi all

A minor issue, but I can see it confusing an unsuspecting user (it confused
me for a while) so it would be nice if there was a fix.

If you display a MessageDialog with only an OK button, and you press <tab>
by mistake, focus moves to the message text, but it is not visually obvious
what has happened. If you then press <enter>, nothing happens, and it
appears that the application is not responding. If you click OK with the
mouse it works. If you press <tab> again, focus passes back to the OK button
and you can press <enter> successfully.

I tried a MessageDialog with Yes and No buttons to see how that would
behave. If you press <tab> repeatedly, focus is cycled from No to Yes to
message text back to No again, but if you press <enter> while focus is on
the message text, it does respond correctly and close the dialog.

I tried this with GTK2 and with MSW, and it only happens with GTK2. With
MSW, the message text never gets focus, which is what you would expect.

Frank Millman

Frank Millman wrote:

Hi all

A minor issue, but I can see it confusing an unsuspecting user (it confused
me for a while) so it would be nice if there was a fix.

If you display a MessageDialog with only an OK button, and you press <tab>
by mistake, focus moves to the message text, but it is not visually obvious
what has happened. If you then press <enter>, nothing happens, and it
appears that the application is not responding. If you click OK with the
mouse it works. If you press <tab> again, focus passes back to the OK button
and you can press <enter> successfully.

I tried a MessageDialog with Yes and No buttons to see how that would
behave. If you press <tab> repeatedly, focus is cycled from No to Yes to
message text back to No again, but if you press <enter> while focus is on
the message text, it does respond correctly and close the dialog.

I tried this with GTK2 and with MSW, and it only happens with GTK2. With
MSW, the message text never gets focus, which is what you would expect.

I don't think anything can be done about it since it is a native dialog (other than submit a bug report to the GTK project.)

Personally I like the fact that the text in the GTK2 dialog is selectable because then you can have your users copy it and send it to you in an email so you can see what the ______ they are complaining about. :wink: On MSW they have to do a screen capture to get the contents of the dialog, and dealing with the image adds another layer of complexity to reporting the problem.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Frank Millman wrote:
> Hi all
>
> A minor issue, but I can see it confusing an unsuspecting user (it
> confused me for a while) so it would be nice if there was a fix.
>
> If you display a MessageDialog with only an OK button, and
you press
> <tab> by mistake, focus moves to the message text, but it is not
> visually obvious what has happened. If you then press
<enter>, nothing
> happens, and it appears that the application is not
responding. If you
> click OK with the mouse it works. If you press <tab> again, focus
> passes back to the OK button and you can press <enter> successfully.
>

I don't think anything can be done about it since it is a
native dialog (other than submit a bug report to the GTK project.)

Personally I like the fact that the text in the GTK2 dialog
is selectable because then you can have your users copy it
and send it to you in an email so you can see what the ______
they are complaining about. :wink: On MSW they have to do a
screen capture to get the contents of the dialog, and dealing
with the image adds another layer of complexity to reporting
the problem.

Good point. Even so, it feels like a bug - on any normal dialog, if there is
a default button, pressing <enter> should activate it, whether it has focus
or not.

I might submit a bug report to GTK. How do I check which version of GTK is
being used?

Thanks

Frank

Frank Millman wrote:

Personally I like the fact that the text in the GTK2 dialog
is selectable because then you can have your users copy it
and send it to you in an email so you can see what the ______
they are complaining about. :wink: On MSW they have to do a
screen capture to get the contents of the dialog, and dealing
with the image adds another layer of complexity to reporting
the problem.

Good point. Even so, it feels like a bug - on any normal dialog, if there is
a default button, pressing <enter> should activate it, whether it has focus
or not.

Can you use shift+arrow keys to select text when it has focus? If so,
I think the static text should be outlined with a dashed border. If
not, then mouse events should still select text but it should never be
given keyboard focus.

Joe

Frank Millman wrote:

I might submit a bug report to GTK. How do I check which version of GTK is
being used?

Look at which libgtk packages are installed.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Joe Mason wrote:

Frank Millman wrote:
> Robin Dunn wrote:
>> Personally I like the fact that the text in the GTK2 dialog is
>> selectable because then you can have your users copy it
and send it
>> to you in an email so you can see what the ______ they are
>> complaining about. :wink: On MSW they have to do a screen
capture to
>> get the contents of the dialog, and dealing with the image adds
>> another layer of complexity to reporting the problem.
>>

Can you use shift+arrow keys to select text when it has
focus? If so, I think the static text should be outlined
with a dashed border. If not, then mouse events should still
select text but it should never be given keyboard focus.

I checked, and yes, you can use shift+arrow and then ctrl+c.

Visually, the only indication at present is a vertical non-blinking line to
the left of the text. Not very clear.

Frank