Page 243 of 336

Re: exxos blog - random goings on

Posted: 19 Dec 2022 15:54
by exxos
So moving the window turned out to be far more annoying than I thought it would be :roll:

For example just simply doing this will draw the main object tree on the screen in the centre which obviously works fine.

Code: Select all

form_center tree&,x,y,w,h
junk=objc_draw(tree&,0,10,x,y,w,h)
However I get the WM_MOVED event, which I then relocate the window to. Where you can just make out the title bar in the image below has actually move down the screen. However the actual object tree is still drawing in the original place and I have no idea why because it uses the same coordinates as the window for starters :roll:

Capture.PNG

If I remove the objc_draw line you can see the locations are correct with the main window.

2.PNG

So no idea what is going on :cry:

From what I can gather the form_centre might be recalculating the objects XY locations and objc_draw Does not actually draw the objects that the location past in that function :roll:

Re: exxos blog - random goings on

Posted: 19 Dec 2022 16:28
by exxos
Ahh yep seems have to set objects location manually :roll: Seems it's the setob_x 0,x and setob_y 0,y stuff.

Capture.PNG

EDIT:

This is so cool! :lol:

I can move the window here

1.PNG

Or here

2.PNG

or even here :lol:

3.PNG

Bow down to my window moving wizardry! :lol:

Re: exxos blog - random goings on

Posted: 19 Dec 2022 18:21
by exxos
Something else which doesn't add up literally.. Using the form sent to function to get the size of the main GB6 container... For some reason the X-axis is a lot lower than it should be :shrug:

Capture.PNG

The container window is highlighted in block black below.. So don't know how it is miscalculating that container size :roll:

2.PNG

Re: exxos blog - random goings on

Posted: 19 Dec 2022 19:03
by exxos
FFS. Might as well call it a totally useless function then really. I guess it would just be quicker to write my own routine to work this out then :roll:

IMG_0349.JPG

Re: exxos blog - random goings on

Posted: 19 Dec 2022 19:35
by exxos
Close enough 8-)

Capture.PNG

Next to start on the actual drawing routines...

Re: exxos blog - random goings on

Posted: 19 Dec 2022 23:57
by exxos
The next annoying problem is when the main GB7 screen is closed to run the test, I store the window locations to restore later.. BUT.. its feking triggering the WM_MOVE event TWICE when the window opens. So its running the window draw routine, which is corrupted basically as its not opened the window yet.. then the GB7 routines run and draw the main window.

So it ends up like this :roll:

Where the proper window is about half way down.

Capture.PNG

Re: exxos blog - random goings on

Posted: 20 Dec 2022 00:28
by exxos
Something else which is odd. If I drag the window off the screen, the GEM window is fine, but the objc_draw function wraps around the screen. I guess your not supposed to move stuff off-screen then :roll:

Capture.PNG

EDIT:

Oddly works fine in MiNT :shrug:

Re: exxos blog - random goings on

Posted: 20 Dec 2022 18:56
by exxos
Got slightly distracted with the side quest problem

But I seem to have developed a new problem which is really bizarre. A video speaks thousand words.

Basically looks like moving the window works fine on all the redraws work fine. However some point intermittently seems to randomly click a button in the window or even a menu option which makes no sense at all. Right at the end of the video he went into the menu and quit back to the desktop.. All by just moving the window ?! And also the window seems to get corrupted as well when this starts happening. Madness.



Re: exxos blog - random goings on

Posted: 20 Dec 2022 19:23
by stephen_usher
Possibly allocating more and more memory, not freeing it and running out of memory but not checking the return value so something starts overwriting the stack?

Accidental memory overwriting often will cause this sort of thing.

Re: exxos blog - random goings on

Posted: 20 Dec 2022 19:43
by exxos
stephen_usher wrote: 20 Dec 2022 19:23 Possibly allocating more and more memory, not freeing it and running out of memory but not checking the return value so something starts overwriting the stack?

Accidental memory overwriting often will cause this sort of thing.
Interesting, I don't think I am doing cleanup on the window. I'll hack something in and see what happens.