A decent way to manage MDI
A decent way to manage MDI
I want to make an app that utilises the MDI gadget for a text editor but I'm having trouble figuring out a way to properly manage the creation of new child windows. Every time I try to the new window looks good but the other windows have their editor gadgets removed. What would I have to do to create a theoretically infinite amount of windows without the need for defining the same number of window numbers.
PureBasic 4.51 User
Re: A decent way to manage MDI
You can look at the MDIGadget.pb example to see how to manage it. The key is to use #PB_Any as window number.
Re: A decent way to manage MDI
If each of the MDI windows has an editor gadget and the editor gadgets all share the same gadget number (i.e. a constant) then when you create a new window the previous editor gadget will be recreated on the new window. Simply switch the gadget numbers so the gadgets placed on each new MDI gadget have a unique constant or use #PB_Any for each new gadget (and keep track of their numbers).FragSax wrote:I want to make an app that utilises the MDI gadget for a text editor but I'm having trouble figuring out a way to properly manage the creation of new child windows. Every time I try to the new window looks good but the other windows have their editor gadgets removed. What would I have to do to create a theoretically infinite amount of windows without the need for defining the same number of window numbers.
@Edit: corrected some of the wording so that my response is more incoherent.
Last edited by Demivec on Thu Jan 19, 2012 4:05 pm, edited 1 time in total.


