0

Strange behaviour with windows (setVisible calling method onMinimize)

asked 2011-10-24 14:35:02 +0800

iloitam gravatar image iloitam
9

Hi all!

I'm facing a very strange situation.
I have an application where it simulates a desktop enviroment (like Windows, for example). When i open a window, i put a button in a toolbar to represent it's state (open) and highligh it with a css property. When i minimize this window, i remove the highlight effect from the button. The problem is when i try to maximize this window. I click the button in the toolbar to reopen the window and it highlighs and remove the highligh effect almost instantly. I debugged and found that when i click in the button to reopen the window, the method .setVisibile(true) calls the method onMinize from my window (where the "remove highlight" effect is located).

Why the .setVisible(true) calls onMinimize?

Here's a sample of my code:

The button's onClick definition (where it "maximizes" the open window):


btnWindowMinimized.addEventListener("onClick", new EventListener() {	
			
			@Override
			public void onEvent(Event arg0) throws Exception {

                                        materialWindow.setVisible(true);
					materialWindow.setFocus(true);
                                        btnWindowMinimized.setStyle("background: transparent");

                        }

 

The onMinimize method:


public void onMinimize$purchaseStorageWindow() throws InterruptedException{

                       btnWindowMinimized.setStyle("background: #ADD8E6");

}

Am i doing something wrong? Is there a better way of implementing the maximize and minimize function? I read here in the forums that the window minimize button only sets the window attribute visible to false. Is this correct?

Any help would be appreciated. Thanks in advance!

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-10-25 04:27:51 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

you didn't do anything wrong.

The default handle of ZK Window will invoke setMinimize (Source Here)

or you can customize some effect for looks like a really minimize (From ZK Demo)

link publish delete flag offensive edit

answered 2011-10-25 11:58:31 +0800

iloitam gravatar image iloitam
9

Thanks for the answer!

It's good to know i'm not doing anything wrong... I'll try to figure a way to do what i want to do!

If anyone has any ideas on how to do this, it would be appreciated! ;)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-10-24 14:35:02 +0800

Seen: 268 times

Last updated: Oct 25 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More