Git Product home page Git Product logo

gui-with-gio's People

Contributors

buckeyecoder avatar craftyguy avatar dependabot[bot] avatar gedw99 avatar jes avatar jimt avatar jonegil avatar miry avatar philipstaffordwood avatar popsu avatar whereswaldon avatar zilllaiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gui-with-gio's Issues

Add a License file

Add a license file such as GPL or MIT so that others can have their code from your tutorial series on github.
Without that license its debatable if they can legally be used or shared on github.

Thanks for the great tutorial by the way!

Chapter 3 questions

@jonegil let's leave this issue open until I conclude all Chapter 3 edits. Please reply with answers so I know what to do - thanks!

CH3 Q1: Read the following:

io/system - Provides high-level events that are sent from the window. Most important is the system.FrameEvent. It's effectively a list of operations that do one of two things: details how to handle input and describes what to display.

This is confusing. Does it do one thing or two things? Sounds like two. If its two then it doesn't do

one of two things

it does two things. If its one thing then it "details OR describes", not "details AND describes". I'm not sure which one is right.

Teleprompter example unit handling

Hi @jonegil, I noticed an issue in your teleprompter program on my HiDPI screen. Namely, no text is visible. :D

These lines (259-262) are the big problem: https://github.com/jonegil/gui-with-gio/blob/main/teleprompter/code/main.go#L259

You are converting a value measured in pixels into DP with a cast. On my HiDPI screen, this means that if the value was originally 200 Px, it's now 200 Dp which is 400 Px. Setting the margins so high made no space for text to appear between them on my screen, so I saw nothing.

It would be best to convert your codebase to work almost entirely in Dp and Sp. Raw pixel values are only for times when you need to directly invoke Ops (like clipping). Whenever working with layouts, try to use Dp (and Sp for text).

I tried to convert your codebase to doing this for you, but there are a few places that you're using an integer value to modify both text size and positioning of elements, and changing that led to design decisions I didn't want to make for you. I suggest that you redefine all of the values at the top of draw() as one of the unit types and then handle the necessary conversions throughout your layout code. I'm happy to answer any questions you may have about how to do this.

Decide how to handle Chapter 1 process hanging issue

This is a copypasta from #12 and I'm moving it to an issue because I don't want it to get lost. I think we need to decide what to do, if anything. Until I understand your direction a bit more I feel uncomfortable suggesting which way to go.

The demo at the end of Chapter 1 does not contain an os.Exit(0) line. When the student clicks the window frame's X to exit the app, the window goes away but the process still hangs in the terminal.

Now, you may know that already and it may be intentional for all I know. If it is, I agree with your call, because I'm pretty sure the added complexity to get the os.Exit(0) line into the right place would defeat the goal of keeping this chapter SIMPLE.

BUT, if that IS your reason then my opinion is that you need to do an "information" or "warning" callout at the end of the chapter. The hung process looks bad and makes the project look bad for producing a "failed" demo. Providing just a sentence or two telling the student that "its intentional" and to use ctrl-c to exit the process eliminates this negative "broken" vibe.

Is this outdated?

Is this tutorial still up to date? I can't run the source code because several variables got marked as "declared and not used" and

select {
// listen for events in the window.
case e := <-w.Events():
              ^^^^^
	// detect what type of event
	switch e := e.(type) {

is undefined.
Sorry if this question is silly, I'm very new to Go and Gio UI.

panic: runtime error: invalid memory address or nil pointer dereference

Getting the following error when I try to run the Eggtimer Blank window. The window runs briefly and then immediately closes. I can run the hello test from gioui.org perfectly. so don't think it's a missing install.

`panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0xb0b91a]

goroutine 8 [running, locked to thread]:
gioui.org/app.(*Window).processEvent(0xc00020a000, {0xc44948, 0xc000206090}, {0xc42158?, 0xc000292000?})`

Chapter 1 panic: runtime error

Hello, I can't run the first chapter.
I also run go run gioui.org/app, but I'm new and noob in Golang :D
Can you help me what is wrong?
Screen Shot 2021-10-24 at 9 35 05 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.