[Gambas-devel] gb3 and Message.Question issue
Benoît Minisini
gambas at ...1...
Wed Dec 30 11:47:38 CET 2009
> Guys,
>
> Is this right? See attached picture Screenshot.png.
>
> Using this code:
>
> Dim r As Integer
> r = Message.Question("Delete the Identity labelled '" &
> txtIdentitiesLabel.Text & "'. Are you sure?", "Yes", "No", "Maybe")
>
> The buttons are arse-about-face. If I specify the text of Button1, as
> above, to be "Yes", then I expect button 1 to be on the left, not on
> the far right as if I were reading in, perhaps, Chinese.
>
> The documentation states:
>
> STATIC FUNCTION Question ( Message AS String [ , Button1 AS String,
> Button2 AS String, Button3 AS String ] ) AS Integer
>
> So, in the documentation the order of buttons is, from the left,
> Button1, Button2, Button3, but when the dialog is displayed, the order
> of buttons is Button3, Button2, Button1.
>
> Also, my opinion is that the Yes and No buttons should not ever
> display a shortcut key underscore unless I specify an ampersand in the
> text for the button myself. but that's just my opinion.
>
> And the problem gets worse. See attached picture Screenshot-2.png. If
> I use this code:
>
> Dim r As Integer
> r = Message.Question("Delete the Identity labelled '" &
> txtIdentitiesLabel.Text & "'. Are you sure?", "Aye!", "Nay!", "Maybe")
>
> The buttons are in a different order again.
>
> I can work around this by creating my own Yes/No dialog but I shouldn't
> have to.
>
> Let me know if the Message object is written in Gambas itself and I'll
> see if I can come up with something better.
>
Message boxes are managed by the underlying toolkit (Qt4 or GTK+), which
finally decides how he will arrange the message box buttons.
If I remember well, you use gb.qt4 on a Gnome desktop. In that case, I think
Qt4 detects Gnome and tries to follow the GTK+ message boxes layout, where
some buttons (there are some "standard" one like "Yes", "No"...) are put from
right to left.
I have often that problem when implementing gb.qt and gb.gtk: either I rewrite
the feature myself, so that it behaves exactly the same in both toolkit,
either I use the function provided by the toolkits, and you will lose some
control on the situation then...
--
Benoît Minisini
More information about the Devel
mailing list