in reply to Re: Set Icon
in thread Set Icon
Thanks BOD! That worked perfectly for the TK app. Would this work for the Win32::Console app too?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Set Icon
by Don Coyote (Hermit) on Dec 23, 2020 at 10:22 UTC | |
Hello PilotinControl I have been playing with Tk a little bit recently, but the question of whether Win32::Console does, in terms of icons, what Tk does seems a little off the mark. Tk and Console are two different applications. When you ask does this work with Console in the same way, I think you need to explain in a little more detail what it is that you are trying to do that should be the same for both Tk and Console. Win32::Console provides an api for interacting with the console, whereas Icons are usally an aspect of the window manager. In Tk terms you could think of Console as a special type of interactive Text widget, housed within a Top-Level frame. It doesnt really make sense to output an icon to a Text widget, although not saying that cannot be done, however consider the prevalance of ascii art on consoles. The smallest units of the console screen or output buffer is the character/font. Whereas the window manager needs to place an icon within say a top-level window bar, or for example on the desktop screen if the app is minimized. For Win32::Console to do something like this you might have to look for a related namespace that interacts with the window-manager of the console, rather than the console itself. Are you trying to create a new application or a new shell? I would suggest to continue hacking on Tk. And to gain better insight to differences of the screen and the widget also revisit the geometry managers, as well as the seemingly innocuous entry and scrollbar widgets. Understanding these widgets properly, as well as how the Top-Level windows interact may help towards understanding issues around when and where icon images can be used. If you have a bit of time of the holidays, maybe try using different geometry managers to position the widgets within different top-level windows. This is actually a very insightful practice. Of course, if I have missed the point of what it is you are trying to do, please do re-iterate in a little more detail what it is you are trying to achieve with Win32::Console that you are achieving with Tk::* hope this helps | [reply] |
by PilotinControl (Pilgrim) on Dec 23, 2020 at 13:18 UTC | |
Hello Don, | [reply] |
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. | [reply] [d/l] [select] |
|
Re^3: Set Icon
by Bod (Parson) on Dec 23, 2020 at 00:17 UTC | |
Sorry, I've not used Win32::Console so can't help there. | [reply] |
by PilotinControl (Pilgrim) on Dec 23, 2020 at 03:25 UTC | |
@BOD | [reply] |