Image Button Breaks in Firefox
Reported by nciagra | September 6th, 2008 @ 04:03 PM | in 0.5.2
In Firefox 3, declaring a button with an image without explicitly stating the size of the image causes the image to fail to display.
var button = [[CPButton alloc] initWithFrame:CGRectMake(0,0,300,150)];
[button setBordered:NO];
[button setImage:[[CPImage alloc] initWithContentsOfFile:"Resources/Layout/Logo.png" size:CGSizeMake(300,150)]]; //size is required. remove size and image fails to display
[view addSubview:button];
Comments and changes to this ticket
-
Francisco Tolmasky September 8th, 2008 @ 01:53 AM
I think this is by design. I don't know why the sizeless init is in there if it is.
-
Ross Boucher September 8th, 2008 @ 07:58 PM
- State changed from new to open
The sizeless init can be used, but you can't set it as the image for an imageView until it has loaded. If you init the image, and set yourself up as the delegate, you'll get the imageDidLoad delegate method. You can use that to set the image to an image view (or button, etc.).
This is definitely a pain, which is why you should specify the size if at all possible.
-
admin (at 280north) September 17th, 2008 @ 07:46 PM
- State changed from open to resolved
- Tag changed from appkit, bug to appkit, bug
- Milestone set to 0.5.2
(from [334776df129362057957a94282d5f60c339b5396]) Various fixes to support creating images with specifying the size upfront.
[#41 milestone:0.5.2 state:resolved]; [#20 milestone:0.5.2 state:resolved]; http://github.com/280north/cappu...
-
admin (at 280north) September 18th, 2008 @ 12:56 PM
(from [e95c2b9efce252b2f76fdff7ffb1b12bc06c9d83]) Various fixes to support creating images with specifying the size upfront.
[#41 milestone:0.5.2 state:resolved]; [#20 milestone:0.5.2 state:resolved]; http://github.com/280north/cappu...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.
People watching this ticket
Referenced by
- 20 Image Button Breaks in Firefox [#41 milestone:0.5.2 state:resolved]; [#20 milestone:0.5....
- 20 Image Button Breaks in Firefox [#41 milestone:0.5.2 state:resolved]; [#20 milestone:0.5....