Skip to content

Commit 683c0c5

Browse files
committed
couple more small things
1 parent be2eae7 commit 683c0c5

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/windows.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ function GtkDialogLeaf(title::StringLike, parent::GtkContainer, flags::Integer,
3737
w = GtkDialogLeaf(ccall((:gtk_dialog_new_with_buttons,libgtk), Ptr{GObject},
3838
(Ptr{Uint8},Ptr{GObject},Cint,Ptr{Void}),
3939
title, parent, flags, C_NULL))
40-
for key in keys(buttons)
41-
push!(w, key, buttons[key])
40+
for (k,v) in buttons
41+
push!(w, k, v)
4242
end
4343
w
4444
end
@@ -50,9 +50,9 @@ function GtkMessageDialogLeaf(parent::GtkContainer, flags::Integer, typ::Integer
5050
message::StringLike, buttons)
5151
w = GtkMessageDialogLeaf(ccall((:gtk_message_dialog_new,libgtk), Ptr{GObject},
5252
(Ptr{GObject},Cint,Cint,Cint,Ptr{Uint8}),
53-
parent, flags, typ, 0, bytestring(message) ))
54-
for key in keys(buttons)
55-
push!(w, key, buttons[key])
53+
parent, flags, typ, GtkButtonsType.NONE, bytestring(message) ))
54+
for (k,v) in buttons
55+
push!(w, k, v)
5656
end
5757
w
5858
end
@@ -64,11 +64,9 @@ function info_dialog(message::String; parent = GtkNullContainer())
6464
destroy(dlg)
6565
end
6666

67-
function ask_dialog(message::String, yes_text="yes", no_text="no"; parent = GtkNullContainer())
67+
function ask_dialog(message::String, yes_text="Yes", no_text="No"; parent = GtkNullContainer())
6868
dlg = @GtkMessageDialog(parent, GtkDialogFlags.DESTROY_WITH_PARENT,
69-
GtkMessageType.QUESTION, GtkButtonsType.NONE, message)
70-
push!(dlg, yes_text, 1)
71-
push!(dlg, no_text, 2)
69+
GtkMessageType.QUESTION, message, ((yes_text,1), (no_text,2)))
7270
response = run(dlg)
7371
destroy(dlg)
7472
response == 1

0 commit comments

Comments
 (0)