[MaxGUI] Child Window Behaviour on Mac OS X

BlitzMax Forums/BlitzMax Programming/[MaxGUI] Child Window Behaviour on Mac OS X

SebHoll(Posted 2006) [#1]
Hi,

In short, it appears child works don't work as they should on Mac. When a window has a parent, the child window should:

> Not be able to leave the confines of the parent window
> Should minimize and maximize (hide and show) with parent window
> Should stay on top of parent window and remain visible whenever the parent is (unless hidden)

On Mac, child windows don't appear to follow any of those rules. They appear as if you had called 2 independent CreateWindow functions with no parenting specified at all.

Sample Code:

SuperStrict

Global wndParent:TGadget = CreateWindow("Parent Window",50,50,700,500,Null,15)
	Global wndChild:TGadget = CreateWindow("Child Window",50,50,300,200,wndParent,15)

MaximizeWindow(wndParent)

Repeat

	Select WaitEvent()
	
		Case EVENT_WINDOWCLOSE;If EventSource() = wndParent Then End
		
	EndSelect

Forever


Cheers


Seb


skidracer(Posted 2006) [#2]
Sorry Sebs, that behavior (MDI) is a false expectation not a bug. The behavior of MaxGUI in this regards is consistant on Windows and Mac.


SebHoll(Posted 2006) [#3]
Sorry skid, what do you mean? On Windows, if you run the above code, then the child window will disappear with the parent window when the parent window is minimized, and will move with the parent window when it is moved.

On Mac it doesn't. I can see what you are saying about MDI (and I know it's not supported but basic parenting seem to work on Windows so I thought it would on Mac as well).

Do you see what I mean?


skidracer(Posted 2006) [#4]
Sorry not having a good day... I was referring to your first point about the confines of the window (and disagree with you about the movement issue). I agree with you on the second and third points re always ontop and minimize.

There is an undocumented WINDOW_CHILD flag for the movement / confines issues, I'll test that again when I have a look at your clipping code as I think that was the main issue with it not becoming standard.


SebHoll(Posted 2006) [#5]
Fantastic, thanks (and I'm sorry about the mix-up). If it makes you feel any better, I've had a bad day also. I'm really new to Mac and have thrown myself in at the deep-end with trying to get Max'd GUI to run on it. The good thing is that it is slowly making my code cleaner as I perform debugging. I just seem to keep hitting problem after problem (hopefully, this WINDOW_CHILD thing will work and I can progress soon).

Anyways, it's nearly 1am in the morning here in the UK, so I'm calling it a night.


Brucey(Posted 2006) [#6]
Since I haven't touched on child windows in GTK yet, are points 2 and 3 defacto for a child window?
Is there anything else that should happen there?

argh... so much to cover...

btw, I don't think the "confined" point applies on gtk either...