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 » bug: declaring widget as global
bug: declaring widget as global [message #47888] Wed, 19 April 2017 11:20 Go to next message
luoganda is currently offline  luoganda
Messages: 202
Registered: November 2016
Experienced Member
This is from fatal error dialog:
Assertion failed in .../uppsrc/CtrlCore/Ctrl.cpp, line 570,
GUI widgets cannot be global variables

All 4 variants does not work,
this in on linux 64,gcc
CodeEditor& codeedit = Single<CodeEditor>();

CodeEditor& _gce(){static CodeEditor _;return _;}
CodeEditor& gcedit=_gce();

struct Globs{
	CodeEditor gcedit;
}globs;

One<CodeEditor> _gcedit=MakeOne<CodeEditor>();
CodeEditor *gcedit=_gcedit.Get();

... the only thing that works is declaring it as usual in some TopWindow class
Re: bug: declaring widget as global [message #47891 is a reply to message #47888] Wed, 19 April 2017 15:37 Go to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
The key is not to construct the object before GUI_APP_MAIN starts. The reasons are technical and hard to overcome.
Previous Topic: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11)
Next Topic: About LabelBox and child widgets
Goto Forum:
  


Current Time: Thu Jun 13 20:19:48 CEST 2024

Total time taken to generate the page: 0.01738 seconds