* * *

Author Topic: Getting main menu to display  (Read 3819 times)

ehj666

  • Jr. Member
  • **
  • Posts: 50
Getting main menu to display
« on: February 09, 2017, 04:03:55 pm »
This must be a real noob issue. I used Delphi extensively years ago, but haven't hardly touched it in a very long time. I am trying to update and port to Linux a 10-15 year old set of Delphi 7 applications. Non-visual units convert with no problem at all, although had to change TCP libraries. I am doing a re-layout of the main form and having trouble with the main menu. I am following the instructions here: http://wiki.freepascal.org/TMainMenu

Creating and editing the non-visual menu is no problem, however it does not display either at design time or run time. The wiki says:
Quote
Select TMainMenu from the component bar and place a component on your form by clicking on the TMainMenu component, then click on the form but do not let go of the mouse button, and while holding the mouse button down, draw a box and let go of the button. The component will appear on your form.

When I draw a box, all that happens when I lift the mouse is that the box disappears. The menu icon appears the same, regardless of whether I just drop it on the form, or try to draw a box. What stupid thing am I missing?

Thanks,
Eric

jacmoe

  • Sr. Member
  • ****
  • Posts: 259
    • Jacmoe's Cyber SoapBox
Re: Getting main menu to display
« Reply #1 on: February 09, 2017, 04:10:29 pm »
I just drop it on the form without any shenanigans  ;D

Then I just right-click it in the Object Inspector and enter the menu editor.
It does show up at run time.
more signal - less noise

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Getting main menu to display
« Reply #2 on: February 09, 2017, 05:08:09 pm »
I don't see how I can make it any simpler. I create a main form. Drop a main menu on it. Edit the menu for top level menus "File" and "Edit", and sub menu under File of "Open" and "Exit". Only Exit is implemented.

I am running on and targeting Ubuntu 16.04.

No menu appears when running.

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Getting main menu to display
« Reply #3 on: February 09, 2017, 05:16:28 pm »
Ok, this is odd. I loaded up Lazarus on Windows, did the same thing, and the menu shows properly. It is not showing on Linux however.

jacmoe

  • Sr. Member
  • ****
  • Posts: 259
    • Jacmoe's Cyber SoapBox
Re: Getting main menu to display
« Reply #4 on: February 09, 2017, 05:17:49 pm »
Odd..
Is the form's 'Menu' property set to your MainMenu ?

It does show up on Linux (I am on a Linux box).
more signal - less noise

mig-31

  • Full Member
  • ***
  • Posts: 234
Re: Getting main menu to display
« Reply #5 on: February 09, 2017, 05:23:27 pm »
It shows on my Mageia Linux 5.

Under Ubuntu with Unity, if you application running on full screen, menu is appreared on top of the screen.
Lazarus 1.6 - Linux 32/64 bit, win32

Handoko

  • Hero Member
  • *****
  • Posts: 2600
  • My goal: build my own game engine using Lazarus
Re: Getting main menu to display
« Reply #6 on: February 09, 2017, 05:24:40 pm »
@ehj666

Can you please share the files *.pas, *.lfm, *.lpi, *.lpr, *.lps here? You can zip them, attach and post it to this forum.

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Getting main menu to display
« Reply #7 on: February 09, 2017, 05:57:08 pm »
It shows on my Mageia Linux 5.

Under Ubuntu with Unity, if you application running on full screen, menu is appreared on top of the screen.

How f'ing stupid. That is exactly where it is showing up. It did not even occur to me to look there.

Thanks.

RedOctober

  • Full Member
  • ***
  • Posts: 218
Re: Getting main menu to display
« Reply #8 on: May 09, 2018, 07:46:19 pm »
Just for anyone who has run into this, if your main form's BorderStyle is set to bsDialog, your main menu will not appear.  Any other BorderStyle setting will show the main menu.  Only the bsDialog hides the main menu.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus