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 » Size of TopWindow is different then the size I set for it
Re: Size of TopWindow is different then the size I set for it [message #48868 is a reply to message #48865] Mon, 16 October 2017 10:56 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
I see...

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <GuiTest/test.lay>
#include <CtrlCore/lay.h>

struct MyApp : WithTestLayout<TopWindow> {
	MenuBar bar;
	
	MyApp() {
		AddFrame(bar);
		bar.Set([=](Bar& bar) {
			bar.Sub("File", [=](Bar& bar) {
				bar.Add("Exit", [=] {
					Break();
				});
			});
		});
		CtrlLayout(*this);
	}
};

GUI_APP_MAIN {
	MyApp().Execute();
}


Note that it is important to call CtrlLayout AFTER adding menu as CtrlLayuot actually adds frame dimensions to the whole requested window size.

[Updated on: Mon, 16 October 2017 10:56]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to blur a Ctrl
Next Topic: preferred way to get event "sender" control?
Goto Forum:
  


Current Time: Thu Jun 06 16:18:11 CEST 2024

Total time taken to generate the page: 0.01289 seconds