Giter Site home page Giter Site logo

fyne-x's Introduction

Go API Reference Join us on Slack
Code Status Build Status Coverage Status

About

This repository holds community extensions for the Fyne toolkit.

This is in early development and more information will appear soon.

Layouts

Community contributed layouts.

import "fyne.io/x/fyne/layout"

Responsive Layout

The responsive layout provides a "bootstrap like" configuration to automatically make containers and canvas reponsive to the window width. It reacts to the window size to resize and move the elements. The sizes are configured with a ratio of the container width (0.5 is 50% of the container size).

The responsive layout follow the bootstrap size breakpoints:

  • extra small for window width <= 576px
  • small for window width <= 768
  • medium for window width <= 992
  • large for window width <= 1200
  • extra large for window width > 1200

Responsive Layout

To use a responsive layout:

layout := NewResponsiveLayout(fyne.CanvasObject...)

Optionally, Each canvas object can be encapsulated with Responsive() function to give the sizes:

layout := NewResponsiveLayout(
    Responsive(object1),            // all sizes to 100%
    Responsive(object2, 0.5, 0.75), // small to 50%, medium to 75%, all others to 100% 
)

Widgets

This package contains a collection of community-contributed widgets for the Fyne toolkit. The code here is intended to be production ready, but may be lacking some desirable functional features. If you have suggestions for changes to existing functionality or addition of new functionality, please look at the existing issues in the repository to see if your idea is already on the table. If it is not, feel free to open an issue.

This collection should be considered a work in progress. When changes are made, serious consideration will be given to backward compatibility, but compatibility is not guaranteed.

import "fyne.io/x/fyne/widget"

Animated Gif

A widget that will run animated gifs.

gif, err := NewAnimatedGif(storage.NewFileURI("./testdata/gif/earth.gif"))
gif.Start()

Calendar

A date picker which returns a time object with the selected date.

Calendar widget

To use create a new calendar with a given time and a callback function:

calendar := widget.NewCalendar(time.Now(), onSelected, cellSize, padding)

Demo available for example usage

DiagramWidget

The DiagramWidget provides a drawing area within which a diagram can be created. The diagram itself is a collection of DiagramElement widgets (an interface). There are two types of DiagramElements: DiagramNode widgets and DiagramLink widgets. DiagramNode widgets are thin wrappers around a user-supplied CanvasObject. Any valid CanvasObject can be used. DiagramLinks are line-based connections between DiagramElements. Note that links can connect to other links as well as nodes.

While some provisions have been made for automatic layout, layouts are for the convenience of the author and are on-demand only. The design intent is that users will place the diagram elements for human readability.

DiagramElements are managed by the DiagramWidget from a layout perspective. DiagramNodes have no size constraints imposed by the DiagramWidget and can be placed anywhere. DiagramLinks connect DiagramElements. The DiagramWidget keeps track of the DiagramElements to which each DiagramLink is connected and calls the Refresh() method on the link when the connected diagram element is moved or resized.

Diagram Widget

FileTree

An extension of widget.Tree for displaying a file system hierarchy.

tree := widget.NewFileTree(storage.NewFileURI("~")) // Start from home directory
tree.Filter = storage.NewExtensionFileFilter([]string{".txt"}) // Filter files
tree.Sorter = func(u1, u2 fyne.URI) bool {
    return u1.String() < u2.String() // Sort alphabetically
}

FileTree Widget

CompletionEntry

An extension of widget.Entry for displaying a popup menu for completion. The "up" and "down" keys on the keyboard are used to navigate through the menu, the "Enter" key is used to confirm the selection. The options can also be selected with the mouse. The "Escape" key closes the selection list.

entry := widget.NewCompletionEntry([]string{})

// When the use typed text, complete the list.
entry.OnChanged = func(s string) {
    // completion start for text length >= 3
    if len(s) < 3 {
        entry.HideCompletion()
        return
    }

    // Make a search on wikipedia
    resp, err := http.Get(
        "https://en.wikipedia.org/w/api.php?action=opensearch&search=" + entry.Text,
    )
    if err != nil {
        entry.HideCompletion()
        return
    }

    // Get the list of possible completion
    var results [][]string
    json.NewDecoder(resp.Body).Decode(&results)

    // no results
    if len(results) == 0 {
        entry.HideCompletion()
        return
    }

    // then show them
    entry.SetOptions(results[1])
    entry.ShowCompletion()
}

CompletionEntry Widget

7-Segment ("Hex") Display

A skeuomorphic widget simulating a 7-segment "hex" display. Supports setting digits by value, as well as directly controlling which segments are on or off.

Check out the demo for an example of usage.

h := widget.NewHexWidget()
// show the value 'F' on the display
h.Set(0xf)

Map

An OpenStreetMap widget that can the user can pan and zoom. To use this in your app and be compliant with their requirements you may need to request permission to embed in your specific software.

m := NewMap()

Dialogs

About

A cool parallax about dialog that pulls data from the app metadata and includes some markup content and links at the bottom of the window/dialog.

	docURL, _ := url.Parse("https://docs.fyne.io")
	links := []*widget.Hyperlink{
		widget.NewHyperlink("Docs", docURL),
	}
	dialog.ShowAboutWindow("Some **cool** stuff", links, a)

Data Binding

Community contributed data sources for binding.

import fyne.io/x/fyne/data/binding

WebString

A WebSocketString binding creates a String data binding to the specified web socket URL. Each time a message is read the value will be converted to a string and set on the binding. It is also Closable so you should be sure to call Close() once you are completed using it.

s, err := binding.NewWebSocketString("wss://demo.piesocket.com/v3/channel_1?api_key=oCdCMcMPQpbvNjUIzqtvF1d2X2okWpDQj4AwARJuAgtjhzKxVEjQU6IdCjwm&notify_self")
l := widget.NewLabelWithData(s)

The code above uses a test web sockets server from "PieSocket", you can run the code above and go to their test page to send messages. The widget will automatically update to the latest data sent through the socket.

MqttString

A MqttString binding creates a String data binding to the specified topic associated with the specified MQTT client connection. Each time a message is received the value will be converted to a string and set on the binding. Each time the value is edited, it will be sent back over MQTT on the specified topic. It is also a Closer so you should be sure to call Close once you are completed using it to disconnect the topic handler from the MQTT client connection.

opts := mqtt.NewClientOptions()
opts.AddBroker("tcp://broker.emqx.io:1883")
opts.SetClientID("fyne_demo")
client := mqtt.NewClient(opts)

token := client.Connect()
token.Wait()
if err := token.Error(); err != nil {
    // Handle connection error
}

s, err := binding.NewMqttString(client, "fyne.io/x/string")

Data Validation

Community contributed validators.

import fyne.io/x/fyne/data/validation

Password

A validator for validating passwords. Uses https://github.com/wagslane/go-password-validator for validation using an entropy system.

pw := validation.NewPassword(70) // Minimum password entropy allowed defined as 70.

Themes

Adwaita

Adwaita is the theme used in new the versions of KDE and Gnome (and derivatives) on GNU/Linux. This theme proposes a color-schme taken from the Adwaita scpecification.

Use it with:

import "fyne.io/x/fyne/theme"
//...

app := app.New()
app.Settings().SetTheme(theme.AdwaitaTheme())

Adwaita Dark

Adwaita Light

fyne-x's People

Contributors

albinogeek avatar andydotxyz avatar bluebugs avatar charlesdaniels avatar dweymouth avatar ericneid avatar itsjustdel avatar jacalz avatar matusollah avatar metal3d avatar obaraemmanuel avatar orsinium avatar pbrown12303 avatar stuartmscott 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fyne-x's Issues

Cannot Extend widget.Filetree

The following code results in a thin blank bar with no content.

type customtree struct {
	xwidget.FileTree
}

func NewCustomTree(root fyne.URI) *customtree {
	tree := &customtree{}
	tree.ExtendBaseWidget(tree)
	tree.Root = root.String()
	return tree
}

widget.Filetree is very slow

Unfortunately, widget.Filetree is very slow in the Linux root directory. Is there a possibility to make it faster ? It barely responds to scrolling movements.

Regards,
Lennart

Diagrams Add-on Crashes on Android

I made a basic widget with one node and compiled it without issues using fyne-cross. However, the app crashes without an error message on Android v10.

My apologies for not providing any logs, however I was not able to extract any. And this is my first time developing Android app using Golang, not sure how to start debugging the issue in a way to reveal more information and make this ticket more useful...

CompletionEntry crash on fast input

Describe the bug:

Out of index error on fast input

To Reproduce:

Steps to reproduce the behaviour:

  1. Type four letters e.g "edin" quickly (difficult to get it to crash consistently)
    OR press the "simulate fast typing" button. This gives the same error as typing quickly

  2. See error

panic: runtime error: index out of range [3] with length 1

goroutine 18 [running, locked to thread]:
fyne.io/x/fyne/widget.newNavigableList.func3(0x7ff7e1196dd8?, {0x7ff7e1196150?, 0xc0000c48c0?})
        C:/Users/Del/go/pkg/mod/fyne.io/x/[email protected]/widget/completionentry.go:145 +0xf7
fyne.io/fyne/v2/widget.(*listLayout).setupListItem(0xc0000a81e0, 0xc00038ea10, 0x3)   
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/widget/list.go:411 +0x9b       
fyne.io/fyne/v2/widget.(*listLayout).updateList(0xc0000a81e0, 0x1)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/widget/list.go:456 +0x418      
fyne.io/fyne/v2/widget.(*listLayout).Layout(0x41600000000000f8?, {0x0?, 0xc0004295f8?, 0x7ff7e0ab5fb9?}, {0xecc1d0?, 0xc0?})
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/widget/list.go:369 +0x1e       
fyne.io/fyne/v2/internal/driver/common.updateLayout({0x7ff7e1195970?, 0xc00019a0c0?})
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:512 +0x70
fyne.io/fyne/v2/internal/driver/common.(*Canvas).EnsureMinSize.func1(0xc001002ac0)    
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:97 +0x235
fyne.io/fyne/v2/internal/driver/common.(*Canvas).walkTree.func2({0x7ff7e1195c70?, 0xc000e05300?}, {0xc000e05300?, 0xf542999ad?})
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:433 +0xae
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e1195c70, 0xc000e05300}, 0x0, {0x7ff7e1196150, 0xc000d788c0}, {0xe1366c00?, 0x7ff7?}, {0x429838?, 0xc0?}, {0xe0aaaa6a?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:197 +0x370
fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e1196150, 0xc000d788c0}, 0x0, {0x7ff7e11963f0, 0xc000136e00}, {0xe0943be9?, 0x7ff7?}, {0x429888?, 0xd5000000?}, {0x0?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190 +0x41d
fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176    
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e11963f0, 0xc000136e00}, 0x0, {0x7ff7e1195970, 0xc00019a0c0}, {0xe1366c00?, 0x7ff7?}, {0x4299c8?, 0xc0?}, {0xe0aaaa6a?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190 +0x41d
fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176    
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e1195970, 0xc00019a0c0}, 0x0, {0x7ff7e1195eb0, 0xc00038e3f0}, {0xe1366c00?, 0x7ff7?}, {0x429a90?, 0xc0?}, {0xe0aaaa6a?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190 +0x41d
fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176    
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e1195eb0, 0xc00038e3f0}, 0x0, {0x7ff7e1196630, 0xc000198000}, {0xe1366c00?, 0x7ff7?}, {0x429b58?, 0xc0?}, {0xe0aaaa6a?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190 +0x41d
fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176    
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e1196630, 0xc000198000}, 0x0, {0x7ff7e1196210, 0xc0000b2a00}, {0x429b80?, 0xc0?}, {0x429bc0?, 0xc0?}, {0xe0acb7b0?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190 +0x41d
fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176    
fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff7e1196210, 0xc0000b2a00}, 0x0, {0x0, 0x0}, {0x429c70?, 0xc0?}, {0x429c78?, 0x0?}, {0xe0c60ae6?, ...}, ...)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190 +0x41d
fyne.io/fyne/v2/internal/driver.WalkVisibleObjectTree({0x7ff7e1196210?, 0xc0000b2a00?}, 0x7ff7e1194370?, 0xc00004e3c0?)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:134 +0x4c
fyne.io/fyne/v2/internal/driver/common.(*Canvas).walkTree(0x7ff7e0c3a2a4?, 0xc0000251a0, 0x0, 0xc000429df0)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:439 +0x165
fyne.io/fyne/v2/internal/driver/common.(*Canvas).WalkTrees(0xc0000ba000, 0x7ff7e0944467?, 0x0?)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:360 +0xd9
fyne.io/fyne/v2/internal/driver/common.(*Canvas).EnsureMinSize(0xc0000ba000)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:102 +0xf1
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).repaintWindow.func1()
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:166 +0x35
fyne.io/fyne/v2/internal/driver/glfw.(*window).RunWithContext(0xc0000b4000, 0xc000429ea0)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/window.go:1329 +0x4f
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).repaintWindow(0xc000429f90?, 0xc000429f18?)
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:165 +0x4a
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread.func1()
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:228 +0x33a
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread
        C:/Users/Del/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:192 +0xca
exit status 2```

### Screenshot
![auto](https://user-images.githubusercontent.com/45520351/170705661-8eea228e-db06-4d22-ad56-cfc604ccb26d.png)

### Example code:
```package main

import (
	"strings"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
	xWidget "fyne.io/x/fyne/widget"
	"github.com/tidwall/cities"
)

func main() {

	a := app.New()
	w := a.NewWindow("Entry Completion")

	entry := xWidget.NewCompletionEntry([]string{})

	// When the use typed text, complete the list.
	cardTexts := []string{}

	entry.OnChanged = func(s string) {

		results := []cities.City{}

		for _, value := range cities.Cities {

			if len(value.City) < len(s) {
				continue
			}

			if strings.EqualFold(s, value.City[:len(s)]) {
				results = append(results, value)
			}
		}

		if len(results) == 0 {
			entry.HideCompletion()
			return
		}

		cardTexts = []string{}
		for _, r := range results {
			s := r.City
			cardTexts = append(cardTexts, s)
		}

		entry.SetOptions(cardTexts)
		entry.ShowCompletion()
	}

	button := widget.NewButton("Simulate fast typing", func() {

		for {
			entry.SetText("")
			entry.SetText(entry.Text + "edin")
		}
	})

	w.SetContent(container.NewVBox(button, entry))

	w.Resize(fyne.NewSize(700, 500))
	w.ShowAndRun()

}

Device (please complete the following information):

  • OS: Windows
  • Version: 10
  • Go version: go1.18.1
  • Fyne version: v2.1.4

How to setting button background color?

I have question about to change button background color.

  • I can not found any demo about the it.
  • I only find these.
  • (1) "type ButtonStyle"
  • (2) ButtonStyle determines the behaviour and rendering of a button.
  • I hope you can resolve my confuse , thank you so much.

Create a demo application

I think it would be a great idea to create a sort of demo application (in cmd/demo perhaps) to showcase most of, if not all, of the useful additions that this project provides over the regular fyne packages. Something like fyne_demo is what I am imagining. This is much better than adding a new project to the cmd/ folder for each widget.

This is not on top of my priority list at the moment so I'm opening it here so that anyone that wants to work on it can do so :)

Three-way split containers

Checklist

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

Is your feature request related to a problem?

In some cases an analogue of Split container that could handle more than two widgets inside would improve user experience. My use case is explained below.

I am writing an application with a three-pane window (i.e., the widgets are organized into three columns). Users should be able to change the sizes of the three columns. Currently I organize the window as a sequence of two HSplit containers:

hsplit(hsplit(COLUMN1, COLUMN2), COLUMN3)

This works, but the two "splitter" widgets that appear between the columns do not have the same behavior and this leads to an inconsistent user interface. Moving the first splitter preserves the size of the third column and changes only the sizes of the first two columns. But moving the second splitter, which visually is between COLUMN2 and COLUMN3, changes the sizes of all three columns:

three-way-split.webm

As a user, given such an interface I would certainly expect the two splitter widgets to behave in the same way. It would be nice to have a way to build this using standard fyne containers.

For completeness, here's the code for the minimal example:

package main

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

func main() {
	application := app.NewWithID("three-way-split")
	window := application.NewWindow("Three-way-split")

	label1 := widget.NewLabel("First")
	label2 := widget.NewLabel("Second")
	label3 := widget.NewLabel("Third")

	split1 := container.NewHSplit(label1, label2)
	split2 := container.NewHSplit(split1, label3)

	window.SetContent(split2)
	window.Resize(fyne.NewSize(float32(400), float32(100)))

	window.ShowAndRun()
}

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

Yes, it's possible to write an alternative Split container that could handle an arbitrary list of subordinate widgets. It shouldn't be very difficult, but I didn't do this since my goal of making three resizable columns was reached.

Describe the solution you'd like to see.

A new container, for example called SplitN, with APIs like

  • container.NewHSplitN(objects []fyne.CanvasObject) and similarly container.NewVSplitN
  • func (s *SplitN) SetWeights (weights []float32): after computing the minimal sizes for each object in the split container, divide the remaining free space available in the container among widgets according to the float values in the weights slice. Negative or zero weights should hide the corresponding widget. Positive weights do not have to sum to one, only their ratios matter.

CompletionEntry cannot type word when SetText is called in widget.List

As the following code shows, the text in CompletionEntry cannot be edited.

Screenshots

ๅ›พ็‰‡

Steps to reproduce the behaviour:

  • Run the code below
package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
	x "fyne.io/x/fyne/widget"
)

var data = []string{"a", "string", "list"}
var option = []string{"option1", "option2", "option3"}

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("List Widget")

	list := widget.NewList(
		func() int {
			return len(data)
		},
		func() fyne.CanvasObject {
			return x.NewCompletionEntry(option)
		},
		func(i widget.ListItemID, o fyne.CanvasObject) {
			e := o.(*x.CompletionEntry)
			e.SetText(data[i])
			e.OnChanged = func(s string) {
				e.ShowCompletion()
			}
		})

	myWindow.SetContent(list)
	myWindow.ShowAndRun()
}

Completion entry causes crashing

I have been experiencing a bug with Fyne-X regarding the completion widget. I am utilizing Fynes app tab to display a completion entry. It seems once text is entered in the completion widget, then going to another tab for a few minutes (presumably for how long it takes Go's garbage collection to clean up), then switching back to the tab with the completion entry in it, it causes my application to panic with this stack trace:

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

goroutine 20 [running, locked to thread]:
fyne.io/x/fyne/widget.(*CompletionEntry).maxSize(0xc00161c900)
        C:/Users/kinlougn/go/pkg/mod/fyne.io/x/[email protected]/widget/completionentry.go:98 +0

Upon going to this section of the completionentry.go file, it seems I can resolve the issue by adding this right after we populate the cnv variable:

if cnv == nil {
    return fyne.NewSize(0, 0)
}

In my opinion, it seems like Go's garbage collection is cleaning up something it shouldn't, and when I switch back to the app tab with the completion entry, it tries to reference it but it's no longer there, causing the application to panic.

bad fileroot even hought setting

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 set files := xWidget.NewFileTree(app.Storage().RootURI()) ..., maybe it is not bug(in this case i am sorry), but when create, err := e.app.Storage().Create(strings.Join([]string{entry.Text, ".cl"}, "")) create dir "Document", why do not xWidget look there?

How to reproduce

  1. go to https://github.com/MatejMagat305/fyneCL
  2. download it
  3. run multiple go run .
  4. debug on 48th line in file files.go

Screenshots

path

Example code

	create, err := e.app.Storage().Create(strings.Join([]string{entry.Text, ".cl"}, ""))

....        

	files := xWidget.NewFileTree(ed.app.Storage().RootURI())

Fyne version

fyne.io/fyne/v2 v2.4.4

Go compiler version

1.22.0

Operating system and version

Pop!_OS 22.04 LTS x86_64

Additional Information

it is same code as fyne-io/fyne#4668, but probably different problem, so I was create next issues ...

Conflicting package names

As a user of the fyne framework who wants to use some widgets or features from fyne-x I will have to deal with package naming conflicts a lot. Both fyne and fyne-x modules have a package widgets and a package layout.

Responsive breaks TextWrapWord of widget.Label

It seems the responsive layout breaks the TextWordWrap of widget.Label.
If I build the example cmd with go 1.18.1 on MacOS (ARM) it does not wrap the text if the window gets smaller. It only wraps the text where there is an \n in the code.

Import Paths

Neither of the import paths produce the correct meta tags:

Code Meta URL
404 missing https://fyne.io/fyne/x/layout?go-get=1
404 missing https://fyne.io/fyne/x/widget?go-get=1
404 missing https://fyne.io/fyne/x?go-get=1
301 missing https://fyne.io/fyne?go-get=1

The URL https://fyne.io/fyne/x?go-get=1 should have the following:

<meta name="go-import" content="import-prefix git github.com/fyne-io/fyne-x">

As per documentation:

https://golang.org/cmd/go/#hdr-Remote_import_paths


This is needed to fix the govet CI test, and merge PRs.

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.