Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1096
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


[Updated on: Mon, 02 September 2019 12:16]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Taking snapshot of GLCtrl no longer works
Next Topic: GLDrawDemo NOGTK doesn't work
Goto Forum:
  


Current Time: Thu Jul 18 19:18:47 CEST 2024

Total time taken to generate the page: 0.01785 seconds