A decent way to manage MDI

Just starting out? Need help? Post your questions and find answers here.
User avatar
FragSax
New User
New User
Posts: 9
Joined: Tue May 24, 2011 11:58 pm

A decent way to manage MDI

Post by FragSax »

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
Fred
Administrator
Administrator
Posts: 18409
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: A decent way to manage MDI

Post by Fred »

You can look at the MDIGadget.pb example to see how to manage it. The key is to use #PB_Any as window number.
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: A decent way to manage MDI

Post by Demivec »

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.
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).


@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.
User avatar
FragSax
New User
New User
Posts: 9
Joined: Tue May 24, 2011 11:58 pm

Re: A decent way to manage MDI

Post by FragSax »

Thanks for the help, it's much appreciated.
PureBasic 4.51 User
Post Reply