Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Blue GUI/DBP delete gadget problems

Author
Message
MadBovine
19
Years of Service
User Offline
Joined: 17th Oct 2005
Location:
Posted: 9th Apr 2006 23:44
Ok I am writing a program that needs to have 6 different types of "windows" that open up, and a large number of each. I am trying to avoid assigning a unique handle to each gadget, and so I am using a global variable that I am incrementing each time I create a parent gadget window to define that gadget's handle. So far so good, I can open a virtually unlimited number of windows. The problem occurs when I put a deleteGadget call in my program... at all. Even when it isn't called by the program yet, it crashes. I really don't want to just hide the open windows and would rather delete them, but I can't figure out why just putting deleteGadget in my program causes it to crash (Rather it prematurely ends with no error messages as soon as it finishes loading) Yes I do have the gui include in the program. Here are the code snippets that invole the creating of the windows and the closing of them as well as the main loop.
Main Loop:


Open/Close Windows:


Function that calls CloseWindow(source):


Most of the variables used are globals, and everything works just fine until I put the deleteGadget line. Any help would be greatly appreciated.
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Apr 2006 02:53
I think there is some misunderstanding over how handles from BlueGUI work.

Essentially when you create a gadget / font / menu etc, a handle is returned from the createXXX function, which you store in a variable or some other data container and pass to other BlueGUI functions as necessary.

You cannot choose what the values of these handles are, and you shouldn't perform arithmatic operations on variables containing gadget handles.

So this part of your code:



Isn't valid because the value of windowID and Pan_ToolNum will set to whatever the createWindow / createPanel functions return.
What you could do here though is to create an array and store the handles of the windows in the array. When you want to delete the windows, loop through the array using a for..next loop calling deleteGadget on each value in the array.


BlueGUI Windows Plugin

Login to post a reply

Server time is: 2025-05-18 22:27:20
Your offset time is: 2025-05-18 22:27:20