colo939 - 2008-07-23

I am having trouble creating and using images.  I want to create an image from a .gif file and apply that image to a label.  I tried using the same syntax shown in the documentation for the image option but my code does not work.  Here are several methods I have tried along with the errors they generated.

frame(".hearts1");
label(".hearts1.holdLabel");
images(create, photo, "cardface") -file("card27.gif");
".hearts1.holdLabel" << configure() -image("cardface");
  
  ====> error: no match for call to ‘(std::string) (const char [6])’

string img(images(create, photo, "cardface") -file("card27.gif"));
".hearts1.holdLabel" << configure() -image(img);

  ====> error: no match for call to ‘(std::string) (std::string&)’

Neither of these methods work, and neither have several other methods I tried.  I have confirmed that the name of the .gif file is correct and that it is in my working directory.  I'm not sure what else could be wrong.  If you could explain to me what I am doing wrong and show me some example source code that shows how to create an image and set a label's image property I would really appreciate it.  Thank You!

James D. Hasselman