can-lehmann / owlkettle

A declarative user interface framework based on GTK 4
https://can-lehmann.github.io/owlkettle/README
MIT License
367 stars 14 forks source link

playground file : cannot open ? #101

Closed tissatussa closed 8 months ago

tissatussa commented 8 months ago

when compiling the scale.nim example i get an error regarding the playground.nim file :

roelof@roelof-HP-Elite-x2-1012-G2:~/Compiled/owlkettle-main/examples/widgets$ nim c ./scale.nim 
Hint: used config file '/home/roelof/.choosenim/toolchains/nim-1.6.12/config/nim.cfg' [Conf]
Hint: used config file '/home/roelof/.choosenim/toolchains/nim-1.6.12/config/config.nims' [Conf]
................................................................................................................
/home/roelof/.nimble/pkgs/owlkettle-#head/owlkettle/adw.nim(102, 6) Hint: 'adw_action_row_add_prefix' is declared but not used [XDeclaredButNotUsed]
/home/roelof/.nimble/pkgs/owlkettle-#head/owlkettle/adw.nim(105, 6) Hint: 'adw_action_row_set_activatable_widget' is declared but not used [XDeclaredButNotUsed]
/home/roelof/.nimble/pkgs/owlkettle-#head/owlkettle/adw.nim(111, 6) Hint: 'adw_expander_row_add_prefix' is declared but not used [XDeclaredButNotUsed]
/home/roelof/Compiled/owlkettle-main/examples/widgets/scale.nim(24, 28) Error: cannot open file: owlkettle/playground

but playground.nim is there .. this is bug i can't solve.

can-lehmann commented 8 months ago

We've had lots of issues with the new nimble version, as it does not install the correct owlkettle version.

  1. Uninstall the owlkettle version installed via nimble.
  2. Try to compile the example with --path:../.. so that it uses the correct owlkettle version
  3. See here for how to fix the installation issue https://github.com/can-lehmann/owlkettle/issues/71#issuecomment-1712564003 and reinstall owlkettle

Edit: Also see @PhilippMDoerner's response :smile:

PhilippMDoerner commented 8 months ago

You cloned the repo and tried to compile from there I assume?

Keep in mind that by default when compiling, nim will be looking for owlkettle/playground on your PATH. If you cloned the repo somewhere instead of installing owlkettle@#head, then nim isn't looking in the repository, it is looking in your .nimble directory under pkgs2 or pkgs for the owlkettle version there.

And that one likely doesn't have the playground.nim file.

You'll want to either install that, or compile scale.nim from the root folder of your clone with nim r --path:. ./examples/widgets/scale.nim.

The --path flag tells nim to add the root directory of the cloned repo also to the paths where it looks for dependencies

tissatussa commented 8 months ago

You cloned the repo and tried to compile from there I assume?

I downloaded the ZIPped clone, i guess that's the same package ?

Your explanation is great and your command nim r --path:. ./examples/widgets/scale.nim solved the issue : i compiled without errors.

Now i understand some more about nim together with owlkettle. Thanks!

PhilippMDoerner commented 8 months ago

I downloaded the ZIPped clone, i guess that's the same package ?

Yep, it's identical to using git clone (with git doing some extra git stuff for convenience). Good to hear that this helped you!