Home » U++ Library support » U++ Widgets - General questions or Mixed problems » SetRect doesn't work correctly on GTK
SetRect doesn't work correctly on GTK [message #52302] |
Mon, 02 September 2019 12:15 |
Oblivion
Messages: 1093 Registered: August 2007
|
Senior Contributor |
|
|
Hello,
SetRect doesn't seem to work correctly on GTK backend. (It works fine on X11).
Top-left position is always incorrect on below example (Tested on: Linux 5.2.9, GCC 9.1.0, Gnome 3.32.2)
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct App : TopWindow {
App() {
SetRect(0, 0, 640, 480);
Sizeable().Zoomable().CenterScreen();
}
bool Key(dword key, int count) override
{
Rect r = GetRect();
if(key == K_UP)
r.OffsetVert(-10);
else
if(key == K_DOWN)
r.OffsetVert(10);
else
if(key == K_LEFT)
r.OffsetHorz(-10);
else
if(key == K_RIGHT)
r.OffsetHorz(10);
else
if(key == K_SPACE)
r.right += 10; // See especially this. Even this one moves the window downwards on GTK.
SetRect(r);
return true;
}
};
GUI_APP_MAIN
{
App().Run();
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Mon, 02 September 2019 12:16] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon May 06 04:47:29 CEST 2024
Total time taken to generate the page: 0.01689 seconds
|