You will not be able to post if you are still using Microsoft email addresses such as Hotmail etc
See here for more information viewtopic.php?f=20&t=7296

exxos blog - random goings on

Blogs & guides and tales of woo by forum members.
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post 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
Capture.PNG (96.06 KiB) Viewed 913 times

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

2.PNG
2.PNG (92.51 KiB) Viewed 913 times

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:
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post 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
Capture.PNG (133.78 KiB) Viewed 906 times

EDIT:

This is so cool! :lol:

I can move the window here

1.PNG
1.PNG (88.57 KiB) Viewed 900 times

Or here

2.PNG
2.PNG (125.31 KiB) Viewed 901 times

or even here :lol:

3.PNG
3.PNG (64.6 KiB) Viewed 901 times

Bow down to my window moving wizardry! :lol:
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post 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
Capture.PNG (138.05 KiB) Viewed 890 times

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

2.PNG
2.PNG (114.06 KiB) Viewed 890 times
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post 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
IMG_0349.JPG (209.57 KiB) Viewed 883 times
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

Close enough 8-)

Capture.PNG
Capture.PNG (145.63 KiB) Viewed 872 times

Next to start on the actual drawing routines...
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post 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
Capture.PNG (118.14 KiB) Viewed 851 times
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post 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
Capture.PNG (128.22 KiB) Viewed 848 times

EDIT:

Oddly works fine in MiNT :shrug:
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

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


User avatar
stephen_usher
Site sponsor
Site sponsor
Posts: 6758
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: exxos blog - random goings on

Post 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.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
exxos
Site Admin
Site Admin
Posts: 25749
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

stephen_usher wrote: Tue Dec 20, 2022 7:23 pm 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.
Post Reply

Return to “MEMBER BLOGS”