Hi Guys,
-- As some of you may know I am working on an inspector window that I can package with a GUI program, because sometimes (at least in one of my programs) I want to see everything in an object (that contains status information about other NT service programs) without having to build screens to display it all. This is going very well and when I'm finished I intend to put it on the Smalltalk Goodies site. Since it is a window and the window needs/wants an icon for the upper left hand corner, I want to supply one. But I don't want to deal with trying to supply it from outside the two objects that are in the app I want to post to Smalltalk Goodies. To avoid an external icon or a DLL with the icon in it, I want to create the icon from code. This isn't too had but remembering how to do it is a PITA. So, I have created an instance side extension to CgIcon (attached and shown below) that when called will compile the code to create the icon in the class and method named. The extension should live in an "edit" app as it shouldn't get packaged. You use the method by selecting the open app that houses the class you want to compile the code to and then creating an instance of the CgIcon desired with some workspace code like so:
It will build the icon from the named DLL and resource number. It then tells the CgIcon to compile its matching code for you in the named class and method. Now I don't have to remember so much. Instantiations should feel free to add this extension to an edit app if they like. Lou
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. CgIcon.st (2K) Download Attachment |
Hi Lou,
-- You may or may not already know this, but.... StsImageManager class stores many icons used in the browsers as byteArrays. You could do the same for your inspector window and then you would not have to rely on anything external. I have some scripts around that will create the byteArrays from icons that I can dig up if you are interested. hth, Donald [|] On Friday, March 20, 2015 at 12:28:04 PM UTC-4, Louis LaBrunda wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Donald,
-- I didn't know that. I will have to take a look. Thanks. Lou On Friday, March 20, 2015 at 3:39:25 PM UTC-4, Donald MacQueen wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Lou,
-- Here are a few pieces of code I found that may be helpful: CgIcon fromFile: 'c:\temp\testicon32.png' (CfsReadFileStream open: 'c:\some.bmp') contents asByteArray. CgPixmap fromFile: 'c:\some.bmp' StsImageManager primImageFromSelector: #FolderMask StsImageManager loadOneImage: #LargeBallMask I spen a good bit of time last year in the icon world so ask away. Donald [|] You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Thanks - Donald
-- On Friday, March 20, 2015 at 4:36:02 PM UTC-4, Donald MacQueen wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by dmacq
Hey Donald, I hadn't seen everything in StsImageManager but it is basically doing the kinds of things I'm doing to create code to generate a CgIcon. I think the advantage of my extension is that if you can load an icon in (from any external source or from anything for that matter), you can then generate/compile code that will create the same icon from a method without needing the external form of the icon late. Lou On Friday, March 20, 2015 at 4:36:02 PM UTC-4, Donald MacQueen wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |