Iconic for shaped windows

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Iconic for shaped windows

Post by keyless » Thu Jan 29, 2009 7:26 pm

This is not a bug in version 2.8.1, but I think it is in versions 2.9 and 3.0

If you make or have a shaped stack window and put a button on it with script to set Iconic to true, the window doesn't minimize to the taskbar like it did just fine in 2.8.1, rather it just moves the window to just below the taskbar with just part of it sticking up above the taskbar.

Is there a solid workaround to get this working? otherwise it is a real dealbreaker to upgrading.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Jan 29, 2009 8:15 pm

Hi keyless,

Have you reported the bug?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Post by TonyL » Thu Jan 29, 2009 9:42 pm

I can confirm this. I am having the same problem. :cry:

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Post by TonyL » Thu Jan 29, 2009 10:15 pm

Note: I have reported the bug to quality control.

http://quality.runrev.com/qacenter/show_bug.cgi?id=7671

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Jan 29, 2009 11:32 pm

I thought this had been discussed in this http://forums.runrev.com/phpBB2/viewtop ... =9774#9774 thread,

and there was a bug report http://quality.runrev.com/qacenter/show_bug.cgi?id=5864

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Post by TonyL » Fri Jan 30, 2009 4:14 am

there was a bug report
The bug report you refer to has version 2.81 listed as having this problem. I thought only 2.9 and 3.0 were experiencing this problem.

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Fri Jan 30, 2009 4:54 am

Mark wrote:Hi keyless,

Have you reported the bug?

Best,

Mark
I was going to report it but I don't actually own 2.9 or 3.0. Someone who does just reported to me that one of my stacks did that in his IDE.

...Yes the earlier report was for 2.8.1 and I don't have that issue 2.8.1 and that is probably why it went inconfirmed for so long.

This was discussed before but it never came to light if it was a clear reproducable bug in 2.9 and 3.0. It looks now that it is.

Can someone who has 3.0 or 2.9 try some work arounds, i suspect locking screen and changing to a regular stack just before setting iconic might work.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Jan 30, 2009 11:43 am

Hi,

I have tested this and can confirm the bug. I have also added a few comments to the QCC (see the links posted above).

As to a workaround, I tried to set an icon in the task bar with a little menu, but this doesn't work correctly because of this bug http://quality.runrev.com/qacenter/show_bug.cgi?id=7672 . So, I think we're kind of stuck.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Fri Jan 30, 2009 2:43 pm

The only way I found is to set the windowshape to 0 on suspendstack and set it to the shape again on resumestack. However that looks rather cheesy. :(

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Me thinks I found...

Post by TonyL » Sat Jan 31, 2009 12:36 am

A work around.

Please let me know if this work around works. It seems to in 3.0 Gm3

on preOpenStack
set the decorations of this stack to "title"
end preOpenStack

I tried this and it did indeed iconify the stack to the taskbar on startup with a custom window shape. Also, if you hit the windows: "Show Desktop Icon" your stack will iconify to the windows taskbar.

To test, compile a standalone with a custom shape window with the above code in your preOpenStack handler. That's it!

PS if this works for you please donate $1,000000000 to my paypal account.

Let me know if this works, it does for me in XP and Vista

Tony

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Jan 31, 2009 12:47 am

Hi Tony,

You did a great job. This works fine for me on Win XP, Rev 3.x.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Post by TonyL » Sat Jan 31, 2009 12:57 am

You did a great job. This works fine for me on Win XP, Rev 3.x.
Thank you Mark. The only problem I have noticed is if you click on the icon in the taskbar, it does not maximize or minimize like your program would if it was not a custom shape window.

Anyhow, at least the program icon is now visible in the taskbar. That's a good start.

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Got it!

Post by TonyL » Sat Jan 31, 2009 6:47 am

Finally nailed this ****er.

Works like it's suppose to. Here's what you need to do to make this work:

#1. Your custom shape must be a 1 bit transparency. Gif will work, png-8 will work. png -24 will not work. Haven't tried any other format yet.

# 2. Code:

in your mainstack:

on preOpenStack
set the decorations of this stack to "title","minimize"
end preOpenStack

on unIconifyStack
set the windowshape of this stack to 1519 -- or whatever your custom shape ID is.
set the decorations of this stack to "title","minimize"
set the visible of this stack to true
end unIconifyStack

in your minimize window button:

on mouseUp
set the visible of this stack to false
set the windowshape of this stack to 0
set the iconic of this stack to true
end mouseUp

#3. Now save and compile to standalone. Note after compiling, the title-bar will be visible in your app.

#4. Close rev. Go to your saved standalone folder and delete it.

#5. open rev again. Set your decorations to empty. Set your custom window shape to whatever image id you want to.

#6. Save and compile again.

Now quit rev and run your standalone. If everything is working right, clicking on the icon in the Windows Taskbar will minimize and maxamize your app. Clicking on the "Show Desktop" icon in the Windows Taskbar will also minimize your app to the taskbar. Your minimize button should work too.

Tested in XP and Vista.

The only think I noticed in Vista was a little flicker when maximizing and minimizing.

Test this and let me know how it works on your system. If it holds up that's fantastic. If not, I have to scrap my custom window shape app and go with the standard rect with a titlebar.

Please let me know if you come up with any improvements.

Thanks a lot,

Tony

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Correction

Post by TonyL » Sat Jan 31, 2009 6:04 pm

on mouseUp
set the visible of this stack to false
set the windowshape of this stack to 0
set the iconic of this stack to true
end mouseUp
It is not necessary to set the widowShape to 0

my bad!

TonyL
Posts: 24
Joined: Mon Aug 07, 2006 1:15 am

Correction

Post by TonyL » Sat Jan 31, 2009 11:41 pm

on unIconifyStack
set the windowshape of this stack to 1519 -- or whatever your custom shape ID is.
set the decorations of this stack to "title","minimize"
set the visible of this stack to true
end unIconifyStack
correction:

on unIconifyStack
set the visible of this stack to true -- no need to set the windowShape or decorations
end unIconifyStack

my bad again...

Post Reply