Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Image Button Breaks in Firefox

#20

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];

Reported by nciagra · September 6th, 2008 @ 04:03 PM

State: resolved
Milestone: 0.5.2
Assigned to: nobody

Activity

  1. Francisco Tolmasky
    Francisco Tolmasky

    I think this is by design. I don't know why the sizeless init is in there if it is.

    September 8th, 2008 @ 01:53 AM

  2. Ross Boucher
    Ross Boucher
    • 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.

    September 8th, 2008 @ 07:58 PM

  3. admin (at 280north)
    admin (at 280north)
    • 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 [CPImage initWithContentsOfFile:] is broken milestone:0.5.2 state:resolved]; [#20 Image Button Breaks in Firefox milestone:0.5.2 state:resolved]; http://github.com/280north/cappu...

    September 17th, 2008 @ 07:46 PM

  4. admin (at 280north)
    admin (at 280north)

    (from [e95c2b9efce252b2f76fdff7ffb1b12bc06c9d83]) Various fixes to support creating images with specifying the size upfront.

    [#41 [CPImage initWithContentsOfFile:] is broken milestone:0.5.2 state:resolved]; [#20 Image Button Breaks in Firefox milestone:0.5.2 state:resolved]; http://github.com/280north/cappu...

    September 18th, 2008 @ 12:56 PM

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.