|
Menu doesn't show in linux - Allegro 5 |
Lucas Dalmasso
Member #20,839
August 2021
|
Hi, i don't know why, but the dialog interface of Allegro 5 isn't showing the menu in linux. I tried fedora and ubuntu. It shows up in Windows but not linuxes. Any idea? |
amarillion
Member #940
January 2001
|
Could you give a bit more context? What function are you calling? Do you have some sample code? What do you expect to happen exactly? -- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Linux needs GTK3+, and there is one menu function that I believe doesn't work. We need more details please. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Lucas Dalmasso
Member #20,839
August 2021
|
Im creating a simple menu using allegro DIALOG functions. Since "OpenFileDialog()" in win32 worked in Windows through Allegro, i mean it showed fine the dialog in linux. So when i created the allegro window menu i tought that in the VM or Real Machine would show the menu in my window, but it doesn't. Maybe im compiling with different versions of Allegro?? i don't know im not to savy to linux, The program compiles fine under linux using g++ and allegro libs, but could it be a version problem? I have 2 VM of linux: one for Fedora 34 and the other one for Ubuntu 12.04. I have a real dual booting installation of Win 10 and Ubuntu. My code basically creates a menu and appends other menus to it (no bitmap, no special things). I think code isn't needed since it's too basic. Thanks in advance |
amarillion
Member #940
January 2001
|
Hey Lucas,
I'm still not very clear on what the problem is exactly. If you can show some of your code, then perhaps we can help you better. -- |
Lucas Dalmasso
Member #20,839
August 2021
|
I didn't know that "Dialog" was allegro 4 thing. Im using Allegro 5 in Visual C++ ver 142 runtime. The one that came with Nuget packages. |
Lucas Dalmasso
Member #20,839
August 2021
|
I know, i know that about that link. My code is very simple: ------------------------------------------------- ALLEGRO_START_OF_MENU("Emulator", 0), ALLEGRO_START_OF_MENU("&Window", 0), ALLEGRO_END_OF_MENU public: Anyway it prints to the terminal "Could not display menu" however in Windows dosn't drop this error. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Can you provide a debugging executable? Can you debug it yourself and get a backtrace of the error inside al_set_display_menu. Can you look at allegro.log and see if there is any message from the dialog channel. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
amarillion
Member #940
January 2001
|
I've used your code and managed to reproduce the problem. I ran it on linux and the menu wouldn't appear. I stepped through the debugger and noticed that the GTK context would not be created. I did manage to fix it with the following tweaks: 1. Make sure you set the ALLEGRO_GTK_TOPLEVEL flag before calling al_create_display(). You can use this snippet from ex_menu.c: #ifdef ALLEGRO_GTK_TOPLEVEL /* ALLEGRO_GTK_TOPLEVEL is necessary for menus with GTK. */ al_set_new_display_flags(ALLEGRO_RESIZABLE | ALLEGRO_GTK_TOPLEVEL); #else al_set_new_display_flags(ALLEGRO_RESIZABLE); #endif display = al_create_display(640, 480); 2. Make sure you call al_init_native_dialog_addon() before you call al_create_display(). If not, the appropriate GTK context is not set up properly. I noticed that your menu init function initializes the addon and creates the menu, but at that time the display is already created. This is probably what's going wrong on linux. If you try these two things, does it work for you then? The fact that the call to al_init_native_dialog_addon() succeeds even though the GTK context is not set up, could be considered a bug in allegro. Or at the very least it could generate a more helpful warning here. P.S. Seeing your code was essential to solving the problem, and it would still have been easier if you had also shared your display setup code. So here is your takeaway: If you share your code, you will get answers more quickly. -- |
|