U++ framework
Do not panic. Ask here before giving up.

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: 14291
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: Wed Jul 22 14:35:33 GMT+2 2026

Total time taken to generate the page: 0.00652 seconds