Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : What type of instance to use as an Icon for a Button ? #61

Open
Enzo-Demeulenaere opened this issue Jul 3, 2023 · 2 comments

Comments

@Enzo-Demeulenaere
Copy link

Hello,

I'm trying to add a little icon to a button and I tried using icon: (Smalltalk ui icons iconNamed: #glamorousAccept) just like I do for a menu but it seems that Forms aren't the type of instances expected by this icon: method.

Could you tell me how would you add an icon to a button item ?

Thanks

@Enzo-Demeulenaere
Copy link
Author

Ok after trying some things it seems that using BlElements works and fulfills what I needed but I'm open to suggestions if there are better ways to do that

@plantec
Copy link
Collaborator

plantec commented Jul 5, 2023

have a look at the examples.
This is the same for ToMenu and ToButton.
They use the same trait for that aspect (TToLabeledIcon)

m := ToMenu new icon: (ToImage inner: (Smalltalk ui icons iconNamed: #glamorousAccept)).
b := ToButton new icon: (ToImage inner: (Smalltalk ui icons iconNamed: #glamorousAccept)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants