MenuHeight() / QT

Post bugreports for the Linux version here
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

MenuHeight() / QT

Post by srod »

MenuHeight() always reports 0 on the qt subsytem. Fine on GTK3.

Ubuntu 18.04 LTS.
I may look like a mule, but I'm not a complete ass.
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: MenuHeight() / QT

Post by freak »

The menu is not part of the accessible client area of the window, so you do not have to calculate space for it. This is why the result is 0. This is the same on OSX too for example.
quidquid Latine dictum sit altum videtur
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: [Done] MenuHeight() / QT

Post by srod »

Under Ubuntu 18.04 menus are attached to the top of a window just like Windows as opposed to the top of the screen as with OSX. Consequently, there now seems to be no way of positioning a gadget at the bottom of a window with a menu (at least under Ubuntu 18.04 and the qt subsystem) since WindowHeight() remains unchanged whether there is a menu attached or not.

Code: Select all

  If OpenWindow(0, 200, 200, 200, 100, "Menu Example", #PB_Window_SystemMenu)
    If CreateMenu(0, WindowID(0))    ; menu creation starts....
      MenuTitle("Project")
        MenuItem(1, "Open"   +Chr(9)+"Ctrl+O")
        MenuItem(2, "Save"   +Chr(9)+"Ctrl+S")
        MenuItem(3, "Save as"+Chr(9)+"Ctrl+A")
        MenuItem(4, "Close"  +Chr(9)+"Ctrl+C")
    EndIf
    ButtonGadget(1, 0, 80-MenuHeight(), 80, 20, "CLICK")
    Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
  EndIf
Either MenuHeight() needs to be non-zero or WindowHeight() needs to be altered unless I am missing something?
I may look like a mule, but I'm not a complete ass.
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MenuHeight() / QT

Post by Fred »

Removed the done, for more investigation
Post Reply