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

Docs Polish and GObject Interface #75

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
18408d1
added set_menubar, native pointers
Clemapfel Nov 16, 2023
d80a8f8
fixed row_i index
Clemapfel Dec 11, 2023
555f979
native pointers working
Clemapfel Dec 11, 2023
d15ef9f
removed debug example
Clemapfel Dec 11, 2023
40e264d
tests passing
Clemapfel Feb 8, 2024
d49d8e1
Merge branch 'main' into mac-menubar-docs
Clemapfel Feb 8, 2024
c4609b4
Merge pull request #74 from Clemapfel/mac-menubar-docs
Clemapfel Feb 8, 2024
6a7a882
stashing before fixing no signal error message
Clemapfel Feb 8, 2024
4f16e9f
improved error message when a compound widgets toplevel does not have…
Clemapfel Feb 8, 2024
b5dc8c2
Merge pull request #76 from Clemapfel/mac-menubar-docs
Clemapfel Feb 8, 2024
2eca1b2
added scaling default value, #70
Clemapfel Feb 8, 2024
77d4a24
Added section on infinitely long animations #63
Clemapfel Feb 8, 2024
b7d7ed8
typo #61
Clemapfel Feb 8, 2024
62506e3
typo
Clemapfel Feb 8, 2024
002d730
fixed n digits conversion for enums #69
Clemapfel Feb 8, 2024
a4c59a4
added separator opacity argument
Clemapfel Feb 11, 2024
b72910a
doctests working
Clemapfel Feb 11, 2024
9a4a8b2
doctests passing
Clemapfel Feb 11, 2024
6758ee5
typo
Clemapfel Feb 11, 2024
0695e7d
added doctests
Clemapfel Feb 11, 2024
2a4ddb1
added isapprox for colors
Clemapfel Feb 11, 2024
0f9dd72
added doctests
Clemapfel Feb 11, 2024
c04035e
doctests working
Clemapfel Feb 11, 2024
b32cfe4
added doctests
Clemapfel Feb 11, 2024
06362da
restored 08_menus
Clemapfel Feb 11, 2024
65dfb2f
remove temp test
Clemapfel Feb 15, 2024
b1ad216
disable CI until mac issues is fixed
Clemapfel Feb 15, 2024
4ea70c4
doc tests passing
Clemapfel Feb 15, 2024
ded10c5
added warning about render area being disabled
Clemapfel Feb 15, 2024
c704687
up version
Clemapfel Feb 22, 2024
a137f6f
test passing
Clemapfel Feb 22, 2024
6a1f8f5
updated version
Clemapfel Feb 28, 2024
1b5c899
removed glmakie integration
Clemapfel Feb 28, 2024
a3518cd
Update 12_opengl_integration.md
Clemapfel Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Mousetrap"
uuid = "5deeb4b9-6e04-4da7-8b7f-c77fb1eae65e"
authors = ["C.Cords <[email protected]>"]
version = "0.3.1"
version = "0.3.2"

[deps]
BinaryBuilder = "12aac903-9f7c-5d81-afc2-d9565ea332ae"
Expand All @@ -18,7 +18,7 @@ libcxxwrap_julia_jll = "3eaa8342-bff7-56a5-9981-c04077f7cee7"
mousetrap_jll = "0e90efc8-2bbd-550f-bf3c-306a2edaaeef"

[compat]
CxxWrap = "0.14.0"
CxxWrap = "0.14, 0.15"
mousetrap_jll = "0.3.0"
GTK4_jll = "4.10"
Glib_jll = "2.76"
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,12 @@ add_render_task!(render_area, RenderTask(rectangle))

---

### Displaying a GLMakie Plot in a Mousetrap Window

```julia
using GLMakie, MousetrapMakie
canvas = GLMakieArea()
window = Mousetrap.Window()
set_child!(window, canvas) # can be used like any other widget

screen = create_glmakie_screen(canvas)
display(screen, scatter(rand(123)))
```
![](docs/src/assets/makie_scatter.png)

(**Note**: This feature is still experimental. See [here](https://github.com/Clemapfel/MousetrapMakie.jl) for more information)

---

## Supported Platforms

Since `v0.3.0`, Mousetrap is fully portable. All features are available for all 64-bit versions of Linux, FreeBSD, macOS, and Windows.

> **WARNING**: macOS systems with a newer architecture, such as the M1/M2 macs, seem to be causing an issue when using the `RenderArea` widget, forcing it to be disabled. Only this single widget is affected, see the [manual section on native rendering](http://clemens-cords.com/mousetrap/01_manual/09_native_rendering/) for more information.

> **Note**: Linux systems running Wayland may require additional configuration before the `RenderArea` widget becomes available. See [here](http://clemens-cords.com/mousetrap/01_manual/09_native_rendering/) for more information.

> **Note**: Ubuntu systems using proprietary NVIDIA drivers may encounter a crash on initialization, a fix is available [here](https://github.com/Clemapfel/Mousetrap.jl/issues/25#issuecomment-1731349366).
Expand Down
21 changes: 18 additions & 3 deletions docs/src/01_manual/01_installation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
```@meta
DocTestSetup = quote
using Mousetrap
function Window(app::Application)
out = Mousetrap.Window(app)
set_tick_callback!(out, out) do clock, self
close!(self)
return TICK_CALLBACK_RESULT_DISCONTINUE
end
return out
end
end
```

# Chapter 1: Installation & Workflow

In this chapter, we will learn:
Expand All @@ -9,10 +23,8 @@ In this chapter, we will learn:

## Installation


To install Mousetrap, in the REPL, press the `]` key, then


```julia
import Pkg;
begin
Expand Down Expand Up @@ -41,13 +53,16 @@ Installation may take a long time. Once installation is succesfull, `Mousetrap t

To create our first Mousetrap app, we create a Julia file `main.jl`, with the following contents:

```julia
```jldoctest; output = false
using Mousetrap
main() do app::Application
window = Window(app)
set_child!(window, Label("Hello World!"))
present!(window)
end

# output
0
```

To start our app, we navigate to the location of `main.jl` in our console, then execute:
Expand Down
22 changes: 20 additions & 2 deletions docs/src/01_manual/02_signals.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
```@meta
DocTestSetup = quote
using Mousetrap
function Window(app::Application)
out = Mousetrap.Window(app)
set_tick_callback!(out, out) do clock, self
close!(self)
return TICK_CALLBACK_RESULT_DISCONTINUE
end
return out
end
end
```

# Chapter 2: Signals

In this chapter, we will learn:
Expand Down Expand Up @@ -63,7 +77,7 @@ end

For example, to execute the example snippet above, we would create the following `main.jl` file:

```julia
```jldoctest; output = false
using Mousetrap
main() do app::Application
window = Window(app)
Expand All @@ -78,6 +92,8 @@ end
set_child!(window, button) # add the button to the window
present!(window)
end
# output
0
```

Then execute it from the console by calling `julia main.jl`
Expand Down Expand Up @@ -494,7 +510,7 @@ By blocking signals, we get the correct behavior of both buttons being triggered

To verify this is indeed the resulting behavior, we can use the following `main.jl`:

```julia
```jldoctest; output = false
using Mousetrap
main() do app::Application
window = Window(app)
Expand All @@ -521,6 +537,8 @@ main() do app::Application
set_child!(window, hbox(button_01, button_02))
present!(window)
end
# output
0
```

![](../assets/double_button_signal_blocking.png)
Expand Down
19 changes: 17 additions & 2 deletions docs/src/01_manual/03_actions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
```@meta
DocTestSetup = quote
using Mousetrap
function Window(app::Application)
out = Mousetrap.Window(app)
set_tick_callback!(out, out) do clock, self
close!(self)
return TICK_CALLBACK_RESULT_DISCONTINUE
end
return out
end
end
```

# Chapter 3: Actions

In this chapter, we will learn:
Expand Down Expand Up @@ -222,10 +236,9 @@ We need one more thing before we can trigger our action: an object that can rece

A complete `main.jl` file showing how to trigger an action using a shortcut is given here:

```julia
```jldoctest; output = false
using Mousetrap
main() do app::Application

# create a window
window = Window(app)

Expand All @@ -243,6 +256,8 @@ main() do app::Application
# show the window to the user
present!(window)
end
# output
0
```

Pressing "Control + M", we get:
Expand Down
Loading