Giter Site home page Giter Site logo

gtk.jl's People

Contributors

bfredl avatar bjarthur avatar coloursofnoise avatar fcard avatar giordano avatar ianbutterworth avatar ihnorton avatar jakebolewski avatar jeffbezanson avatar jefffessler avatar jonathanbieler avatar jverzani avatar jwahlstrand avatar keno avatar lilithhafner avatar logankilpatrick avatar lucianolorenti avatar nlw0 avatar remi-garcia avatar saolof avatar sbrisson avatar simondanisch avatar staticfloat avatar timholy avatar tkelman avatar tknopp avatar vexatos avatar vtjnash avatar wherrera10 avatar yakir12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtk.jl's Issues

[PkgEval] Gtk may have a testing issue on Julia 0.3 (2014-06-24)

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.2) and the nightly build of the unstable version (0.3). The results of this script are used to generate a package listing enhanced with testing results.

On Julia 0.3

  • On 2014-06-23 the testing status was Tests pass.
  • On 2014-06-24 the testing status changed to Tests fail, but package loads.

Tests pass. means that PackageEvaluator found the tests for your package, executed them, and they all passed.

Tests fail, but package loads. means that PackageEvaluator found the tests for your package, executed them, and they didn't pass. However, trying to load your package with using worked.

This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.

Test log:

INFO: Installing BinDeps v0.2.14
INFO: Installing Cairo v0.2.13
INFO: Installing Color v0.2.10
INFO: Installing Gtk v0.6.2
INFO: Installing URIParser v0.0.2
INFO: Building Cairo
INFO: Package database updated
/usr/bin/xvfb-run: line 170: 20447 Segmentation fault      DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
INFO: Package database updated

More convenient callback syntax?

In #10 there was discussion of the proper interface for setting callbacks; the current signal_connect places fairly high demands on the user.

In #10 the proposal was something like this:

connect(obj -> upbutton_cb(obj, state, displayfunc), upbutton, "clicked")
connect((obj, event) -> upbutton_cb(obj, event, state, displayfunc), upbutton, "button-press-event")

and the equivalent do syntax. Here, state and displayfunc contain data (or e.g., functions) that the callback needs to do its job.

Two possible implementations discussed were (1) a set of wrapper functions handling the different number of arguments from various signals, together with a Dict to look up which wrapper function and argument types to use; (2) defining closures within the GTK infrastructure.

Full GtkBuilder example?

I found my ways through #39, how to get the toplevel window and to show it. However, the julia Gtk only shows the window, where glade put more content.

I have a window, inside a HBox, inside an image, 2 buttons.

With python code like this

        builder = gtk.Builder()
        builder.add_from_file(self.filename)
        self.window = builder.get_object("window1")
        self.window.connect('delete-event',gtk.main_quit)
        self.window.show()

i get
selection_008

With julia

julia> using Gtk

julia> b = Gtk.GtkBuilder("gui1.glade")
GtkBuilder(translation-domain=NULL, )

julia> w = GAccessor.object(b,"window1");
julia> showall(w)

i only get the top-level window.

Julia 0.2 missing getter/setter

I don't get this. Using Julia 0.2:

julia> using Gtk.ShortNames
julia> methods(G_.sort_column_id)
#2 methods for generic function "sort_column_id":
sort_column_id(tree_column::GtkTreeViewColumnI,sort_column_id_)
sort_column_id(tree_column::GtkTreeViewColumnI)

Using 0.3:

julia> using Gtk.ShortNames
julia> methods(G_.sort_column_id)
#4 methods for generic function "sort_column_id":
sort_column_id(sortable::Union(GtkTreeStore,GtkListStore))
sort_column_id(sortable::Union(GtkTreeStore,GtkListStore),sort_column_id_,order)

sort_column_id(tree_column::GtkTreeViewColumnI,sort_column_id_)
sort_column_id(tree_column::GtkTreeViewColumnI)

Why are methods missing?

Move rubberband code from ImageView to Gtk?

The rubberband selection code in ImageView could conceivably be added to Gtk/src/cairo.jl. Then it would be of greater use to Winston and other projects that might want to implement zooming.

Alternatively, we could have a GtkExtras. Finally, of course it could continue to live in its current location.

If interested, I'll prepare a PR.

Gtk.jl seems broken with latest Julia HEAD

Trying to use Gtk.jl fr the first time, so maybe I missed something.

System is debian (jessie), with both libgtk-3-0 and libgtk2.0-0 installed.

Built julia from up-to-date sources:
$ git describe v0.2.0-2834-g64f437b

Try to run Gtk.jl / test / tests.jl or even simpler...

julia> using Gtk.ShortNames

julia> w = @Window("Hola!")
ERROR: @Window not defined

GtkFileChooser Properties

I am trying to use the GtkFileChooser but it seems that it misses some properties.

Both dlg[:filename,String] and dlg[:uri,String] are missing so that it seems to be not possble to obtain the selected filename.

I have not totally get how the auto-generation of getters and setters work so that I still don't know how to fix this.

get/set methods

Not all get/set methods access properties. do I want a lot of get_xxx/set_xxx pair for all objects, letting them merge when their names overlap, but otherwise being completely separate? Would they all be exported? or do I want to merge them into one crazy get() method?

macros MIA?

The first example in the usage doc fails for me.

julia> using Gtk

julia> win = @GtkWindow("My window")
ERROR: @GtkWindow not defined

But this works.

julia> win = GtkWindow("My window")

Have the macros and -Leaf been removed without updating the docs?

Method to get current range of a GtkRange/GtkScale?

https://developer.gnome.org/gtk3/stable/GtkRange.html indicates that there is a gtk_range_set_range(GtkRange *range, gdouble min, gdouble max) method, but I cannot find a method to get the current range. Any ideas?

This comes up in ImageView; sometimes in the contrast GUI one wants to set the value of the white/black level beyond the range of the current image (esp. when dealing with movies). I can enter a new value into the edit box but G_.value(scale, val) then clamps the value to between the GtkScale's min/max. In the callback it would be nice to be able to say, "if the value exceeds the GtkScale's min/max, expand the range".

If need be, should we add additional state to the GtkScale type?

multiple inheritance

we are missing a lot of accessor methods due to the lack of multiple inheritance support in Julia. somehow we need to fake support for it

symbol could not be found gtk_combo_box_text_get_type

Looks like our system has gtk 2.10 installed. Is that too old?
I'm running 0.3 pre-release master/4e48d5b* on 64-bit linux.

julia> using Gtk
symbol could not be found gtk_combo_box_text_get_type (-1): /usr/lib64/libgtk-x11-2.0.so: undefined symbol: gtk_combo_box_text_get_type
ERROR: access to undefined reference
 in reload_path at loading.jl:144
 in _require at loading.jl:59
 in require at loading.jl:43
while loading /home/keithc/.julia/v0.3/Gtk/src/lists.jl, in expression starting on line 31
while loading /home/keithc/.julia/v0.3/Gtk/src/Gtk.jl, in expression starting on line 90

ERROR: error compiling init: could not load module libgtk-win32-2.0-0

I'm using Julia 0.1.2 c4b3649-WINNT-i686 (2013-03-08 11:45:11) on Windows 7.

julia> Pkg.add("Gtk")
MS-DOS style path detected: METADATA\Mongrel2\versions
Preferred POSIX equivalent is: METADATA/Mongrel2/versions
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
[snipped... there are a lot of those!]
MESSAGE: Installing Gtk v0.0.0
Cloning into 'Gtk'...
remote: Counting objects: 39, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 39 (delta 10), reused 31 (delta 2)
Receiving objects: 100% (39/39), 8.06 KiB, done.
Resolving deltas: 100% (10/10), done.
warning: LF will be replaced by CRLF in .gitmodules.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in REQUIRE.
The file will have its original line endings in your working directory.

julia> using Gtk
ERROR: error compiling init: could not load module libgtk-win32-2.0-0: The speci
fied module could not be found.

at C:\Users\marwick\AppData\Roaming\julia\packages\Gtk\src\Gtk.jl:185

julia>

Gtk breaks parsing

I have the following strange thing happening on a newly opened julia repl

julia> 1.0
1.0

julia> using Gtk

julia> 1.0
ERROR: invalid base 10 digit '.' in "1.0"

julia> 
julia> versioninfo(true)
Julia Version 0.3.0-prerelease+1641
Commit 7c323a6* (2014-02-19 07:54 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
  WORD_SIZE: 64
           Ubuntu 12.04.4 LTS
  uname: Linux 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64
Memory: 3.7394371032714844 GB (315.25 MB free)
Uptime: 179154.884129804 sec
Load Avg:  0.0571289  0.233887  0.332031
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz: 
       speed         user         nice          sys         idle          irq
#1  1600 MHz     229020 s       1633 s      83497 s   17023952 s          2 s
#2  3201 MHz     222362 s       2282 s      76053 s   17488158 s          0 s
#3  1600 MHz     225756 s       2230 s      68430 s   17516912 s          0 s
#4  1600 MHz     216804 s       2076 s      69294 s   17530583 s          0 s

  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm
Environment:
  TERM = screen
  XDG_SESSION_PATH = /org/freedesktop/DisplayManager/Session0
  XDG_SEAT_PATH = /org/freedesktop/DisplayManager/Seat0
  DEFAULTS_PATH = /usr/share/gconf/ubuntu.default.path
  PATH = /home/elinume/bin:/home/elinume/Qt5.1.0/5.1.0/gcc_64/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/quest/bin:/opt/quest/sbin:/opt/elx/bin
  MANDATORY_PATH = /usr/share/gconf/ubuntu.mandatory.path
  HOME = /home/elinume

Package Directory: /home/elinume/.julia/v0.3
2 required packages:
 - Gtk                           0.5.0
 - ImageView                     0.0.13+            master
12 additional packages:
 - BinDeps                       0.2.12
 - Cairo                         0.2.12
 - Cartesian                     0.1.3
 - Color                         0.2.8
 - Images                        0.2.28
 - IniFile                       0.2.2
 - SIUnits                       0.0.1
 - TexExtensions                 0.0.1
 - Tk                            0.2.11
 - URIParser                     0.0.1
 - Winston                       0.9.0
 - Zlib                          0.1.5

Latest version of Gtk.jl (0.5.0) under Windows is inoperative

After removing and installing the latest Gtk.jl (0.5.0) I get the following error:

julia> using Gtk
ERROR: could not load module libgtk-3-0: %1 is not a valid Win32 application.

while loading I:\mingw64\msys\home\hwp.julia\Gtk\src\gtktypes.jl, in expression starting on line 6
while loading I:\mingw64\msys\home\hwp.julia\Gtk\src\Gtk.jl, in expression starting on line 83

I run under Windows7 64-bit using a recent build of Julia.

Here's what I find in my .julia directory:

$ find . -name 'libgtk*' -print
./WinRPM/deps/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libgtk-win32-2.0-0.dll

Accessor with GtkTextIter do not work

I am trying to use GtkTextIter and get an error when using functions from the GAccessor module. The following example

using Gtk.ShortNames
textBuf = Gtk.TextBuffer()
textView = Gtk.TextView(textBuf) 
win = Gtk.Window("Test",1024,768)
Gtk.push!(win,textView)
Gtk.showall(win)
Gtk.setproperty!(textBuf,:text,"hamster")
b,itBegin,itEnd = Gtk._.selection_bounds(textBuf)

gives an error

ERROR: access to undefined reference

Broken floats

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0 (2013-11-16 23:44 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/                   |  x86_64-apple-darwin12.5.0

julia> Pkg.status()
Required packages:
 - GLFW                          0.0.0
 - GZip                          0.2.10
 - Gtk                           0.5.0
 - Homebrew                      0.0.4
 - ImageView                     0.0.13
 - Winston                       0.9.0
 - ZipFile                       0.2.0
Additional packages:
 - BinDeps                       0.2.12
 - Cairo                         0.2.12
 - Cartesian                     0.1.3
 - Color                         0.2.8
 - Images                        0.2.28
 - IniFile                       0.2.2
 - SIUnits                       0.0.1
 - TexExtensions                 0.0.1
 - Tk                            0.2.11
 - URIParser                     0.0.1
 - Zlib                          0.1.5

julia> using Gtk
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!

julia> 1.0
ERROR: syntax: invalid numeric constant 1.0

julia>

I suppose this is not normal at all...

Missing filename in error message for callback

using Gtk.ShortNames
b = Button("Press me!")
win = Window(b, "Callbacks")
signal_connect(b, "clicked") do widget
    println("clicked")
    println(obj)  # oops, should have written widget here
end
julia> include("/tmp/cb.jl")
0x0000000000000029

julia> clicked
ERROR: obj not defined
 in anonymous at no file:6
 in GClosureMarshal at /home/tim/.julia/Gtk/src/events.jl:117

problem with builder

Hello,

i try to use GtkBuilder, but some of my .glade files don't display.
In https://gist.github.com/lobingera/9722861 you find an example with two different .glade files and the julia and python programm to run it (there is not further functionalities, only opening/closing the window).

The example with 2 buttons and a image works (in both), the example with the menu bar doesn't in julia.

Naming of constants

As discussed previously, there is some reason to drop the GDK_ in front of the constants in gdk.jl. However, this runs into trouble with constants such as 2BUTTON_PRESS. Either we could leave the GDK_ intact, or just support the DOUBLE_BUTTON_PRESS forms.

Tests fail with precompiled Gtk

If I have Base.require("Gtk") as my sole statement in my userimg.jl, then

julia> include("tests.jl")

(julia:19260): GLib-GObject-CRITICAL **: g_closure_set_marshal: assertion 'marshal != NULL' failed
Segmentation fault (core dumped)

Some simple things succeed (e.g., the Frame test near the beginning of tests.jl). Likewise, the test4d.jl example in the gtk branch of ImageView almost works (meaning, the window shows on the screen), but then I get a similar message and a segfault.

GtkSourceView

I have successfully wrapped (parts of) GtkSourceView, which is a third-party library for Gtk. What is your feeling. Should this be part of Gtk.jl?

If yes we would need a way to extend the generator script for different libraries.
If no the question is where to put this.

My feeling is to wrap "high-quality" third-party libraries within Gtk.jl (optionally).

Gtk Main Loop

I tried to run a Gtk.jl from a script and the application closes immediately. Is there some way to apply to the Gtk main loop and let the application running? I am not sure if this can actually be solved in Gtk.jl or if julia has to be extended for this.

Usecase: double click on script.jl -> start Gtk application

Indexing

Not sure if there has already been a decision/discussion about this. Should we have 1-based or 0-based index in Gtk.jl. It seems to be that most code translates from 1-based indexing to 0-based indexing. IMO the right thing. But whats with the automatic getters/setters. These currently use 0-based indexing so that this is a little inconsistent

(By indexing I mean something like the columnId in TreeModels)

using Gtk.Window simply for drawing

Hello,

i'm trying to use Gtk.jl for simple drawing, actually i'd like to do a few things with cairo (which might lead to an extension of Cairo.jl, later).

The straightforward thing:
lobi@maroon:~$ julia/julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.2.0-prerelease+3134
/ |_'|||__'| | Commit 888ca27 2013-08-09 16:25:25 UTC
|__/ | i686-linux-gnu

julia> using Gtk

julia> win = Gtk.Window("300",500,400)
Window

julia> import Base: convert

julia> c = Gtk.Canvas(win)

(julia:6900): Gtk-WARNING **: Attempting to add a widget with type GtkDrawingArea to a GtkWindow, but as a GtkBin subclass a GtkWindow can only contain one widget at a time; it already contains a widget of type GtkDrawingArea
Canvas

?

Is there a simply way to get the 'handle' to the GtkDrawingArea?

Composite Controls

I have been discussing with @timholy on the mailing list that it would be very useful to define new composite controls that behave like GtkWidgets.

My proposal is that we define the following interface

abstract GtkUserControlI
convert(::Type{Ptr{Gtk.GObject}},w::GtkUserControlI) = convert(Ptr{Gtk.GObject},w.root)
convert(::Type{Gtk.GtkWidgetI},w::GtkUserControlI) = convert(Gtk.GtkWidgetI,w.root)
show(w::GtkUserControlI) = show(w.root)

The interface makes the assumtion that the user constrol has a root widget and basically passes this root widget to the underlying C functions. The interface can be used as follows

type MyWidget <: GtkUserControlI
    root::GtkButton
    MyWidget(label) = new(GtkButton(label))
end

b = MyWidget("rrr")
w = GtkWindow("fff")
push!(w,b)

I may be missing some more wrapper functions but the above does work.Thoughts?

major API changes

I'm am planning MAJOR api breakage for the next release version. Please tag existing packages as Gtk 0.1 0.6- to avoid upgrade headaches (including Winston.jl, ImageView.jl, ???)

  1. constructors will be removed from all types, replaced by a function new which can be more easily generalized to construct anything in an inheritence-friendly way
  2. the ...I suffix will be removed from interface types
  3. the types that currently are referenced without an ...I suffix will be renamed to ...Leaf and will NOT be exported
  4. abstract types will always be uniquely instantiated inside the GLib module (but @GType will generate the corresponding import GLib.newtype)
  5. leaf types will always be (non-uniquely) instantiated inside the client library
  6. deprecated getindex! alias to getproperty will be removed
  7. any other deprecated stuff will also be removed (original enum declarations, exporting stuff not prefixed with G from using Gtk, like Window and Canvas)
  8. I'm thinking of no longer automatically calling show in push! (ref. #30). Alternatives including calling showall in display, or just making the user aware of these functions

selectors

https://developer.gnome.org/gtk3/stable/SelectorWidgets.html

GtkColorChooser — Interface implemented by widgets for choosing colors
GtkColorButton — A button to launch a color selection dialog
GtkColorChooserWidget — A widget for choosing colors
GtkColorChooserDialog — A dialog for choosing colors
GtkFileChooser — File chooser interface used by GtkFileChooserWidget and GtkFileChooserDialog
GtkFileChooserButton — A button to launch a file selection dialog
GtkFileChooserDialog — A file chooser dialog, suitable for "File/Open" or "File/Save" commands
GtkFileChooserWidget — File chooser widget that can be embedded in other widgets
GtkFileFilter — A filter for selecting a file subset
GtkFontChooser — Interface implemented by widgets displaying fonts
GtkFontButton — A button to launch a font chooser dialog
GtkFontChooserWidget — A widget for selecting fonts
GtkFontChooserDialog — A dialog for selecting fonts
GtkPlacesSidebar — Sidebar that displays frequently-used places in the file system

WIP: GtkToolbar

Just a small notice that I begun wrapping GtkToolbar. PR will follow.

update for new timers interface in Julia 0.3

As discussed in JuliaLang/julia#7140, the Timer interface has changed: timer callbacks only take one argument (the timer object), rather than two (the timer object and an integer status).

It looks like gtk_doevent will need another method to be added:

gtk_doevent(timer) = gtk_doevent()

Don't remove the old one, to maintain Julia 0.2 compatibility.

issues with Gtk version 2

I know I need to update, but haven't. I find there are issues with the following:

  • in lists.jl the GtkCell bits
  • in theme.jl the CSS stuff

Those are easy enough for me to deal with, but the issue I don't know how to work around is in Gtk.jl where the cache is deserialized. I get:

ERROR: GtkCellViewI not defined
 in eval at no file
 in anonymous at /Users/verzani/.julia/Gtk/src/Gtk.jl:149
 in reload_path at loading.jl:146
 in _require at loading.jl:59
 in require at loading.jl:43
while loading /Users/verzani/.julia/Gtk/src/Gtk.jl, in expression starting on line 148

time to upgrade?

Issue with current master

I am trying out current master using

Pkg.checkout("Gtk")

on windows. When I set in deps/ext.jl the gtk version to 2 I get the following error while loading the package.

julia> using Gtk.ShortNames
symbol could not be found gtk_grid_get_type (-1): The specified procedure could
not be found.

ERROR: access to undefined reference
while loading D:\Users\tknopp\.julia\Gtk\src\layout.jl, in expression starting on line 22
while loading D:\Users\tknopp\.julia\Gtk\src\Gtk.jl, in expression starting on line 85

Need method to force expose event for GtkCanvas

Copy-paste the following into the REPL:

using Gtk.ShortNames, Cairo
c1 = Canvas()
c1[:expand] = true
c2 = Canvas()
c2[:expand] = true
g = Grid()
g[1,1] = c1
g[1,2] = c2
win = Window(g, "Testing")
c1.draw = obj -> begin
    ctx = getgc(c1)
    set_source_rgb(ctx, 1.0, 0, 0)
    paint(ctx)
end
showall(win)

Then copy-paste the following:

c2.draw = obj -> begin
    ctx = getgc(c2)
    set_source_rgb(ctx, 0, 0, 1.0)
    paint(ctx)
end

Neither reveal(c2) nor showall(win) causes the second Canvas to redraw; the only method I've found is to resize the window.

I made a stab at this with the following:

immutable GdkEventExpose <: GdkEventI
    event_type::Enum
    gdk_window::Ptr{Void}
    send_event::Uint8
    area::GdkRectangle
    region::Ptr{Void}
    count::Cint
end

function expose(c::GtkCanvas, count::Integer = 0)
    rect = allocation(c)
    cairorect = ccall((:cairo_region_create_rectangle,Cairo._jl_libcairo), Ptr{Void},
                      (Ptr{Void},), pointer_from_objref(rect))
    evt = GdkEventExpose(GdkEventType.EXPOSE, gdk_window(c), true, rect, cairorect, count)
    @show evt
    ccall((:gtk_widget_send_expose,libgtk),Cint,
          (Ptr{GObject},Ptr{Void}),c,pointer_from_objref(evt))
#     ccall((:cairo_region_destroy,Cairo._jl_libcairo), Void,
#           (Ptr{Void},), cairorect)
end

and got the curious message that this wasn't a GDK_EXPOSE event.

Document constants

I'm not sure if this is due to changes in Gtk.jl, or if it's a platform problem, but the following isn't working for me:

win = @Window("Test window")
add_events(win, Gtk.GdkEventType.SCROLL)
signal_connect(win, :scroll_event) do widget, event
    println("Scrolling")
end

This is coming up in my attempt to update the gtk branch of ImageView, which uses

add_events(c, Gtk.GdkEventType.SCROLL | Gtk.GdkEventType.KEY_PRESS | Gtk.GdkEventType.LEAVE_NOTIFY)

and for which none of these events are being caught.

What's the proper way to set the value of a GtkScale object?

I suspect this is an example for the GAcccessor interface, but currently this doesn't work:

julia> using Gtk

julia> s = GtkScale(false, 1:11)
GtkScale(orientation=GTK_ORIENTATION_HORIZONTAL, name="", parent, width-request=-1, height-request=-1, visible=FALSE, sensitive=TRUE, app-paintable=FALSE, can-focus=TRUE, has-focus=FALSE, is-focus=FALSE, can-default=FALSE, has-default=FALSE, receives-default=FALSE, composite-child=FALSE, style, events=0, no-show-all=FALSE, has-tooltip=FALSE, tooltip-markup=NULL, tooltip-text=NULL, window, double-buffered=TRUE, halign=GTK_ALIGN_FILL, valign=GTK_ALIGN_FILL, margin-left=0, margin-right=0, margin-top=0, margin-bottom=0, margin=0, hexpand=FALSE, vexpand=FALSE, hexpand-set=FALSE, vexpand-set=FALSE, expand=FALSE, adjustment, inverted=FALSE, lower-stepper-sensitivity=GTK_SENSITIVITY_AUTO, upper-stepper-sensitivity=GTK_SENSITIVITY_AUTO, show-fill-level=FALSE, restrict-to-fill-level=TRUE, fill-level=179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, round-digits=0, digits=0, draw-value=TRUE, has-origin=TRUE, value-pos=GTK_POS_TOP, )

julia> Gtk._.value(s)
1.0

julia> Gtk._.value(s, 7.0)
ERROR: no method value(GtkScale, Float64)

julia> set_value(scale::GtkScale,val::Real) = ccall((:gtk_range_set_value,Gtk.libgtk),Void,(Ptr{Gtk.GObject},Float64),scale,float64(val))set_value (generic function with 1 method)

julia> set_value(s, 7.0)

julia> Gtk._.value(s)
7.0

GList

Currently there is only an implementation of GSList. Should GList be an independent implementation file or should both go into one file and share certain function implementations by using an abstract list interface?

ERROR: assertion failed: name === g_type_name(gtyp)

Getting the following:

julia> using Gtk
ERROR: assertion failed: name === g_type_name(gtyp)
 in reload_path at loading.jl:144
 in _require at loading.jl:59
 in require at loading.jl:43
while loading /Users/kfischer/.julia/Gtk/src/displays.jl, in expression starting on line 147
while loading /Users/kfischer/.julia/Gtk/src/Gtk.jl, in expression starting on line 95

Orientation of GtkGrid and GtkTable

GtkGrid uses matrix-ordering [row, col] (as Julia's Matrixes are referenced), whereas GtkTable uses cartesian-ordering [x, y]. This makes the two opposite each other. Assuming that consistency is desired, which do you want to choose?

dialog boxes

https://developer.gnome.org/gtk3/stable/GtkDialog.html

                           +----GtkWindow
                                 +----GtkDialog
                                       +----GtkAboutDialog
                                       +----GtkAppChooserDialog
                                       +----GtkColorChooserDialog
                                       +----GtkColorSelectionDialog
                                       +----GtkFileChooserDialog
                                       +----GtkFontChooserDialog
                                       +----GtkFontSelectionDialog
                                       +----GtkMessageDialog
                                       +----GtkPageSetupUnixDialog
                                       +----GtkPrintUnixDialog
                                       +----GtkRecentChooserDialog

Non-Blocking UI

This might be a little unspecific but how are your experiences with creating non-blocking UI with Gtk.jl. Due to the lack of threads this seems to be a serious issue. I have played a little with @async but it still blocks the UI for several seconds when I do Pkg.available(). Using @Spawn seems to be better but the code gets a lot more complicated as one has to move data between processes.

Maybe its time to push Julia to get an interpreter lock potentially enabling thread support,

Inheriting from GObject: Take 2

I am currently in the process of wrapping GtkSourceView and found one issue that seems to be not covered yet from Gtk.jl.

In order to get the completion framework of GtkSourceView to work one needs to implement the interface GtkSourceCompletionProvider. Looking at the example code this seems to be done in C by defining some functions, a struct and calling

G_DEFINE_TYPE_WITH_CODE (TestProvider,
         test_provider,
         G_TYPE_OBJECT,
         G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROVIDER,
                    test_provider_iface_init))

see https://git.gnome.org/browse/gtksourceview/tree/tests/test-completion.c.

In the Python bindings this seems to be covered by inheritance and calling a registering method

GObject.type_register(TestProvider)

see https://git.gnome.org/browse/gtksourceview/tree/tests/test-completion.py

Would be great if we also could address this use case.

Keyboard Shortcuts (Mac)

This is more an informational issue that should be closed once this is properly documented:

On OSX, the "command" key modifier "seems" (not found a docu for that) to be GdkModifierType.META. Maybe we should extend that enum with GdkModifierType.COMMAND that maps to META on OSX and CONTROL otherwise.

While getting the keybinding (accelerator) working is not that hard in the end finding the right documentation was harder than I thought.

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.