Not sure if this is a bug...

7 messages - 1273 views

I'm not sure whether this is a bug or by design. But the way the FrameHandler handles the Frame stack is a bit strange. If I push a frame on the stack and then later in another screen I push that same screen on the stack again, it doesn't get activated. I think that the stack should work so that if I push a frame on it, it should automatically go on top. Or am I missing something ?

At present, FrameHandler.pushFrame(frame) do not 'repush' a frame if it was already present in the stack, and the frame stay at its position in the stack. Is that the origin of your interrogation ?

Do you want to put your frame on top of all ? Else you can remove the frame en push it again and it will be on top.

If I push a frame into the stack that already is in the stack then shouldn't it go on top ? What I'm trying to achieve (among other things) is a way to show a frame from multiple different screens. And when I remove that frame, I want to go back to the frame from which I showed it. So basically some kind of push/pop stack operations.

Yes, push frame do not put it on top. In some case it is preferable to assume the presence of a frame by repuching it without change its position if it was already present. It's right that at present there's no way to put a frame on top. But we can imagine adding de putFrameOnTop(frame) method on FrameHandler.

Ok, I understand the remove problem. I think the putFrameOnTop method could solve it no ?

Yeah, I guess it would. Or maybe give a boolean parameter to the pushFrame - method that defaults to false. If it's true, the frame is pushed on top. It would also be nice if I remove a frame from the stack that the next frame on top of the stack would become active.. That way I could just push a frame on top of the stack and once I'm done with it, remove it and the previous frame (whichever it was) would become active.

Yes, or have two method : pushFrame(frame) and pushFrame(frame, putOnTop).

Else all frames are already active. A message can pass through all frames of a stack if each one return true in the 'onMessage' method.

Then in this case a frame isn't more active if it's in top or not.

Oh.. Sorry, by active I meant visible :) But just realised that that really isn't frame's problem as it in essence isn't even part of kuix but kutil. But anyway. It would be nice if the frame could be notified when it is moved on top of the stack. That way it could show it's screen etc. I was thinking all the time that moving the frame on top of the stack would make it visible, but it's me who is making it visible in onAdded method. And I guess that method is called only once when the frame is added to the stack. So on(Something) method would be nice so it would be possible to make the screen visible when the frame is pushed on top.

Maybe there should be the notion of an "active" frame. And the frame on top of the stack is always the active one. That way there could be onActivated, onDeactivated methods or something along that line.