[Prev][Next][Index][Thread]

Re: icons...again



"tim" <tjv1@cs.waikato.ac.nz> writes:

> I am having no success at all trying to get icons into my dylan
> application.
> 
> I tried using the win32-icon class to make an icon. this didn't
> work. eg
> 
> read-image-as(<win32-icon>, "iconname", #"small");

Have you included the icon in a resource?

As an example, I have a resource file included which contains:

CLOCK          ICON   DISCARDABLE "clock01.ico"

Where clock01.ico is an icon in the project.

Use the following duim libraries:

  use duim;
  use win32-duim;

Use the folling duim modules:

  use duim;
  use win32-duim, import: { <win32-icon> };

Here is the example main code:

  define constant $clock-icon = 
      read-image-as(<win32-icon>, "CLOCK", #"icon"); 

  define frame <icon-frame> (<simple-frame>)
    pane the-icon (frame)
      make(<label>, label: $clock-icon);
  
    layout (frame)
      labelling("The clock icon")
        frame.the-icon;
      end;

  end frame <icon-frame>;

  define method main () => ()
    start-frame(make(<icon-frame>));
  end method main;

  begin
    main();
  end;  

This displays a frame with the icon in it. I've made the example
project that demonstrates this available at:

http://www.double.co.nz/dylan/projects/icon.htm

Hope that helps.

Chris.
-- 
http://www.double.co.nz/dylan



Follow-Ups: References: