> This problem only appears inFirefox. No problem in Safari or Chrome.
> --
>
> You received this message because you are subscribed to the Google
> Groups "Cappuccino & Objective-J" group.
> To post to this group, send email to objec...@googlegroups.com.
> To unsubscribe from this group, send email to objectivej+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/objectivej?hl=en
> .
>
>
So the code should be like this:
var myButton = [[CPButton alloc] initWithFrame:CGRectMake(10, 10, 20,
20)];
[myButton setImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle
mainBundle] pathForResource:@"myButton_normal.png"]]];
[myButton setAlternateImage:[[CPImage alloc] initWithContentsOfFile:
[[CPBundle mainBundle] pathForResource:@"myButton_active.png"]]];
[myButton setImagePosition:CGPointMake(0, 0)];
[myButton setBordered:NO];
[contentView addSubview: myButton];
http://thisagree.com/files/custom_button_fail.mov
Elias
https://gist.github.com/cbc2179ec48d6c041c42
But I have a question here. The normal button behaviour is that when
you click on it and drag the mouse away from the button not performing
a mouseUp the button should be in an initial state.
At my solution the button is beeing pressed although the mouse is
outside of the button rect.
I took a look into the CPControl.j and there is something I thought it
would help.
[self trackMouse:anEvent];
But that didn't change the problem.
Du you have any idea about it?
Going back to your original code, here's another problem line:
> [myButton setImagePosition:CGPointMake(0, 0)];
setImagePosition doesn't take a point, it takes a constant. One of the following:
CPNoImage;
CPImageOnly;
CPImageLeft;
CPImageRight;
CPImageBelow;
CPImageAbove;
CPImageOverlaps;
You should try updating your original code and see if that works for you.
-Ross
I posted a ticket yesterday (01-02-2010) on the button state problem
you described in this thread.
http://github.com/280north/cappuccino/issues#issue/392
CPButton state toggles when it should not
The test case referenced in my ticket is:
http://dl.dropbox.com/u/2248/ToggleButtonTest.zip
Sincerely,
Joel
> But I have a question here. The normal button behaviour is that
> when you click on it and drag the mouse away from the button
> not performing a mouseUp the button should be in an initial state.
> At my solution the button is beeing pressed although the mouse is
> outside of the button rect.
I thought you were talking about the problem I'd reported, that
CPButton state toggles when it should not.
Sorry if I misinterpreted your comment!
Sincerely,
Joel
Can you send me your code? I'm not sure I am able to reproduce the problem myself, and I want to make sure we track this down.
-Ross
http://dl.dropbox.com/u/3167936/etc/Custom%20Button.zip
If possible please post a patch or describe how the problem was fixed.
I'm working on a project and I can't exactly wait indefinitely for the
next release.
Also, where is the "jake" branch? Do you mind post the URL to that
github project please?
Without Wax
Billy
> >>>>> But it again fails inFirefox... :( I really don't know what to do
> >>>>>>>> Keep in mind this is only inFirefox. Safari and Chrome just work