Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

what is the correct way to delete the Custom Widgets #553

Closed
yadmtr opened this issue Jan 9, 2021 · 0 comments
Closed

what is the correct way to delete the Custom Widgets #553

yadmtr opened this issue Jan 9, 2021 · 0 comments

Comments

@yadmtr
Copy link

yadmtr commented Jan 9, 2021

Please tell me what is the correct way to delete the Custom Widgets?

mutable struct ComposedWidget <: Gtk.GtkBox
    handle::Ptr{Gtk.GObject}
    btn # handle to child
    tv # handle to child

    function ComposedWidget(label)
        vbox = GtkBox(:v)
        btn = GtkButton(label)
        tv = GtkTextView()
        push!(vbox,btn,tv)
        set_gtk_property!(vbox,:expand,tv,true)
        set_gtk_property!(vbox,:spacing,10)
        w = new(vbox.handle, btn, tv)
        return Gtk.gobject_move_ref(w, vbox)
    end
end

c = ComposedWidget("My Button")
win = GtkWindow("Composed Widget",400,200)
push!(win, c)
showall(win)
@yadmtr yadmtr closed this as completed Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant