Golang NewVerticalBox - 7 examples found. These are the top rated real world Golang examples of github.com/andlabs/ui.NewVerticalBox extracted from open ...
Togglenavigation
HotExamplesENENRUDEFRESPTITJPZH
GoPHPC#JavaGoC++PythonJSTS
SearchGolangNewVerticalBoxExamplesGolangNewVerticalBox-7examplesfound.ThesearethetopratedrealworldGolangexamplesofgithub.com/andlabs/ui.NewVerticalBoxextractedfromopensourceprojects.Youcanrateexamplestohelpusimprovethequalityofexamples.ProgrammingLanguage:GolangNamespace/PackageName:github.com/andlabs/uiMethod/Function:NewVerticalBoxExamplesathotexamples.com:7reportthisadRelatedNewOauthAccessInverseTransverseMercatorNewServerWarnfGpgEncryptSupportedSeriesFeInvertGetConfLogBadRequestreportthisadRelatedinlangsUGMail(PHP)form_template(PHP)tbl_test_log(C#)RegexNodeConcatenation(C#)DRM_ERROR(C++)msg_Info(C++)TPlayerStats(Java)ExtObjectContainer(Java)bytes(Python)write_values(Python)reportthisadExample#11ShowfileFile:
main.go
Project:
plumbum/go-samplesfuncinitGUI(){
/*
ff:=ui.ListFontFamilies()
fori:=0;i100{
progressCounter=0
}
}
}()
timeTicker:=time.NewTicker(time.Millisecond*10)
gofunc(){
fort:=rangetimeTicker.C{
//Чтобызаписатьзначениеввиджетиспользуемпотокобезопасныйвызов
ui.QueueMain(func(){
labelTime.SetText(t.Format(time.StampMilli))
})
}
}()
hystogrammTicker:=time.NewTicker(time.Millisecond*500)
gofunc(){
for_=rangehystogrammTicker.C{
//Чтобызаписатьзначениеввиджетиспользуемпотокобезопасныйвызов
ui.QueueMain(func(){
areaHandler.Push(rand.Intn(100))
area.QueueRedrawAll()
})
}
}()
log.Println("InitGUIdone")
}Example#20ShowfileFile:
ui.go
Project:
adrien3d/goboxfuncmain(){
err:=ui.Main(func(){
name:=ui.NewEntry()
button:=ui.NewButton("Greet")
greeting:=ui.NewLabel("")
box:=ui.NewVerticalBox()
box.Append(ui.NewLabel("Enteryourname:"),false)
box.Append(name,false)
box.Append(button,false)
box.Append(greeting,false)
window:=ui.NewWindow("Hello",200,100,false)
window.SetChild(box)
button.OnClicked(func(*ui.Button){
greeting.SetText("Hello,"+name.Text()+"!")
})
window.OnClosing(func(*ui.Window)bool{
ui.Quit()
returntrue
})
window.Show()
})
iferr!=nil{
panic(err)
}
}Example#30ShowfileFile:
gui.go
Project:
software-engineering-amsterdam/multi-ql//ShowWindowshowstheUIafterinvocation
func(this*GUI)ShowWindow(errorsToDisplay,warningsToDisplay[]error){
guiError:=ui.Main(func(){
log.Info("ShowingGUI")
contentBox:=ui.NewVerticalBox()
contentBox.SetPadded(true)
this.Window=ui.NewWindow("QL",800,600,false)
this.Window.OnClosing(func(w*ui.Window)bool{
log.Info("Destroyofwindowinitiated")
this.Symbols.SaveToDisk()
ui.Quit()
returntrue
})
this.Window.SetChild(contentBox)
this.Window.SetMargined(true)
this.Window.Show()
//ifthereareanyerrors/warnings,showadialog
iferrorsPresent:=this.showErrorDialogIfNecessary(errorsToDisplay);!errorsPresent{
this.showWarningDialogIfNecessary(warningsToDisplay)
this.ShowForm()
}
})
ifguiError!=nil{
log.WithFields(log.Fields{"guiError":guiError}).Panic("EncounteredGUIerror")
}
}Example#40ShowfileFile:
guiform.go
Project:
software-engineering-amsterdam/multi-ql//createQuestionTablecreatesatableboxcontainingthepassedGUIQuestions
func(this*GUIForm)createQuestionTable(questions[]*GUIQuestion)*ui.Box{
table:=ui.NewVerticalBox()
for_,question:=rangequestions{
attachQuestionToTable(table,question)
}
log.WithFields(log.Fields{"NumOfQuestions":len(questions)}).Info("Createdquestiontable")
returntable
}Example#50ShowfileFile:
uidoc.go
Project:
duckbrain/uidoc//CreatesanewUIDoccontrol.Thiscanbeaddedtoaui.Window,ui.Box,etc.
funcNew()*UIDoc{
r:=&UIDoc{}
r.area=ui.NewScrollingArea(&drawHandler{r},400,400)
r.measureArea=ui.NewArea(&measureHandler{r})
r.box=ui.NewVerticalBox()
toolbarContainer:=ui.NewHorizontalBox()
toolbarHeightRetainer:=ui.NewHorizontalSeparator()
toolbarContainer.Append(toolbarHeightRetainer,false)
toolbarContainer.Append(r.measureArea,true)
r.box.Append(r.area,true)
r.box.Append(toolbarContainer,false)
returnr
}Example#60ShowfileFile:
main.go
Project:
duckbrain/uidocfuncmain(){
file,err:=os.Open("document.json")
iferr!=nil{
panic(err)
}
deferfile.Close()
buffer:=new(bytes.Buffer)
_,err=buffer.ReadFrom(file)
iferr!=nil{
panic(err)
}
vardocumentuidoc.Element
err=ui.Main(func(){
document,err=uidoc.Parse(buffer.Bytes())
iferr!=nil{
panic(err)
}
font:=ui.LoadClosestFont(&ui.FontDescriptor{
Family:"DejaVu",
Size:12,
})
name:=ui.NewEntry()
button:=ui.NewButton("Greet")
doc:=uidoc.New()
doc.SetDocument(document)
box:=ui.NewVerticalBox()
box.Append(ui.NewLabel("Enteryourname:"),false)
box.Append(name,false)
box.Append(button,false)
box.Append(doc,true)
window:=ui.NewWindow("Hello",400,700,false)
window.SetChild(box)
button.OnClicked(func(*ui.Button){
element:=uidoc.NewText("Hello,"+name.Text()+"!",font)
document.(*uidoc.Group).Append(element)
doc.Layout()
})
window.OnClosing(func(*ui.Window)bool{
ui.Quit()
returntrue
})
window.Show()
})
iferr!=nil{
panic(err)
}
}Example#70ShowfileFile:
guiform.go
Project:
software-engineering-amsterdam/multi-ql//showdisplaystheformbox.Itshouldonlybecalledifnosemanticerrorsarepresent
func(this*GUIForm)show(window*ui.Window){
log.WithFields(log.Fields{"identifier":this.Form.Identifier()}).Info("Showingform")
this.FormContainer=ui.NewVerticalBox()
window.SetChild(this.FormContainer)
}