hi people.
currently i am working on a small chat server.
i choosed in the client side to use MDIgadget for windows
such as config, status win, New chat room Win or new private msg win.
i use linked list for each window and a structure for each window gadgets!
so gadgets doesnt conflicts.
my problem is this, after i create like 2 - 4 windows and i close the window
number 2 whenever the window 4 needs to be updated , the gadgets that
are being updated are in other window so it screws up my whole proggie
is there any good method? idea? a way? someone can show me how to
manage MDIgadget with linked list with multiple windows (that each win contain a few gadgets) ??? :roll: :roll:
btw i assembled my example from the MDI image viewer example , so
if you want to know what i am into is more like a MIRC windows handling.
thank you!! its really important.
MDI Gadget handle
-
- Enthusiast
- Posts: 665
- Joined: Fri Sep 12, 2003 10:40 pm
- Location: Tallahassee, Florida
Code: Select all
Structure gadgets ; this stores all the gadget handles for a MDI child
button.l
checkbox.l
option.l
TextGadget.l
;;as many gadgets as you want
EndStructure
Dim MDInumber.gadgets(100);allows up to 100 children
Procedure add_MDI_with_gadgets(MDI,child,text$)
AddGadgetItem(MDI,position,text$)
MDInumber(child)\button=ButtonGadget(#PB_Any,x,y,width,height,"")
MDInumber(child)\checkbox=CheckBoxGadget(#PB_Any,x,y,width,height,"")
MDInumber(child)\option=OptionGadget(#PB_Any,x,y,width,height,"")
MDInumber(child)\TextGadget=TextGadget(#PB_Any,x,y,width,height,"")
;;go on from here until you finish adding your gadgets
EndProcedure
if you need to create children with different types of gadgets, try something like this.
Code: Select all
procedure add_gadget_types_1()
;add your gadgets here
endprocedure
procedure add_gadget_types_2()
;add other types of your gadgets here
endprocedure
;;;after you add an MDI child, choose the procedure you need for that type of window
addgadgetitem(MDI,position,Text$)
add_gadget_types_1()
;;;OR
addgadgetitem(MDI,position,Text$)
add_gadget_types_2()
Code: Select all
!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
thanks! but the main problem still stays, lets say i have 10 windows of mdi opened and if i close win number 3 and win number 7 the gadgets index are mixed up in the DIM or the linked list.... so whnever i clopse a window and a gadget need to be updated after it updates a diffrent MDI win because the DIM or Linked list index is wrong.
any good solutions to handle that?!
thanks
any good solutions to handle that?!
thanks
