本文整理匯總了Golang中github.com/giancosta86/moondeploy/v3/launchers.Launcher.GetTitle方法的典型用法代碼示例。如果您正苦於以下問題:Golang Launcher.GetTitle方法的具體用法?Golang Launcher.GetTitle怎麽用?Golang Launcher.GetTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/giancosta86/moondeploy/v3/launchers.Launcher
的用法示例。
在下文中一共展示了Launcher.GetTitle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: setupUserInterface
func setupUserInterface(launcher launchers.Launcher, userInterface ui.UserInterface) {
userInterface.SetApp(launcher.GetTitle())
log.SetCallback(func(level logging.Level, message string) {
if level <= logging.INFO {
userInterface.SetStatus(message)
}
})
userInterface.Show()
}
示例2: NewGtkUserInterface
func NewGtkUserInterface(launcher launchers.Launcher) (userInterface *GtkUserInterface, err error) {
userInterface = &GtkUserInterface{
launcher: launcher,
}
gladeDescriptorPath := filepath.Join(
filepath.Dir(launcher.GetExecutable()),
"moondeploy.glade")
runOnUIThreadAndWait(func() interface{} {
builder, err := gtk.BuilderNew()
if err != nil {
panic(err)
}
err = builder.AddFromFile(gladeDescriptorPath)
if err != nil {
panic(err)
}
windowObject, err := builder.GetObject("mainWindow")
if err != nil {
panic(err)
}
window := windowObject.(*gtk.Window)
userInterface.window = window
launcher := userInterface.launcher
window.SetTitle(launcher.GetTitle())
window.SetIconFromFile(launcher.GetIconPathAsPng())
window.Connect("destroy", func() {
window.Destroy()
userInterface.window = nil
gtk.MainQuit()
userInterface.closedByUser = true
})
appLabelObject, err := builder.GetObject("appLabel")
if err != nil {
panic(err)
}
userInterface.appLabel = appLabelObject.(*gtk.Label)
headerLabelObject, err := builder.GetObject("headerLabel")
if err != nil {
panic(err)
}
userInterface.headerLabel = headerLabelObject.(*gtk.Label)
statusLabelObject, err := builder.GetObject("statusLabel")
if err != nil {
panic(err)
}
userInterface.statusLabel = statusLabelObject.(*gtk.Label)
progressBarObject, err := builder.GetObject("progressBar")
if err != nil {
panic(err)
}
userInterface.progressBar = progressBarObject.(*gtk.ProgressBar)
return nil
})
return userInterface, nil
}