Giter Club home page Giter Club logo

gtkutilities.jl's People

Contributors

cody-g avatar github-actions[bot] avatar jonathanbieler avatar juliatagbot avatar keno avatar mauro3 avatar staticfloat avatar timholy avatar tkelman avatar tomerarnon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gtkutilities.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

Issues with basic GtkUtilities workflow

Hi,
At the moment I am using Gtk to build a gui, and would like to add GtkUtilities for its added interactivity functions. I'm running into issues whenever I try to incorporate anything from GtkUtilities, however.

A very simple draw function (like below) works fine.

using  Gtk.ShortNames, Images, GtkUtilities
filepath = "image.tiff"
win = Window("image")
c = Canvas()
push!(win, c)
A = Images.load(filepath)

@guarded draw(c) do widget
    copy!(widget, A)
end

showall(win)

Adding, for example, guidata[c, :xview] into the draw function in any form, crashes julia. E.g.:

@guarded draw(c) do widget
    xview, yview = guidata[widget, :xview], guidata[widget, :yview]
    println(xview, yview)
   
    copy!(widget, A)
end

breaks the code.
Since guidata is critical for panzoom and other operations, I'm not able to use GtkUtilities the way I would like/it was meant to be used.
Is there something I'm obviously doing wrong here? I've tried following the julia_gui example as well as @timholy's youtube tutorial from a couple of years back about how to use panzoom, and haven't been able to improve my results.

Pan/zoom not working with numlock

I actually thought Immerse did not support pan/zoom until I saw Tim's YouTube video.

The problem is that GtkUtilities.jl is not properly masking for modifier keys that are considered "significant".

I had to replace:

keymatch(event, keydesc) = event.keyval == keydesc[1] && event.state == UInt32(keydesc[2])

With the following:

function gtk_accelerator_get_default_mod_mask()
	ccall((:gtk_accelerator_get_default_mod_mask,Gtk.libgtk),Cint,())
end

keymatch(event, keydesc) = event.keyval == keydesc[1] &&
	(event.state&gtk_accelerator_get_default_mod_mask()) == UInt32(keydesc[2])

Now, I can zoom even if my NumLock key is on... but similar masking would also be necessary on the mouse operations.

Comments

  • I did not make a PR because my guess is that accelerator_get_default_mod_mask() should be in Gtk.jl - and someone that better understands the Gtk.jl naming convention should probably be adding it.
  • Note that gtk_accelerator_set_default_mod_mask() is only supposed to be set at "application startup" - which I believe means it could potentially be stored as a const while "loading" Gtk.jl (Not sure how this would work out, though).

New version to support Images.jl v0.22

I've just realized that you've created a new release in February and changed the Project.toml afterwards to support v0.22 of Images.jl but haven't released a version since then.
Do you mind to release v1.0.4 for this? ๐Ÿ˜‰

Does Grid() not work with GtkUtilities, or is the issue elsewhere?

I am using Gtk.Shortnames and GtkUtilties in my gui, and this very simple example code doesn't work:

using  Gtk.ShortNames, Images, TestImages, GtkUtilities

A = testimage("lighthouse")

win = Window("image")
c = Canvas()
g = Grid(visible = true)
g[1,1] = c
push!(win, g)

@guarded draw(c) do widget
    copy!(widget, A)
end

showall(win)

This returns a blank window. If instead I remove mention of the grid and simply copy! to the canvas, then this returns what I expect (but doesn't allow me to populate a grid with various items). Is the problem with placing the image in the grid in the first place? Is there a way to do this successfully while still being able to use GtkUtilities's canvas-specific functions?

pan/zoom in the julia_gui demo?

If i understand the setting in the demo correctly, this should enable

  • button1 rubberband select -> works
  • ctrl+wheel zoom in and out -> works
  • if zoomed in, wheel pans up and down, with shift left and right

But somehow i miss panning with mouse (pointer)?

ERROR: Direction 3 not recognized

Moving this over from timholy/ProfileView.jl#43:

julia> FATAL ERROR: Gtk state corrupted by error thrown in a callback:
ERROR: Direction 3 not recognized
 in scrollpm at /Users/kfischer/.julia/v0.5/GtkUtilities/src/panzoom.jl:385
 in anonymous at /Users/kfischer/.julia/v0.5/GtkUtilities/src/panzoom.jl:354
 in mousescroll_cb at /Users/kfischer/.julia/v0.5/Gtk/src/events.jl:193
 in anonymous at /Users/kfischer/.julia/v0.5/Gtk/src/events.jl:2
 in g_sigatom at /Users/kfischer/.julia/v0.5/Gtk/src/GLib/signals.jl:166
 in gtk_main at /Users/kfischer/.julia/v0.5/Gtk/src/events.jl:1

This happens on a macbook with two-finger swipe.

Complie fails on 0.5

I'm trying to use ProfileView on 0.5:

julia> using ProfileView
INFO: Precompiling module ProfileViewGtk...
ERROR: LoadError: LoadError: syntax: unexpected )
 in include_from_node1(::String) at ./loading.jl:426 (repeats 2 times)
 in macro expansion; at ./none:2 [inlined]
 in anonymous at ./<missing>:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /home/mauro/.julia/v0.5/GtkUtilities/src/panzoom.jl, in expression starting on line 61
while loading /home/mauro/.julia/v0.5/GtkUtilities/src/GtkUtilities.jl, in expression starting on line 43
ERROR: LoadError: Failed to precompile GtkUtilities to /home/mauro/.julia/lib/v0.5/GtkUtilities.ji
 in compilecache(::String) at ./loading.jl:505

I'll try and fix it...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.