Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple keypresses in example #658

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

LilithHafner
Copy link
Contributor

Two sequential releases resulted in an error because the first set time0 to notihing and the second tried to use time0.

Before:

julia> You pressed key 97 which is 'a'.
repeating key 115
repeating key 100
You released key 97 after time 121 msec.
┌ Warning: Executing #51:
└ @ Gtk.GLib ~/.julia/packages/Gtk/OyCvN/src/GLib/signals.jl:106
ERROR: MethodError: no method matching -(┌ Warning: Executing #51:
└ @ Gtk.GLib ~/.julia/packages/Gtk/OyCvN/src/GLib/signals.jl:106
::ERROR: UInt32MethodError: , no method matching ::-Nothing()::
Closest candidates are:
  -(::Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}) at int.jl:85
  -(::T, ::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} at int.jl:86
  -(::Union{UInt16, UInt32, UInt64, UInt8}, ::BigInt) at gmp.jl:534
  ...UInt32, 
Stacktrace:
 [1] ::(::var"#51#52")Nothing()widget
Closest candidates are:
  -(::Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}) at int.jl:85
  -(::T, ::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} at int.jl:86
  -(::Union{UInt16, UInt32, UInt64, UInt8}, ::BigInt) at gmp.jl:534
  ...::
Stacktrace:GtkWindowLeaf
,  event[1]:: Gtk.GdkEventKey(::var"#51#52"))(
widget   @ ::MainGtkWindowLeaf , ./eventREPL[346]:3::Gtk.GdkEventKey
) 
[2]   @  Main(::Gtk.GLib.var"#90#92"{Ptr{Gtk.GLib.GValue}, UInt32, Ptr{Gtk.GLib.GValue}, Vector{Any}, Bool, var"#51#52", Ptr{Any}}) (./)REPL[346]:3
   @ 
Gtk.GLib  [2]~/.julia/packages/Gtk/OyCvN/src/GLib/ signals.jl:87(::Gtk.GLib.var"#90#92"{Ptr{Gtk.GLib.GValue}, UInt32, Ptr{Gtk.GLib.GValue}, Vector{Any}, Bool, var"#51#52", Ptr{Any}})(
) 
[3]   @  Gtk.GLibg_siginterruptible (~/.julia/packages/Gtk/OyCvN/src/GLib/fsignals.jl:87::Gtk.GLib.var"#90#92"
{Ptr{Gtk.GLib.GValue}, UInt32, Ptr{Gtk.GLib.GValue}, Vector{Any}, Bool, var"#51#52", Ptr{Any}} , [3]cb ::g_siginterruptibleAny()f
::   @ Gtk.GLib.var"#90#92"Gtk.GLib{Ptr{Gtk.GLib.GValue}, UInt32, Ptr{Gtk.GLib.GValue}, Vector{Any}, Bool, var"#51#52", Ptr{Any}} , ~/.julia/packages/Gtk/OyCvN/src/GLib/cbsignals.jl:216::Any
) 
[4]   @  Gtk.GLibGClosureMarshal (~/.julia/packages/Gtk/OyCvN/src/GLib/closurefsignals.jl:216::Ptr
{Nothing} , [4]return_value ::GClosureMarshalPtr({Gtk.GLib.GValue}closuref, ::n_param_valuesPtr::{Nothing}UInt32, , return_valueparam_values::::PtrPtr{Gtk.GLib.GValue}{Gtk.GLib.GValue}, , n_param_valuesinvocation_hint::::UInt32Ptr, {Nothing}param_values, ::marshal_dataPtr::{Gtk.GLib.GValue}Ptr, {Nothing}invocation_hint)::
Ptr   @ {Nothing}Gtk.GLib,  marshal_data~/.julia/packages/Gtk/OyCvN/src/GLib/::signals.jl:58Ptr{Nothing}
) 
[5]   @  Gtk.GLib(::Gtk.var"#253#254") (~/.julia/packages/Gtk/OyCvN/src/GLib/)signals.jl:58
   @ 
Gtk  [5]~/.julia/packages/Gtk/OyCvN/src/ events.jl:2(::Gtk.var"#253#254")(
) 
[6]   @  Gtkg_sigatom (~/.julia/packages/Gtk/OyCvN/src/fevents.jl:2::Any
) 
[6]   @  Gtk.GLibg_sigatom (~/.julia/packages/Gtk/OyCvN/src/GLib/fsignals.jl:176::Any
) 
[7]   @  Gtk.GLibgtk_main (~/.julia/packages/Gtk/OyCvN/src/GLib/)signals.jl:176
   @ 
Gtk  [7]~/.julia/packages/Gtk/OyCvN/src/ events.jl:1gtk_main(
)

   @ Gtk ~/.julia/packages/Gtk/OyCvN/src/events.jl:1

After:

You pressed key 97 which is 'a'.
You pressed key 115 which is 's'.
You pressed key 100 which is 'd'.
You released key 97 after time 109 msec.
You released key 115 after time 89 msec.
You released key 100 after time 89 msec.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2819040286

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.8%) to 62.876%

Totals Coverage Status
Change from base Build 2795089809: -1.8%
Covered Lines: 1631
Relevant Lines: 2594

💛 - Coveralls

@coveralls
Copy link

coveralls commented Aug 8, 2022

Pull Request Test Coverage Report for Build 2819040286

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+5.5%) to 70.193%

Totals Coverage Status
Change from base Build 2795089809: 5.5%
Covered Lines: 1785
Relevant Lines: 2543

💛 - Coveralls

@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #658 (2b4faf4) into master (ea4e6ab) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #658   +/-   ##
=======================================
  Coverage   65.60%   65.60%           
=======================================
  Files          32       32           
  Lines        2721     2721           
=======================================
  Hits         1785     1785           
  Misses        936      936           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tknopp tknopp merged commit a09a48c into JuliaGraphics:master Aug 8, 2022
@LilithHafner LilithHafner deleted the patch-2 branch August 8, 2022 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants