Code Monkey home page Code Monkey logo

developer.fyne.io's People

Contributors

aaronstotle avatar anderspitman avatar andydotxyz avatar arnos avatar asukakenji avatar badele avatar bbkane avatar biehdc avatar bitspill avatar bstpierre avatar dependabot[bot] avatar donuts-are-good avatar dweymouth avatar elara6331 avatar elchn avatar gdey avatar hoshsadiq avatar jacalz avatar jadeops avatar jrwren avatar justdan96 avatar lewiscowles1986 avatar lucor avatar outofphase avatar prologic avatar pythonian23 avatar ralph7c2 avatar sdassow avatar sha65536 avatar winsock 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

developer.fyne.io's Issues

Add Widget Reference

Is there a widget reference for fyne? I want to see a demo of the widgets without downloading/installing fyne.

how to start the server from these files?

i would like to make some changes in the css files but i don't understand how do i start the development server in my computer
please help me to start the server or give me the commands to start the server

my OS: win 10
NOTE: i've already install ruby on machine

Image size will be changed with the Scale of fyne_settings but window size remains the Normal Size

Description

When the fyne size is changed (Non-Normal size) by fyne_settings, the image size and font size are changed, however the window size will not be changed.
This happens with the image being resized with the original image size and "FillMode = canvas.ImageFillOriginal".

Below is a program that reproduces this bug.
Execute the following program after changing the size to "Tiny" size instead of "Normal" size with the fyne_settings command.


package main

import (
  "os"
  "image"
  "fyne.io/fyne/v2"
  "fyne.io/fyne/v2/app"
  "fyne.io/fyne/v2/canvas"
  "fyne.io/fyne/v2/container"
  "fyne.io/fyne/v2/widget"
)

func loadImage(imgFile string)*canvas.Image{
  if file,err := os.Open(imgFile); err == nil{
    defer file.Close()
    if img,_,err := image.Decode(file); err == nil{
      cnvsImg := canvas.NewImageFromImage(img)
      cnvsImg.FillMode = canvas.ImageFillOriginal
      cnvsImg.Resize(fyne.NewSize(float32(img.Bounds().Dx()), float32(img.Bounds().Dx())))
      return cnvsImg
    }
  }
  return nil
}

func main() {
  if len(os.Args) == 2{
    app := app.New()
    if img := loadImage(os.Args[1]); img != nil{
      win := app.NewWindow("Image Viewer")
      label := widget.NewLabel(os.Args[1])
      cntr := container.NewWithoutLayout(img)
      win.SetContent(container.NewVBox(cntr, label,))
      win.ShowAndRun()
    }
  }
}

First example in https://developer.fyne.io/api/v2.0/ does not compile

This very first fyne example in the API documentation does not compile because the package widget has no function NewVBox.

    package main

    import "fyne.io/fyne/v2/app"
    import "fyne.io/fyne/v2/widget"

    func main() {
    	a := app.New()
    	w := a.NewWindow("Hello")

    	hello := widget.NewLabel("Hello Fyne!")
    	w.SetContent(widget.NewVBox(
    		hello,
    		widget.NewButton("Hi!", func() {
    			hello.SetText("Welcome :)")
    		}),
    	))

    	w.ShowAndRun()
    }

Just a advice

I'm leaning go and i'm readning fyne toturial, the border layout example at here is little not clear, i think you should use button widget replace the original white label text.
before
before
after
after

'NSUserNotification' is deprecated?

warning: 'NSUserNotification' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]

Tried out this lib today but it seems like there is a deprecated warning for the macos dependencys?

proposal for a more generic Select widget

Hi there,
I am working on some app to connect musicians with extremely low delay over the internet.
I am attaching a working proposal that would allow handling generic elements in Select widgets.
Keep it up, this is a fantastic library!!
Claudio

package widgets

import (
	"fmt"
	"fyne.io/fyne/widget"
)

type Anything interface {}

type SelectInfo struct {
	Widget   *widget.Select
	infoMap  map[string]Anything
	callback func(string)
	stringer func(Anything) string
}

func NewSelectInfo(
	stringer func(Anything) string,
	changed func(Anything)) *SelectInfo {

	c := &SelectInfo{
		stringer: stringer,
		infoMap:  make(map[string]Anything),
	}

	c.Widget = widget.NewSelect(
		make([]string, 0),
		func(s string) {
			changed(c.inverseStringer(s))
		})

	return c
}

func (c *SelectInfo) Selected() Anything {
	return c.infoMap[c.Widget.Selected]
}

func (c *SelectInfo) Reset() {
	c.Widget.Options = make([]string, 0)
	c.infoMap = make(map[string]Anything)
}

func (c *SelectInfo) LoadInfo(x Anything) error {
	key := c.stringer(x)
	_, found := c.infoMap[key]
	if found {
		return fmt.Errorf("key:[%s] already in the map", key)
	}

	c.infoMap[key] = x
	c.Widget.Options = append(c.Widget.Options, key)

	return nil
}

func (c *SelectInfo) SelectInfo(x Anything) {
	c.SelectText(c.stringer(x))
}

func (c *SelectInfo) SelectText(s string) {

	if len(c.infoMap) == 0 {
		return
	}

	_, found := c.infoMap[s]
	if !found {
		c.Widget.SetSelectedIndex(0)
	}

	c.Widget.SetSelected(s)
}

func (c *SelectInfo) inverseStringer(in string) Anything {
	v, _ := c.infoMap[in]
	return v
}

Tutorial for customizing button background color

Is your feature request related to a problem? Please describe:

In the tutorials, there should be an example of customizing button colors.

Is it possible to construct a solution with the existing API?

Yes

Describe the solution you'd like to see:

A tutorial on setting a button color.

Form demo broken, just one column is rendered ( turns out the fg color is white and the default background is white too )

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

I wanted to try out fyne and used the form example from here.

Building and running it gives me this UI, where I can only see the first column of the form, see screenshot.

How to reproduce

  1. build example code
  2. run it
  3. only one column gets rendered
  4. resizing or moving the app window doesn't help
  5. inspecting the code it looks like a bad combination of default background color and label foreground color - both seem to be white, making the rendered values invisible !
  6. Fixing the colors ( color.RGBA{0xff, 0, 0, 0xff} instead of color.White ) in the code still renders odd form layout, rows doesn't seem to get aligned vertically.

Screenshots

With the white background/foreground
form_example_renders_only_one_column

With other foreground, still rendered odd:
form_example_colors_fixed_still_wrong_layout

Example code

Copy from the example page:

package main

import (
	"image/color"

	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/layout"
)

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("Form Layout")

	label1 := canvas.NewText("Label 1", color.Black)
	value1 := canvas.NewText("Value", color.White)
	label2 := canvas.NewText("Label 2", color.Black)
	value2 := canvas.NewText("Something", color.White)
	grid := container.New(layout.NewFormLayout(), label1, value1, label2, value2)
	myWindow.SetContent(grid)
	myWindow.ShowAndRun()
}

Fyne version

fyne.io/fyne/v2 v2.2.3

Go compiler version

go version go1.19.2 darwin/arm64

Operating system

macOS

Operating system version

MacOS Monterey 12.6 (Apple M1 Pro)

Additional Information

No response

In basic windows example goroutine seems to not end

What:
Example code: https://developer.fyne.io/tour/basics/windows.html

Environment:
Fedora 33
go version go1.15.8 linux/amd64

Problem:
After closing main window the program seems to still run.

Steps:

  1. Paste code into a file (ie. test.go)
  2. Run code: go run test.go
  3. Wait for second window to show up and dissapear
  4. Close main window

Result:
Even after closing the window, the console is not released and the process lingers:

trochej 72955 2.3 0.0 1750860 23404 pts/1 Sl+ 20:39 0:00 go run test.go
trochej 73054 4.3 0.2 1960936 67304 pts/1 Sl+ 20:39 0:00 /tmp/go-build574735481/b001/exe/test

Run the demo gives Go error

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

I followed the command described on https://developer.fyne.io/started/#run-the-demo

Since the text says "If you want to see the Fyne toolkit in action before you start to code your own application", I (wrongly) assumed I did not have to do / install anything first.

This is the output from my computer executed in folder 'temp':

➜ temp go run fyne.io/fyne/v2/cmd/fyne_demo
no required module provides package fyne.io/fyne/v2/cmd/fyne_demo: go.mod file not found in current directory or any parent directory; see 'go help modules'
➜ temp go version
go version go1.18 darwin/arm64

Later on I realised that the author meant that I had to do the steps described in Downloading section first. You need to take the phrase 'to code' literally.

However if you execute go mod tidy - it will remove the required fyne dependency since there is no Go file referencing it.
If you skip go mod tidy, so the dependency is there, you are also out of luck since there is no go.sum file.

So after repeating the steps in the Download section, I got the following error message:

➜ temp go run fyne.io/fyne/v2/cmd/fyne_demo
no required module provides package fyne.io/fyne/v2/cmd/fyne_demo; to add it:
go get fyne.io/fyne/v2/cmd/fyne_demo

If you execute above go get command, it works.

A solution is to move the Installing section up, as first part of Running the demo.

How to reproduce

see above

Screenshots

No response

Example code

n/a

Fyne version

latest

Go compiler version

1.18

Operating system

macOS

Operating system version

12.2.1

Additional Information

No response

Add a page for showing theme icons

I propose that we add a page for displaying the icons that exist within the theme package. A bit like how we do for layouts, but for icons instead. This would make it easy for users to see what icons exist and then pick the one that suits their use case.

Does anyone manage to run this locally?

Description

I have been trying to run this as the instruction suggest in my ubuntu with ruby 3.2 and using the docker image of jekyll and I am getting loads of issues:

on docker:

devfyne-jekyll | Configuration file: /site/_config.yml
devfyne-jekyll |   Dependency Error: Yikes! It looks like you don't have jekyll-redirect-from or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-redirect-from' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/! 
devfyne-jekyll | jekyll 3.9.0 | Error:  jekyll-redirect-from
devfyne-jekyll | /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/external.rb:68:in `rescue in block in require_with_graceful_fail': jekyll-redirect-from (Jekyll::Errors::MissingDependencyException)

on my local ubuntu:

Incremental build: disabled. Enable with --incremental
      Generating... 
   GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
                    done in 149.233 seconds.
jekyll 3.9.0 | Error:  no implicit conversion of Hash into Integer
/var/lib/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read': no implicit conversion of Hash into Integer (TypeError)

Hint for deprecated ShowEntryDialog references the wrong type

The entry reads:

func ShowEntryDialog
func ShowEntryDialog(title, message string, onConfirm func(string), parent fyne.Window)
ShowEntryDialog creates a new entry dialog and shows it immediately.

Deprecated: Use dialog.ShowFormDialog() with a widget.Entry inside instead.

There is no dialog.ShowFormDialog(). The reference should be to dialog.ShowForm()

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.