Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » changing button image make program crash
changing button image make program crash [message #18593] Fri, 10 October 2008 18:20 Go to next message
TeCNoYoTTa is currently offline  TeCNoYoTTa
Messages: 138
Registered: July 2008
Location: Egypt
Experienced Member

hello

i want to set some an image to a button

this is the image
http://img259.imageshack.us/img259/6812/cisl2te2.png
i looked at chameleon example but every time the program compiles but it crashes and Windows error ( send report / dont send appears)

this is the code
Button::Style ImageStyle()
{
	Button::Style s = Button::StyleNormal();
	s.look[0] = imgs::kkk;
	s.look[1] = imgs::kkk;
	s.look[2] = imgs::kkk;
	s.look[3] = imgs::kkk;
	s.pressoffset = Point(1, -1);
	return s;
}
void ImageSkin()
{
	Button::StyleNormal().Write() = ImageStyle();
}


and here

SetSkin(ImageSkin);
Button::Style imgsty;
imgsty = ImageStyle();
btn_download_all.SetStyle(imgsty);


please help me
Re: changing button image make program crash [message #18604 is a reply to message #18593] Sat, 11 October 2008 08:32 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member

Button::Style& ImageStyle()
{
	static Button::Style s = Button::StyleNormal();
	s.look[0] = imgs::kkk;
	s.look[1] = imgs::kkk;
	s.look[2] = imgs::kkk;
	s.look[3] = imgs::kkk;
	s.pressoffset = Point(1, -1);
	return s;
}


btn_download_all.SetStyle(imgsty);


SetStyle only stores a pointer.

Mirek
Previous Topic: Menu look correction for Vista
Next Topic: coloring menu background
Goto Forum:
  


Current Time: Tue Apr 23 17:11:38 CEST 2024

Total time taken to generate the page: 0.01358 seconds