Displaying same widget on all windows.
-
wrote on 17 Aug 2016, 18:05 last edited by
Hello
How do i keep my menu bar and label fixed in all windows i.e i want to display the same menu bar and label in all windows of my program.
Do i have to copy the same code for all windows or is there an easy way?
eg.
I have label with a heading of my program and i want to show that heading in all windows of my program.Thank you.
-
Hello
How do i keep my menu bar and label fixed in all windows i.e i want to display the same menu bar and label in all windows of my program.
Do i have to copy the same code for all windows or is there an easy way?
eg.
I have label with a heading of my program and i want to show that heading in all windows of my program.Thank you.
wrote on 17 Aug 2016, 18:30 last edited byGiven that this question is C++ tagged: Usually you would create a class that does what you want and then you create multiple instances of that (or subclasses).
For example, you crate the classMyWindow
where you configure everything so it looks like you want (the menu bar, labels and so on) and then you just subclass that class to create your different windows - or, when you need the same window multiple times you just create instances directly.I'm not sure whether that helps you but your question is somewhat unspecific in my opinion.
1/2