Toolbar item setImage order matters
Reported by Stephan Eggermont | September 26th, 2008 @ 10:20 AM
Setting the image of a toolbaritem after setting the window toolbar doesn't work.
Does not work:
[item setLabel: 'Een'];
[item setEnabled: YES];
[toolbarItems addObject: item];
[toolbar setDelegate: self];
[toolbar setDisplayMode: CPToolbarDisplayModeIconAndLabel];
[toolbar setVisible: YES];
[theWindow setToolbar: toolbar];
[item setImage: image];
works:
[item setImage: image];
[item setLabel: 'Een'];
[item setEnabled: YES];
[toolbarItems addObject: item];
[toolbar setDelegate: self];
[toolbar setDisplayMode: CPToolbarDisplayModeIconAndLabel];
[toolbar setVisible: YES];
[theWindow setToolbar: toolbar];
Comments and changes to this ticket
-
Francisco Tolmasky October 2nd, 2008 @ 08:32 AM
- State changed from new to invalid
This is by design. The toolbar doesn't use the actual item you give it, but rather makes a copy of it because the item may show up several times (either because it is in more than one toolbar or because it shows up multiple times in the toolbar itself). Thus, the toolbar item has to be in the state you want it to be in by the time it gets copied, or further changes won't affect the item in the toolbar.
-
Stephan Eggermont October 30th, 2008 @ 11:31 AM
I'm not sure I get this. Why is this a good thing? If it is, the documentation for CPWindow setToolbar: should mention this.
-
admin (at 280north) December 4th, 2009 @ 10:46 AM
- State changed from invalid to resolved
(from [a30250f758d0ba4a6b448d0c58ec533965d9b452]) Merge branch 'menus' into jake
Closes #73.
Closes #75.
Closes #121.
Closes #130.
Closes #197.Reviewed by me.
http://github.com/280north/cappuccino/commit/a30250f758d0ba4a6b448d...
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
- 73 CPKeyValueCoding methods for CPDictionary Closes #73. Closes #75. Closes #121. Closes #130. Closes ...
- 75 Toolbar item setImage order matters Closes #73. Closes #75. Closes #121. Closes #130. Closes ...
- 121 Need for a CPOpenPanel Closes #73. Closes #75. Closes #121. Closes #130. Closes ...
- 130 CPURLRequest content-type incorrect for POST Closes #73. Closes #75. Closes #121. Closes #130. Closes ...
- 197 CPTextField in toolbar seems not to work Closes #73. Closes #75. Closes #121. Closes #130. Closes ...