Greetings perl-win32-users,

Not sure what group to post this to so I am trying this one first.

I have a perl TK script that uses StayOnTop. It works fine when I run
it from Komodo but when I try to make an exe with PerlApp, it does not
work. I have installed StayOnTop with the graphical PPM and the module
is in site\lib\tk as expected. When I test from perlapp, I get the
error message listed below. I have also pasted the relevant portion of
StayOnTop.pm.

Bareword found where operator expected at
/<D:\Perl\program_changer.exe>Tk/StayOnTop.pm line 107, near "case
METHOD_ATTRIB"         (Do you need to predeclare case?) syntax error
at /<D:\Perl\program_changer.exe>Tk/StayOnTop.pm line 99, near ") {"
syntax error at /<D:\Perl\program_changer.exe>Tk/StayOnTop.pm line
107, near "case METHOD_ATTRIB " Global symbol "$obj" requires explicit
package name at /<D:\Perl\program_changer.exe>Tk/StayOnTop.pm line
108. BEGIN failed--compilation aborted at program_changer.pl line 6.

ub stayOnTop {
        my ($obj) = @_;

        $method ||=  $obj->get_method;
        #warn "Chosen method is $method";

        switch ($method) {

                case METHOD_WINAPI {
                        $obj->update;
                        # HWND_TOPMOST (-1) and SWP_NOSIZE+SWP_NOMOVE (3)
                        $win32_winpos->Call(hex($obj->frame()),-1,0,0,0,0,3);
                }

                case METHOD_ATTRIB {
                        $obj->attributes(-topmost => 1);
                }

                case METHOD_WMSTATE {
                        my($wrapper) = $obj->toplevel->wrapper;
                        $obj->property('set', '_NET_WM_STATE', "ATOM", 32,
                                ["_NET_WM_STATE_STAYS_ON_TOP"], $wrapper);
                }

                case METHOD_SIMPLE {
                        my $stay_above_after;
                        $obj->bind("<Visibility>" => sub {
                                if ($repeat_id) {
                                        $obj->deiconify;
                                        $obj->raise;
                                }
                        });
                        $repeat_id = $obj->repeat(1000, sub {
                                $obj->deiconify;
                                $obj->raise;
                                undef $stay_above_after;
                        }) unless defined $repeat_id;

                }

                else {
                        die "Invalid method type [$method]";    
                }
        }
}


--
Best regards,
Spencer Chase        mailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to