Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-10

Attach menu to window

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
Show quoted text 43 lines
Mattias Gaertner wrote: > On Wed, 22 Oct 2003 17:32:03 +0200 > Micha Nelissen wrote: > > >>Currently the menu is immediately attached to a window upon creation. >>However, when creating all the entries this causes an huge delay, >>because the window gets redrawn for every menu item change and add. >> >>Therefore I suggest introducing an LM_ATTACHMENUTOWINDOW or something >>alike. Then all menu items are created first and when all is done a >>message sent attaching the menu causing a redraw only once. The message >>could be sent from TCustomForm.CreateWnd after FMenu.HandleNeeded for >>example. >> >>Please, someone from the GTK team respond for comments :). > > > The gtk-interface does not care, if you first create the child handles > and then attach the menu item, or if you attach and then create the > child handles. > > I think, it would be better if the childs are created first and then the > menu item is attached. This was the case some months ago, but for some > strange win32 reasons it was necessary to switch it. > > Can we switch back. Those 'strange' win32 reasons were strange to me then, and still are :(. Too bad the writer doesn't respond or has left. But: there 2 attach'types': 1) attach menuitem to another menuitem (submenus) 2) attach menuitem (mainmenu) to window In the discussion from 1 july I was talking about the first. Now I am talking about the second one :). But since menu attachment to window is now done implicitly, and I suggest to do it explicitly, no harm should result in this change. (If the gtk now does it implicitly, and I send the message explicitly, but it doesn't respond, there's no problem because it has already done it implicitly).

Ok.
Side note: Try to avoid adding messages. They are hard to read/debug. The existing ones are only for Delphi compatibility. If neccessary add a new interface function.

Mattias

Is my post clearly enough written?

Reply by email

Micha Nelissen
Mattias Gaertner wrote 26 lines
On Wed, 22 Oct 2003 17:32:03 +0200 Micha Nelissen wrote: >Currently the menu is immediately attached to a window upon creation. >However, when creating all the entries this causes an huge delay, >because the window gets redrawn for every menu item change and add. > >Therefore I suggest introducing an LM_ATTACHMENUTOWINDOW or something >alike. Then all menu items are created first and when all is done a >message sent attaching the menu causing a redraw only once. The message >could be sent from TCustomForm.CreateWnd after FMenu.HandleNeeded for >example. > >Please, someone from the GTK team respond for comments :). The gtk-interface does not care, if you first create the child handles and then attach the menu item, or if you attach and then create the child handles. I think, it would be better if the childs are created first and then the menu item is attached. This was the case some months ago, but for some strange win32 reasons it was necessary to switch it. Can we switch back.

Those 'strange' win32 reasons were strange to me then, and still are :(. Too bad the writer doesn't respond or has left.

But: there 2 attach'types':
1) attach menuitem to another menuitem (submenus)
2) attach menuitem (mainmenu) to window

In the discussion from 1 july I was talking about the first. Now I am talking about the second one :).

But since menu attachment to window is now done implicitly, and I suggest to do it explicitly, no harm should result in this change. (If the gtk now does it implicitly, and I send the message explicitly, but it doesn't respond, there's no problem because it has already done it implicitly).

Is my post clearly enough written?

Micha.

Reply by email