[Gambas-devel] Another extrange thing
Benoit Minisini
gambas at ...1...
Sat Jun 5 00:49:15 CEST 2004
On Saturday 05 June 2004 00:28, Daniel wrote:
> OK, it works!
Cool.
>
> Just 3 questions more... There are two properties that have not effect
> in 'root menus', that is, menus that are children of a Window:
>
> - Picture : these menus have no picture, but I can do Menu.Picture=(a
> picture), and that menu seems to really have a picture (I can read the
> property)
>
> - Checked : these menus do not show the 'check', and if I try to do
> Menu.Checked=TRUE, when I read the property it always says 'FALSE'
>
>
> And the questions are:
>
> 1) Why these menus have no picture and can not be checked?
Because of QT: the menu class hides all the specific Qt management of menus.
In a few words: QT has only a QPopupMenu class that you fills with separators
and entries, that are not widgets!
To have the same simple semantic as VB, a gambas menu object becomes a true QT
QPopupMenu widget only when it gets children. Otherwise, it is just an item
inserted in its parent, which can be a QPopupMenu, or the menubar of the
window.
And the window menu bar is a QMenuBar widget that don't display the pictures
associated with its entries. So...
>
> 2) If it is not possible or desiderable(why not?), why picture property
> is stored, but 'checked' has no effect?
Checked has no effect because QMenuBar do not use it.
>
> 3) Why these root menus, and menus which have children do not fire the
> 'clicked' event?
Because of QT. QPopupMenu and QMenuBar raise a signal when one if its child is
clicked, except if it is another poupmenu. And QMenuBar raises the signal,
but the gambas don't catch it. I didn't do that because I don't like entries
in the window menu bar that are not real menus.
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the Devel
mailing list