mekans Posted June 27, 2023 Share Posted June 27, 2023 Using the basic MenuWidget from the learn section, i found out that menu widget do not work - i am using i3wm desktop (no effect after clicking), on KDE though i got menu opened in different place on screen, any solution? Quote Link to comment Share on other sites More sharing options...
mekans Posted June 27, 2023 Author Share Posted June 27, 2023 does this problem is solved in the ultra engine? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 1, 2023 Share Posted July 1, 2023 I have not run Ultra Engine on Linux yet. Can you post screenshots of what it does? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
mekans Posted July 1, 2023 Author Share Posted July 1, 2023 sure, i don't have got my KDE desktop (traveling a lot lately) but on my i3 is disapearing (i saw a glimpse of menu that disapeared) while clicking button: https://drive.google.com/file/d/1AiE0DdFlrYV91mjQsMEOB-EQTWt-oiTt/view KDE though i can't show you right now but there's a visualisation (when i ll be back home i am going to show screenshot of that) Quote Link to comment Share on other sites More sharing options...
Josh Posted July 1, 2023 Share Posted July 1, 2023 It was tested on Ubuntu but it's just using the X windowing system and they should all work the same. What C++ IDE are you using? It looks interesting. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
mekans Posted July 1, 2023 Author Share Posted July 1, 2023 It's CLion by jetbrains in terms of the application - going to check on ubuntu - gnome (KDE debian works like visualisation on the image). I don't have got access to ultra engine but if in ultra engine it will work properly i ll consider buying that Quote Link to comment Share on other sites More sharing options...
mekans Posted July 1, 2023 Author Share Posted July 1, 2023 I am wondering, mby it's fault of the libraries i set in the cmake set(FLAGS -I/usr/include/freetype2 -I/usr/include/fontconfig -D_ULTRA_APPKIT -I${ULTRAENGINEPATH}/Include) set(LFLAGS -no-pie -lX11 -lpthread -lXft -lXext -lXrender -lXcursor -ldl) i've installed newest versions of the packages: libxft-dev libxrender-dev libxcursor-dev libxmu-dev, going to check if i can include something more from UAK packages, and if i can i ll send the results of that Quote Link to comment Share on other sites More sharing options...
Josh Posted July 1, 2023 Share Posted July 1, 2023 I doubt it. The window positioning is very basic stuff in the X library. You can try compiling the make file in VSCode if you want to be sure, but I doubt it will make a difference. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
mekans Posted July 1, 2023 Author Share Posted July 1, 2023 Installed KDE + compiled from makefile. Result is like the visualisation i showed earlier Video: https://drive.google.com/file/d/1_sSI_ippVHSaDGNdUn6HCGmzALuC_L7v/view?usp=sharing 1 Quote Link to comment Share on other sites More sharing options...
Solution mekans Posted July 2, 2023 Author Solution Share Posted July 2, 2023 I Guess it's a real problem with UAK in terms of some widgets, Ultra Engine should be tested on Linux distros X11/Wayland on most popular window managers like i3 bspwm and on GNOME/KDE/XFCE and others. If i find problems like that, i am going to report that in the future. for now i created poor version of custom menu #include "UltraEngine.h" using namespace UltraEngine; //Declare new style constants enum CustomMenuStyle { CUSTOM_MENU_DEFAULT = 0 }; //Declare new widget class class CustomMenuWidget : public Widget { //Custom members bool hover; shared_ptr<Panel> contextMenu; shared_ptr<Widget> editButton; shared_ptr<Widget> removeButton; protected: virtual bool Initialize(const WString& text, const int x, const int y, const int width, const int height, shared_ptr<Widget> parent, const int style) { bool isInit = Widget::Initialize(text, x, y, width, height, parent, 0); contextMenu = CreatePanel(x, y+25, 100, 40, gui->root); contextMenu->Hide(); editButton = CreateButton("Edit", 0, 0, 100, 20, contextMenu, BUTTON_TOOLBAR);//just for an example, no function removeButton = CreateButton("Remove", 0, 20, 100, 20, contextMenu, BUTTON_TOOLBAR); ListenEvent(EVENT_WIDGETACTION, editButton, EditbuttonCallback, Self()->As<CustomMenuWidget>()); ListenEvent(EVENT_WIDGETACTION, removeButton, RemoveButtonCallback, Self()->As<CustomMenuWidget>()); return isInit; } static bool EditbuttonCallback(const Event& ev, shared_ptr<Object> extra) { auto listView = extra->As<CustomMenuWidget>(); listView->contextMenu->Hide(); Print("edit button run"); return true; } static bool RemoveButtonCallback(const Event& ev, shared_ptr<Object> extra) { auto listView = extra->As<CustomMenuWidget>(); listView->contextMenu->Hide(); Print("remove button run"); return true; } //Called when the mouse moves if this widget has the focus virtual void MouseMove(const int x, const int y) {} //Called when the mouse cursor enters the widget bounds virtual void MouseEnter(const int x, const int y) { hover = true; Redraw(); } //Called when the mouse cursor leaves the widget bounds virtual void MouseLeave(const int x, const int y) { hover = false; Redraw(); } //Called when the mouse button is pressed virtual void MouseDown(const MouseButton button, const int x, const int y) { if (button == MOUSE_LEFT) { if(contextMenu->hidestate) { contextMenu->Show(); } else { contextMenu->Hide(); } } } //Called when the mouse button is released virtual void MouseUp(const MouseButton button, const int x, const int y) {} //Called when another widget becomes selected virtual void LoseFocus() {} //Called when mouse double-click occurs virtual void DoubleClick(const MouseButton button, const int x, const int y) {} //Called when mouse triple-click occurs virtual void TripleClick(const MouseButton button, const int x, const int y) {} //Called when widget is selected virtual void GainFocus() {} //Called when key is pressed virtual void KeyDown(const UltraEngine::KeyCode key) {} //Called when key is released virtual void KeyUp(const UltraEngine::KeyCode key) {} //Called for each keydown event virtual void KeyChar(const int keychar) {} //Called when mouse wheel turns and mouse is hovered over this widget virtual void MouseWheel(const int delta, const int x, const int y) {} //Called each time the widget is redrawn virtual void Draw(const int x, const int y, const int width, const int height) { blocks.clear(); Vec4 color = Vec4(0.255f, 0.10f, 0.10f, 1); if (hover) color = Vec4(0.255f, 0.255f, 0.255f, 1); //Background rectangle AddBlock(iVec2(0), this->size, color); //Foreground text AddBlock(text, iVec2(0), this->size, Vec4(1), TEXT_CENTER | TEXT_MIDDLE); } public: //Constructor CustomMenuWidget() : hover(false) {} friend shared_ptr<Widget> CreateCustomMenuWidget(const WString&, const int, const int, const int, const int, shared_ptr<Widget>, const CustomMenuStyle); }; //Create function shared_ptr<Widget> CreateCustomMenuWidget(const WString& text, const int x, const int y, const int width, const int height, shared_ptr<Widget> parent, const CustomMenuStyle style) { auto widget = std::make_shared<CustomMenuWidget>(); widget->Initialize(text, x, y, width, height, parent, style); return widget; } Thank you @Josh and @Dreikblack for supporting me before, i know my posts were annoying but i finally understand how widgets are created. 2 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 2, 2023 Share Posted July 2, 2023 Do you happen to know if your distros are using Wayland with an X emulation? If so it would be a bug in that implementation. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
mekans Posted July 2, 2023 Author Share Posted July 2, 2023 I am using X emulation Right now i do not have access to my vm server - so i can't help you with debugging. After 10.07 i am going to check wayland Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.