Page 1 of 1

Two Iconic Problems

Posted: Sat Jun 13, 2009 3:09 pm
by alemrantareq
Hi everybody,
I'd be thankful if I get the solutions of these two problems. I made a stack using rev 2.8.1 and put the following script for it -

Code: Select all

on preOpenstack
  set the loc of this stack to the screenloc
  set the iconic of this stack to true
end preOpenstack

on iconifyStack
  hide this stack
  set the icon to 1003
  set the iconmenu to "About" & return & "Quit"
  pass iconifyStack
end iconifyStack

on iconmenuPick theItem
  if theItem is "About" then answer "This is created by me"
  else if theItem is "Quit" then quit
end iconmenuPick
i) the 1st problem is that, after making the stack iconic, it shows both "About" and "Quit" button in the taskbar; but only "About" btn works, not the "Quit" btn. Why?

ii) the 2nd problem is that, though i set the loc of that stack to the screenloc, it answers the dialog message at the top left corner of the screen after clicking btn "About", not in the center screen. Why?

Thanks in advance.

TAREQ

Posted: Sat Jun 27, 2009 3:48 pm
by alemrantareq
Its a long time passed and I've got no answer for any one of my probs. It really made me broken hearted. :cry:

Posted: Sat Jun 27, 2009 5:50 pm
by RRobert
Try this:

Code: Select all

on iconifyStack 
  hide this stack 
  set the icon to 1003 
  set the iconmenu to "About" & cr & "Quit" 
  pass iconifyStack 
end iconifyStack 

on iconmenuPick theItem 
   switch theItem
      case "About"
         answer "About"
         break
      case "Quit"
         answer "Quit"
         break
      default
   end switch
end iconmenuPick

Posted: Sun Jun 28, 2009 3:33 am
by alemrantareq
Thanks RRobert,
I just copy n paste your script into my stack. The "About" btn answers fine but the "Quit" btn still doesn't answering. Why?

Posted: Sun Jun 28, 2009 1:14 pm
by Bernard
alemrantareq, try putting a breakpoint before the line "switch theItem" to see what value 'theItem' contains (maybe it is " Quit" or "Quit ".

Alternatively, if you don't know what breakpoints are, you could just write this line before the switch begins:

put length(theItem) into msg


That way you will see if there are more than 4 characters when 'Quit' has been selected.

Posted: Sun Jun 28, 2009 4:39 pm
by alemrantareq
Sorry guys,
Actually I failed to figure out the main problem. The main problem is that, after minimizing, the first pick item whether its "About" or "Quit", works nicely; but when I right click on the icon and choose the other one, it doesn't work. That means if I first select "Quit", it answers nicely. And then if I select "About", it not works. Similarly, if I select "About" first, it works but "Quit" not. I've given a breakpoint but it not working. Pls, help me.

Posted: Tue Jun 30, 2009 3:22 pm
by RRobert
Did you tried the source with Rev 3.5.0?

Posted: Tue Jul 07, 2009 5:32 pm
by alemrantareq
sorry for delay,
No I'm using only rev studio v2.8.1 and I cant solve this iconic menu problem. pls help me.

Posted: Sun Jul 12, 2009 10:23 pm
by RRobert
You should try Rev 3.5.0 (you could try the trial), so we know if it is a 2.8.1 issue or a issue with the code.

Robert

Posted: Wed Aug 26, 2009 5:24 am
by alemrantareq
With rev 3.5, it works fine. Thanks :)

Posted: Thu Aug 27, 2009 3:09 am
by RRobert
alemrantareq wrote:With rev 3.5, it works fine. Thanks :)
Thats great. :)