in reply to Re^3: Set Icon
in thread Set Icon

Hello Don,
I am working on 2 different applications. The Tk problem has been solved however the Win32 issue is still there. the $console->SetIcon as described in the Win32::Console write up isn't working as it should and I am sure I am missing something as everything else is working as described such as: Cursor positions, console sizes etc. Thanks for the advice!

Replies are listed 'Best First'.
Re^5: Set Icon
by Don Coyote (Hermit) on Jan 02, 2021 at 11:58 UTC

    Hi Pilot

    Logged yeterday but didn't see any responses in my chatbox till today. Probably my eyes/brain working effectively together again. I took the opportunity to hack on tk again yesterday, rereading the op. Its good to know everything else is working on the tk side, I was thinking there may be an update that affects usage of photo type images for icons somewhere.

    That would still be my main idea, though it could easily be something else. Mostly relating to the Console being a proprietary app, it would make sense that the icon should be immutable if your undertaking to incorporate the app in some build.

    When the Tk console spawns I get the Camel Icon. I shouldn't have thought this could be inheritance of the Icon through a shortcut, but need to rule that out.

    Similarly with portabe perls such as Strawberry. But again would need to decipher whats being used here.. is it the OS console or is it a front-end to perl that has a OS styling.

    Putting those aside if it is something to do with the perl namespaces, you could be missing something. I am kind of assuming this isnt time critical up to, you're just trying to figure out the icon at some point before project completion.

    I'll look at some Pod and see if anything occurs that may help.

    updateLittle bit later now. Looks as though you solved this from your replies to Bod and Pryrt. As much I would be saying as they have, except perhaps you might want to use File::Spec or similar to ensure the path is constructed properly.

    I spent a few hours, mainly trying to get a buffer to display without flashing off. So cant really test for the issues. Other than to suggest calling the setter using a valid console handle, $BUFFER->SetIcon(File::Spec->($ENV{USERPATH},qw/path to swirly.ico/) ). Not sure that the namespace would be expected to arbitrarily pick a buffer. When you call the sub by FQN Win32::Console::SetIcon(swirly.ico) the $consoleref is not supplied and the namespace may be inclined to think you are attempting to call a constant as a sub.