[v3 linux] dialog fixes

This commit is contained in:
Travis McLane
2023-06-23 21:50:51 -05:00
parent 33e20cbc77
commit c123430f22
2 changed files with 11 additions and 14 deletions
+1 -4
View File
@@ -1,7 +1,5 @@
package application
import "fmt"
func (m *linuxApp) showAboutDialog(title string, message string, icon []byte) {
window := globalApplication.getWindowForID(m.getCurrentWindowID())
var parent pointer
@@ -31,8 +29,7 @@ func (m *linuxDialog) show() {
}
response := runQuestionDialog(parent, m.dialog)
if response >= 0 {
fmt.Println("Response: ", response)
if response >= 0 && response < len(m.dialog.Buttons) {
button := m.dialog.Buttons[response]
if button.Callback != nil {
go button.Callback()
+10 -10
View File
@@ -30,12 +30,12 @@ const (
GdkWindowStateFullscreen = 1 << 4
// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkmessagedialog.h#L87
GtkButtonsNone int = iota
GtkButtonsOk
GtkButtonsClose
GtkButtonsCancel
GtkButtonsYesNo
GtkButtonsOkCancel
GtkButtonsNone int = 0
GtkButtonsOk = 1
GtkButtonsClose = 2
GtkButtonsCancel = 3
GtkButtonsYesNo = 4
GtkButtonsOkCancel = 5
// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkdialog.h#L36
GtkDialogModal = 1 << 0
@@ -45,10 +45,10 @@ const (
GtkOrientationVertical = 1
// enum GtkMessageType
GtkMessageInfo = iota
GtkMessageWarning
GtkMessageQuestion
GtkMessageError
GtkMessageInfo = 0
GtkMessageWarning = 1
GtkMessageQuestion = 2
GtkMessageError = 3
)
type GdkGeometry struct {