Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Containment versus Importing

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hey there,
This relates to the gui I am building. Conceptually there is a root window and the various functions the gui are accessed via buttons. My question is this:
1. Is it better to have the various window classes as subclasses of the main root window class, or alternatively, have all the sub windows as separate classes within the same package.

Thanks
LoudHoward
 
Hi,

I guess which method to use depends actually on what kind of application you are trying to create and the "things" needed to implement the application. For example, sometimes your sub-window class might have to use the parent-window variables or methods very often. So it might be good to use sub-window instead so your parent-window will not have to pass in variables to the sub-window or to create the same methods for the sub-window.

If your sub-window does not need to use the parent-window's variables or methods, you might consider creating an instance of the sub-window. But it all depends on you and your application.

Hope this helps,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top