lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.81k stars 886 forks source link

How to hide in WebView the URL in the Window? #406

Open jeffotoni opened 6 years ago

jeffotoni commented 6 years ago

What property or func can I use to hide the URL in the WebView window?

.... var le walk.LineEdit var wv walk.WebView

MainWindow{

    Visible: true,

    Icon:    Bind("'../img/' + icon(wv.URL) + '.ico'"),

    Title:   "Driver Win...",

    MinSize: Size{800, 600},

    Layout:  VBox{MarginsZero: true},

    Children: []Widget{

        LineEdit{
            AssignTo: &le,
            Text:     Bind("wv.URL"),
            OnKeyDown: func(key walk.Key) {
                if key == walk.KeyReturn {
                    wv.SetURL(le.Text())
                }
            },
        },
        WebView{
            AssignTo: &wv,
            Name:     "Driver Archivio Brasil",
            URL:      "http://127.0.0.1:9001/golang",
        },
    },

.................

lxn commented 6 years ago

It sounds to me like you may want to just drop the LineEdit widget.

jeffotoni commented 6 years ago

Sorry did not understand ?

I want to use the webview but I do not want to let the user change the URL, it will look like a browser built into the WINDOWS GUI.

How can I proceed to remove the field that I enter with the URL in the GUI?

Thank you

kjk commented 6 years ago

Remove the LineEdit line i.e.:

MainWindow{ 
    Visible: true,  
    Icon:    Bind("'../img/' + icon(wv.URL) + '.ico'"), 
    Title:   "Driver Win...",   
    MinSize: Size{800, 600},
    Layout:  VBox{MarginsZero: true},
    Children: []Widget{
        WebView{
            AssignTo: &wv,
            Name:     "Driver Archivio Brasil",
            URL:      "http://127.0.0.1:9001/golang",
        },
    },
jeffotoni commented 6 years ago

Wow, that was it. It worked 100% now.

Thank youoooooooo.