Two Iconic Problems

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Two Iconic Problems

Post by alemrantareq » Sat Jun 13, 2009 3:09 pm

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

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Post by alemrantareq » Sat Jun 27, 2009 3:48 pm

Its a long time passed and I've got no answer for any one of my probs. It really made me broken hearted. :cry:

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Sat Jun 27, 2009 5:50 pm

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

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Post by alemrantareq » Sun Jun 28, 2009 3:33 am

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?

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm

Post by Bernard » Sun Jun 28, 2009 1:14 pm

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.

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Post by alemrantareq » Sun Jun 28, 2009 4:39 pm

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.

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Tue Jun 30, 2009 3:22 pm

Did you tried the source with Rev 3.5.0?

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Post by alemrantareq » Tue Jul 07, 2009 5:32 pm

sorry for delay,
No I'm using only rev studio v2.8.1 and I cant solve this iconic menu problem. pls help me.

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Sun Jul 12, 2009 10:23 pm

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

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Post by alemrantareq » Wed Aug 26, 2009 5:24 am

With rev 3.5, it works fine. Thanks :)

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Thu Aug 27, 2009 3:09 am

alemrantareq wrote:With rev 3.5, it works fine. Thanks :)
Thats great. :)

Post Reply