gotk3 / gotk3-examples

164 stars 34 forks source link

Go cannot find or access the github/gotk3 #22

Closed zorgrian closed 3 years ago

zorgrian commented 4 years ago

I have tried!

I really have tried to get this to work and I want/ need it to work. Yes there are other UI systems for golang that do work, but I like to use GLADE for design of the UI. (It be my way)

Shed light

Please could you shed some light upon the fundamental reasons for why FYNE will work with references to Internet sourced source, whereas gotk3 will not work at all???

zorgrian commented 4 years ago

I forgot

I forgot to include a nice example of the output when trying to build simple.go which is from the examples listed in github.

See below the output

simple.go:24:9: cannot find package "github.com/gotk3/gotk3/gtk" in any of: /usr/lib/go-1.10/src/github.com/gotk3/gotk3/gtk (from $GOROOT)

It attempts the impossible but does not try the obvious

So as you can see it is looking hard for the included gtk package, but alas the thing just looks locally and never does it think to go out there and look on-line

Now as I indicated earlier on, FYNE package includes from the internet just do not have this problem.

WHY?

The big question here is why why why?

zorgrian commented 4 years ago

Maybe it never looks outside?

Please confirm or deny this assumption...

What do I mean?

What do I mean by this? Well, what I mean is maybe my assumption that golang will look outside into the Internet is all wrong???

If so, then every time within a golang program, a package include is specified that does appear to point to a valid external URL with said package, then in reality this is misleading, false and wrong insofar as in reality you must do:

go get github.com/thing/smaller_things

Then and only then

Then and only then will your golang build or run command actually work?

billc3012 commented 4 years ago

I hope this helps you and any who read it.

It looks like go now automatically loads directly from github.com if required so ignore some of the next paragraph. I was not aware of this new feature.

The GO import directive is used to reference GO packages resident on your local development machine and they are automatically linked to by your go run ... or go build ... commands. This assumes your GO system has been setup correctly. If you install from the golang website the instructions are correct. If you install GO automatically from your linux supplier's repositories it may not be installed correctly (my personal experience)

Different packages have different layouts which often reflects the system GO was using when the packages was last regularly maintained or just the package writers preferences. GOTK3 appears to have been stable for several years and has some nice features.

Many GO packages install to a directory github.com on the local machine which you can generally find somewhere in the $GOPATH directory. Node uses github.com in a similar manner to hold module source locally so this behaviour is not unique to GO. It can be confusing until you get used to it.

I looked at gotk3 yesterday for the first time and found it necessary to download both gotk3 and gotk3-examples.

The procedure I used was (from memory)

  1. Ensure $GOPATH is setup (in my case $HOME/go)
  2. Download gotk3 from github "go get github.com/gotk3/gotk3/gtk"
  3. I then downloaded the zip file from gotk3-examples and moved the examples directory into $HOME/gotk3X. (Using the defaults meant that my terminal prompt was almost the width of the terminal window which I could have widened as I use 4K monitors. By default my prompt is the current working directory).
  4. Not all the examples worked straight off. The examples I was interested in worked out of the box. I did not use the file scaffolding used by the example project, so this could explain why some examples failed.

Examining the code from the examples gave me ideas of how I could use the package. The example programs were usefully commented for someone like me wanting to try GTK3 with GO

I was not interested in Glade, but the grid example was most useful for what I was doing. So I got value by running examples I was interested in.

Hope this helps someone Bill

zorgrian commented 3 years ago

Thank you... I figured it out.

The whole Go library setup is not very user friendly or mature if you compare it to rust or other new language bases.

On Sat, 19 Dec 2020, 19:32 André, notifications@github.com wrote:

Closed #22 https://github.com/gotk3/gotk3-examples/issues/22.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotk3/gotk3-examples/issues/22#event-4132678032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL4UTYBTNU5XHSMOXHF6FDSVTWSPANCNFSM4K7SW6TQ .