Skip to content
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

Image Clearing #1578

Open
LWFlouisa opened this issue Dec 5, 2019 · 2 comments
Open

Image Clearing #1578

LWFlouisa opened this issue Dec 5, 2019 · 2 comments

Comments

@LWFlouisa
Copy link

There was an issue with the clear command deleting everything. Image clearing didn't seem to do anything in Shoes 3. Has this problem been fixed in Shoes4?

Otherwise it just keeps stacking images, without the ability to clear the screen.

@ccoupe
Copy link

ccoupe commented Dec 5, 2019

The clear command should delete everything in the slot. There have been improvements in Shoes 3 for managing the image cache That may help. You could file an issue with Shoes 3

@LWFlouisa
Copy link
Author

Ah ok so it's an image cache issue? When I followed the advice a friend, that mentioned recreating the buttons every time you clear the screen:

Shoes.app do
  
  def clear_screen
    clear
  end
  
  def generate_poem
    system("ruby QRPoetry.rb")
  end
  
  # In this one, I can't seem to read the image unless it's in the main directory.
  def display_image
    image "poem.png"
  end
  
  def display_button
    button("Generate Poem") {
      c = clear_screen; i = image_clear; g = generate_poem; d = display_button; d = display_image
    }
    
    button("Exit") {
      exit
    }
  end
  
  flow do
    button("Generate Poem") {
      c = clear_screen; g = generate_poem; d = display_button; d = display_image
    }
    
    button("Exit") {
      exit
    }
  end
  
end

The system call refers to an external script that generates a QR code from a Ruby Gem, and I have the Shoes app display the image generated from the external script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants