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

Allow icons to be used anywhere? #248

Closed
mpmc opened this Issue Sep 10, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@mpmc
Contributor

mpmc commented Sep 10, 2017

Pretty much as title, I'd like to use the built-in png icons before a label, I can't seem to find anything about doing this in the docs. :(

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Sep 10, 2017

Owner

A couple of thoughts here:

  • Adding an image actually creates a label and embeds the image in it. You can simply call .addImage() and pass it the path to an icon - the icons live in gui.icon_path

  • There's no support for mixing images & text in a single label - but you can access the label an image is embedded in and play around with it using the tkinter commands. The image labels all live in a dictionary called: gui.n_images (calling .addImage() returns the image object, not the Label).

Owner

jarvisteach commented Sep 10, 2017

A couple of thoughts here:

  • Adding an image actually creates a label and embeds the image in it. You can simply call .addImage() and pass it the path to an icon - the icons live in gui.icon_path

  • There's no support for mixing images & text in a single label - but you can access the label an image is embedded in and play around with it using the tkinter commands. The image labels all live in a dictionary called: gui.n_images (calling .addImage() returns the image object, not the Label).

@mpmc

This comment has been minimized.

Show comment
Hide comment
@mpmc

mpmc Sep 10, 2017

Contributor

Adding an image actually creates a label and embeds the image in it. You can simply call .addImage() and pass it the path to an icon - the icons live in gui.icon_path.

Ah, thanks! Could you add a note to the docs about this? :)

Contributor

mpmc commented Sep 10, 2017

Adding an image actually creates a label and embeds the image in it. You can simply call .addImage() and pass it the path to an icon - the icons live in gui.icon_path.

Ah, thanks! Could you add a note to the docs about this? :)

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Sep 11, 2017

Owner

Will do, will also look into options for labels with both images & text as a separate request...

Owner

jarvisteach commented Sep 11, 2017

Will do, will also look into options for labels with both images & text as a separate request...

@jarvisteach jarvisteach added this to the 0.08 milestone Sep 14, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Sep 14, 2017

Owner

OK, decided to include an extra function - addIcon, it does the work for you...

Owner

jarvisteach commented Sep 14, 2017

OK, decided to include an extra function - addIcon, it does the work for you...

jarvisteach added a commit that referenced this issue Sep 14, 2017

Can now add icons #248
iconImages & iconButtons
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Sep 14, 2017

Owner

also addIconButton

Owner

jarvisteach commented Sep 14, 2017

also addIconButton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment