I would not say they are ugly, they are beautiful in their own way! ;-)
Seriously, my answer to your question is that i would support some of the external themes, for now. As far as i know some themes uses tksvg, a library that requires probably not so much efforts to wrap from the lisp side but, unfortunately, i am not able to find in Debian yet (the only OS where i develop nodgui).
So for now i can support non-scalable themes, when tksvg will be available on Debian i'll try to use it as i did with tklib.
But for now i just pushed to the repository a little function: eval-tcl-file that will load/eval an external TCL script, as today i learnt TK themes are more or less TCL scripts! :)
So just write/download a theme and use (eval-tcl-file "file/path/theme.tcl") to load the theme and (use-theme "theme-name") to apply the theme to TK.
important note: using eval-tcl-file will make the TCL interpreter load and execute the contents of the file you passed as an argument to the function above, so better that you always use files you wrote or you got from trusted source, but as you are a lisper i think you already knows of this caveat! ;-D
I do not know if this answer satisfy you, let me know what you think if you please.
Bye!
C.
Hi!
> I think the built-in themes of tk are too ugly
I would not say they are ugly, they are beautiful in their own way! ;-)
Seriously, my answer to your question is that i would support *some* of the external themes, for now. As far as i know some themes uses `tksvg`, a library that requires probably not so much efforts to wrap from the lisp side but, unfortunately, i am not able to find in Debian yet (the only OS where i develop nodgui).
So for now i can support non-scalable themes, when tksvg will be available on Debian i'll try to use it as i did with `tklib`.
But for now i just pushed to the repository a little function: `eval-tcl-file` that will load/eval an external TCL script, as today i learnt TK themes are more or less TCL scripts! :)
So just write/download a theme and use `(eval-tcl-file "file/path/theme.tcl")` to load the theme and (use-theme "theme-name") to apply the theme to TK.
See https://notabug.org/cage/nodgui/src/master/src/demo-tests.lisp#L375
for a reference how to apply the themes.
*important note*: using `eval-tcl-file` will make the TCL interpreter load and *execute* the contents of the file you passed as an argument to the function above, so better that you always use files you wrote or you got from trusted source, but as you are a lisper i think you already knows of this caveat! ;-D
I do not know if this answer satisfy you, let me know what you think if you please.
Bye!
C.
Hi!
Seems that the next release of TCL/TK will include SVG support in the core distribution! :)
https://core.tcl-lang.org/tips/doc/trunk/tip/507.md
Bye!
C.
Happy that you find this patch good! I would keep this thread open until a proper way to deal with SVG images (and, therefore, with scalable themes) is implemented in nodgui.
Have fun with the library!
C.
Hi xxmy!
Happy that you find this patch good! I would keep this thread open until a proper way to deal with SVG images (and, therefore, with scalable themes) is implemented in nodgui.
Have fun with the library!
C.
This is huge! Well done, thank you!
before:

after:


I cloned ttkthemes locally:
git clone https://github.com/TkinterEP/ttkthemes/
Then, it is as simple as you said. We load the tcl file and set the theme inside nodgui loop.
```lisp
(with-nodgui ()
(eval-tcl-file "ttkthemes/ttkthemes/png/yaru/yaru.tcl")
(use-theme "yaru")
```
note: the "scid" and "smog" themes bugged.
I didn't try with the awthemes yet.
I am going to link this thread from the library's home page, thanks for trying!
I didn't try with the awthemes yet.
Likely this theme uses SVG images for rendering the widget, but if it does not works with TK 8.6 starting from the next version will do! :)
Bye!
C.
Hi @vindarel
They look surprisingly nice!
I am going to link this thread from the library's home page, thanks for trying!
> I didn't try with the awthemes yet.
Likely this theme uses SVG images for rendering the widget, but if it does not works with TK 8.6 starting from the next version will do! :)
Bye!
C.
Would it make sense to ship the working themes (or a selection of) into nodgui itself? So we would only "(use-theme "adapta")" and done.
Now that I know themes are supported, I don't see myself not using one. That would mean: include the tcl source(s) in my project, include them in the lisp image when building a binary… this could be done once and for all in nodgui itself, I guess.
If & when I do it in my app, I'll come back and see if I can share the process. If you don't know what do do that's an idea ;)
Would it make sense to ship the working themes (or a selection of) into nodgui itself? So we would only "(use-theme "adapta")" and done.
Now that I know themes are supported, I don't see myself not using one. That would mean: include the tcl source(s) in my project, include them in the lisp image when building a binary… this could be done once and for all in nodgui itself, I guess.
If & when I do it in my app, I'll come back and see if I can share the process. If you don't know what do do that's an idea ;)
I am not in principle against ship the themes together with the library, but two questions arise:
some themes are under GPLv3, i am OK with this license that, in fact, i use in all my software, but nodgui is released under a different license: i believe that if i bundle the themes into the library (for example including the TCL code as a string in lisp source code) all the library should be re licensed under GPLv3, as i am not the only author of this library this change could be problematic (i think i do not need explicit permission to re license the code but this are legal questions and i am not an expert), other license are incompatible (like creative commons) and some are OK: BSD or similar
i do not think is a problem to include the TCL theme code in the library package as is and let the user load, at runtime, the theme, so the question here is: how can the library knows where to find the theme files? I am thinking of something like:
(defparameter *themes-directory* "...")
But which one should be a good default? ASDF has a couple of function to find files in the system but IIRC it is not a good idea to use asdf as a library for project in quicklisp, correct me if i am wrong.
So, if i figure out a good default for the special variable above (suggestions welcome!) i would be happy to include the themes along with the library, if not, i could just use nil for `themes-directory, and maybe include a script to download the themes (with a big disclaimer :-))
Looking forward for your opinion!
Bye!
C.
Hi @vindarel!
I am not in principle against ship the themes together with the library, but two questions arise:
- some themes are under GPLv3, i am OK with this license that, in fact, i use in all my software, but nodgui is released under a different license: i believe that if i bundle the themes into the library (for example including the TCL code as a string in lisp source code) all the library should be re licensed under GPLv3, as i am not the only author of this library this change could be problematic (i think i do not need explicit permission to re license the code but this are legal questions and i am not an expert), other license are incompatible (like creative commons) and some are OK: BSD or similar
- i do not think is a problem to include the TCL theme code in the library package as is and let the user load, at runtime, the theme, so the question here is: how can the library knows where to find the theme files? I am thinking of something like:
``` lisp
(defparameter *themes-directory* "...")
```
But which one should be a good default? ASDF has a couple of function to find files in the system but IIRC it is not a good idea to use asdf as a library for project in quicklisp, correct me if i am wrong.
So, if i figure out a good default for the special variable above (suggestions welcome!) i would be happy to include the themes along with the library, if not, i could just use `nil` for `*themes-directory*, and maybe include a script to download the themes (with a big disclaimer :-))
Looking forward for your opinion!
Bye!
C.
Oooh, I see, food for thought.
> it is not a good idea to use asdf as a library for project in quicklisp
why not? I think it is not an issue for Quicklisp and Quicklisp users. `asdf:system-relative-pathname` (or similar) would help.
---
More testing:
- Forest: forest-light works well https://github.com/rdbende/Forest-ttk-theme, the dark theme doesn't load.
- by the same author, Sun-Valley (https://github.com/rdbende/Sun-Valley-ttk-theme) and Azure (https://github.com/rdbende/Azure-ttk-theme) both fail to load.
- Ale themes' lightbrown loads fine https://github.com/aplsimple/ale_themes/ and darkbrown doesn't render very well.
it is not a good idea to use asdf as a library for project in quicklisp
why not? I think it is not an issue for Quicklisp and Quicklisp users. asdf:system-relative-pathname (or similar) would help.
OK, so I am likely wrong here, just let me do a few more check to be sure and, if there are no problems, the work can starts. :)
More testing:
Thanks for testing!
I am surprised that some themes have issues as they "live" entirely in the TCL side with only minimal interaction with this library, it is a pity, they look nice! :D
bye!
C.
Hi @vindarel!
> > it is not a good idea to use asdf as a library for project in quicklisp
> why not? I think it is not an issue for Quicklisp and Quicklisp users. asdf:system-relative-pathname (or similar) would help.
OK, so I am likely wrong here, just let me do a few more check to be sure and, if there are no problems, the work can starts. :)
> More testing:
Thanks for testing!
I am surprised that some themes have issues as they "live" entirely in the TCL side with only minimal interaction with this library, it is a pity, they look nice! :D
bye!
C.
where I tried to implements the ideas we discussed in this thread.
I have added the special variable *themes-directory* (default is the directory themes under the directory where the asdf system is) where the library looks for themes.
Each theme must be placed in their own directory as a subdirectory of the aforementioned variable, the name of the directory must be the name of the theme; moreover the name of the TCL file that specify the file must be named as the same of the theme with the extension "tcl" appended
for example the theme foo have to be: "foo/foo.tcl"
Provided these conditions are met using a new theme should be as simple as type:
(nodgui:use-theme "foo")
Without (nodgui: eval-tcl-file).
Note that also (nodgui:theme-names) will return both the default and the custom themes.
I did not tested the code very well but i hope i implemented the theme managing as you suggested.
Bye!
C.
Hi @vindarel!
I have added a branch
https://notabug.org/cage/nodgui/src/adding-themes
where I tried to implements the ideas we discussed in this thread.
I have added the special variable `*themes-directory*` (default is the directory `themes` under the directory where the asdf system is) where the library looks for themes.
Each theme must be placed in their own directory as a subdirectory of the aforementioned variable, the name of the directory must be the name of the theme; moreover the name of the TCL file that specify the file must be named as the same of the theme with the extension "tcl" appended
for example the theme `foo` have to be: `"foo/foo.tcl"`
Provided these conditions are met using a new theme should be as simple as type:
``` lisp
(nodgui:use-theme "foo")
```
Without `(nodgui: eval-tcl-file)`.
Note that also `(nodgui:theme-names)` will return both the default and the custom themes.
I did not tested the code very well but i hope i implemented the theme managing as you suggested.
Bye!
C.
I just merged the branch 'adding-themes' in master. I have added a custom theme (yaru) and everything seems to works so far! :)
In fact typing (nodgui.demo::demo-widget) at the repl the window shown should lists also the yaru theme in addition of the usual TCL themes (clam, classic etc.).
There is some themes you would like to be shipped together with this library?
Thanks again for your help, feel free to ping me if you are going to find bugs related to theme, but also other things if you want! :D
Bye
C.
Hi @vindarel
I just merged the branch 'adding-themes' in master. I have added a custom theme (yaru) and everything seems to works so far! :)
In fact typing `(nodgui.demo::demo-widget)` at the repl the window shown should lists also the yaru theme in addition of the usual TCL themes (clam, classic etc.).
There is some themes you would like to be shipped together with this library?
Thanks again for your help, feel free to ping me if you are going to find bugs related to theme, but also other things if you want! :D
Bye
C.
Really, really nice! Well done. Yaru is one of my favorites too. Forest, Adapta, Breeze were nice too (Aquativo for Macs?), but having Yaru in nodgui is already an advancement.
I'm sending a PR for QoL improvements : )
Really, really nice! Well done. Yaru is one of my favorites too. Forest, Adapta, Breeze were nice too (Aquativo for Macs?), but having Yaru in nodgui is already an advancement.
I'm sending a PR for QoL improvements : )
I think the built-in themes of tk are too ugly.Can you support the external themes?
Hi!
I would not say they are ugly, they are beautiful in their own way! ;-)
Seriously, my answer to your question is that i would support some of the external themes, for now. As far as i know some themes uses
tksvg
, a library that requires probably not so much efforts to wrap from the lisp side but, unfortunately, i am not able to find in Debian yet (the only OS where i develop nodgui).So for now i can support non-scalable themes, when tksvg will be available on Debian i'll try to use it as i did with
tklib
.But for now i just pushed to the repository a little function:
eval-tcl-file
that will load/eval an external TCL script, as today i learnt TK themes are more or less TCL scripts! :)So just write/download a theme and use
(eval-tcl-file "file/path/theme.tcl")
to load the theme and (use-theme "theme-name") to apply the theme to TK.See https://notabug.org/cage/nodgui/src/master/src/demo-tests.lisp#L375 for a reference how to apply the themes.
important note: using
eval-tcl-file
will make the TCL interpreter load and execute the contents of the file you passed as an argument to the function above, so better that you always use files you wrote or you got from trusted source, but as you are a lisper i think you already knows of this caveat! ;-DI do not know if this answer satisfy you, let me know what you think if you please.
Bye!
C.
Hi!
Seems that the next release of TCL/TK will include SVG support in the core distribution! :)
https://core.tcl-lang.org/tips/doc/trunk/tip/507.md
Bye! C.
Thank you for your answer, it is very useful to me.
Hi xxmy!
Happy that you find this patch good! I would keep this thread open until a proper way to deal with SVG images (and, therefore, with scalable themes) is implemented in nodgui.
Have fun with the library!
C.
This is huge! Well done, thank you!
before:
after:
I cloned ttkthemes locally:
Then, it is as simple as you said. We load the tcl file and set the theme inside nodgui loop.
note: the "scid" and "smog" themes bugged.
I didn't try with the awthemes yet.
Hi @vindarel
They look surprisingly nice!
I am going to link this thread from the library's home page, thanks for trying!
Likely this theme uses SVG images for rendering the widget, but if it does not works with TK 8.6 starting from the next version will do! :)
Bye! C.
Would it make sense to ship the working themes (or a selection of) into nodgui itself? So we would only "(use-theme "adapta")" and done.
Now that I know themes are supported, I don't see myself not using one. That would mean: include the tcl source(s) in my project, include them in the lisp image when building a binary… this could be done once and for all in nodgui itself, I guess.
If & when I do it in my app, I'll come back and see if I can share the process. If you don't know what do do that's an idea ;)
Hi @vindarel!
I am not in principle against ship the themes together with the library, but two questions arise:
some themes are under GPLv3, i am OK with this license that, in fact, i use in all my software, but nodgui is released under a different license: i believe that if i bundle the themes into the library (for example including the TCL code as a string in lisp source code) all the library should be re licensed under GPLv3, as i am not the only author of this library this change could be problematic (i think i do not need explicit permission to re license the code but this are legal questions and i am not an expert), other license are incompatible (like creative commons) and some are OK: BSD or similar
i do not think is a problem to include the TCL theme code in the library package as is and let the user load, at runtime, the theme, so the question here is: how can the library knows where to find the theme files? I am thinking of something like:
But which one should be a good default? ASDF has a couple of function to find files in the system but IIRC it is not a good idea to use asdf as a library for project in quicklisp, correct me if i am wrong.
So, if i figure out a good default for the special variable above (suggestions welcome!) i would be happy to include the themes along with the library, if not, i could just use
nil
for `themes-directory, and maybe include a script to download the themes (with a big disclaimer :-))Looking forward for your opinion!
Bye! C.
Oooh, I see, food for thought.
why not? I think it is not an issue for Quicklisp and Quicklisp users.
asdf:system-relative-pathname
(or similar) would help.More testing:
Hi @vindarel!
OK, so I am likely wrong here, just let me do a few more check to be sure and, if there are no problems, the work can starts. :)
Thanks for testing!
I am surprised that some themes have issues as they "live" entirely in the TCL side with only minimal interaction with this library, it is a pity, they look nice! :D
bye! C.
Hi @vindarel!
I have added a branch
https://notabug.org/cage/nodgui/src/adding-themes
where I tried to implements the ideas we discussed in this thread.
I have added the special variable
*themes-directory*
(default is the directorythemes
under the directory where the asdf system is) where the library looks for themes.Each theme must be placed in their own directory as a subdirectory of the aforementioned variable, the name of the directory must be the name of the theme; moreover the name of the TCL file that specify the file must be named as the same of the theme with the extension "tcl" appended
for example the theme
foo
have to be:"foo/foo.tcl"
Provided these conditions are met using a new theme should be as simple as type:
Without
(nodgui: eval-tcl-file)
.Note that also
(nodgui:theme-names)
will return both the default and the custom themes.I did not tested the code very well but i hope i implemented the theme managing as you suggested.
Bye!
C.
Hi @vindarel
I just merged the branch 'adding-themes' in master. I have added a custom theme (yaru) and everything seems to works so far! :)
In fact typing
(nodgui.demo::demo-widget)
at the repl the window shown should lists also the yaru theme in addition of the usual TCL themes (clam, classic etc.).There is some themes you would like to be shipped together with this library?
Thanks again for your help, feel free to ping me if you are going to find bugs related to theme, but also other things if you want! :D
Bye
C.
Really, really nice! Well done. Yaru is one of my favorites too. Forest, Adapta, Breeze were nice too (Aquativo for Macs?), but having Yaru in nodgui is already an advancement.
I'm sending a PR for QoL improvements : )