[Gambas-user] MenuButton quirk, event inside event(gtk)

Bruce Steers bsteers4 at gmail.com
Thu Nov 24 05:23:40 CET 2022


On Wed, 23 Nov 2022 at 14:15, gian via User <user at lists.gambas-basic.org>
wrote:

> Il 22/11/22 01:08, Bruce Steers ha scritto:
>
> > Yes , the only function of concern is clicking the MenuButton (not the
> > menu arrow) and with StickyModals on.
> > The 2 menu buttons on the right, the menus do nothing but clicking them
> > pops open a test message centered to the main window (or mouse if
> > StickToMouse is selected).
> >
> > The MenuButton to the left is original gb.form, the one to the right is
> > modified code to use a Timer to raise the Click event and not Raise it
> > in the Button_Click event.
> >
> > I find with the original MenuButton to the left that when the message
> > pops up (not moving it first) I have to press the buttons twice, the
> > first click does nothing. it's busy for some reason.
> > The custom MenuButton to the right that uses the timer does not have
> > this issue.
> >
> > and i find the issue is there when the program is debugged or run with
> > gtk regardless of what the IDE uses.
> >
> > Respects
> > BruceS
> >
> >
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> Hi Bruce,
>
> don't know if you have already asked Benoit, but if there was a way to
> know the height of the window edge the position of Y would be perfect to
> the micron.
> See attached test
>
> Regards
>
> Gianluigi


Benoit's not really commented on this notion at all.

Doing it via Form.class override has the bonus of making it work on all
built in modal windows not just Message, like InputBox for example.
With my GTK I cannot even make my own window, set a position, then use
ShowModal and it not be center screen (and maybe not the screen I'm on)
This fixes that.

Also you don't have to change any previous Message code, just drop the
Form.class in your projects .src dir and set it's defaults.

your test using an FMessage.class copy does work okay (no menu button bug)
but Initially I just wanted to fix ALL my applications modal/form windows
popping open on the wrong screen in one simple hit so a Form.class mod
seemed ideal and worked.
>From there it developed into attaching to active/selected windows or the
mouse. (gotta love options :) )
My Form.class method seems almost flawless and is pretty useful. If it
wasn't for the darn MenuButton problem.
It makes me worry it has other potential issues.

Could my method be modified so the MenuButton (and any other potential
control problems i don't know about) do not have a problem?

Any advice would be appreciated on my implementation of a pseudo modal
window and why it might glitch with a menu button?

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221124/ebf481d0/attachment.htm>


More information about the User mailing list