Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F136118
windows_ui.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
windows_ui.go
View Options
// +build windows,!linux
package
sshtunnel
import
(
"github.com/lxn/walk"
.
"github.com/lxn/walk/declarative"
)
type
PasswordForm
struct
{
Credentials
*
Credentials
}
func
NewPasswordForm
()
*
PasswordForm
{
return
&
PasswordForm
{}
}
func
(
p
*
PasswordForm
)
Show
()
{
var
mainWindow
*
walk
.
MainWindow
var
usernameLE
,
passwordLE
*
walk
.
LineEdit
p
.
Credentials
=
&
Credentials
{
Username
:
"Test"
}
MainWindow
{
AssignTo
:
&
mainWindow
,
Title
:
"UNR College of Engineering Tunneling"
,
MinSize
:
Size
{
250
,
150
},
MaxSize
:
Size
{
250
,
150
},
Size
:
Size
{
255
,
150
},
Layout
:
VBox
{},
Children
:
[]
Widget
{
Label
{
Text
:
"Connecting to License Servers"
},
HSplitter
{
Children
:
[]
Widget
{
Label
{
Text
:
"Username"
},
LineEdit
{
AssignTo
:
&
usernameLE
},
},
},
HSplitter
{
Children
:
[]
Widget
{
Label
{
Text
:
"Password"
},
LineEdit
{
PasswordMode
:
true
,
AssignTo
:
&
passwordLE
,
OnKeyDown
:
func
(
key
walk
.
Key
)
{
if
key
==
walk
.
KeyReturn
{
p
.
Credentials
.
Username
=
usernameLE
.
Text
()
p
.
Credentials
.
Password
=
passwordLE
.
Text
()
mainWindow
.
Close
()
}
},
},
},
},
PushButton
{
Text
:
"Login"
,
OnClicked
:
func
()
{
p
.
Credentials
.
Username
=
usernameLE
.
Text
()
p
.
Credentials
.
Password
=
passwordLE
.
Text
()
mainWindow
.
Close
()
},
},
PushButton
{
Text
:
"Cancel"
,
OnClicked
:
func
()
{
mainWindow
.
Close
()
},
},
},
}.
Run
()
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 24, 6:03 PM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15141
Default Alt Text
windows_ui.go (1 KB)
Attached To
rST sshtunnel
Event Timeline
Log In to Comment