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 » Community » Newbie corner » Dynamic windows & widgets (How to construct windows with widgets, other than by inheritance)
Re: Dynamic windows & widgets [message #45348 is a reply to message #45332] Sat, 31 October 2015 19:26 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1427
Registered: September 2007
Ultimate Contributor
normvcr wrote on Sat, 31 October 2015 11:46
The examples I have seen show menus and toolbars as data members of top-level windows. Can a top-level window be created with menus and toolbars, without being pre-defined as a class with these objects as data members? i.e. something like this:
window = new Window;
window->add( new Menu );

Thank you

Sure, it can. But it is an inferior approach with no benefits and only disadvantages. You loose the ability to refer to a widget at a random point in time if you do not have a member to store it. And if you do want a member to store it, not using pointer removes the need to do manual memory management.

The only scenario I can think of is when you wish to load an interface from an external file, like and XML file. There is a sample if I am not mistaken which loads GUI from and XML file.
 
Read Message
Read Message
Read Message
Previous Topic: Fedora 22 prerequisites
Next Topic: Help: GetSysTime()
Goto Forum:
  


Current Time: Fri Jun 20 23:09:28 CEST 2025

Total time taken to generate the page: 0.03135 seconds