Re: [Vala] Button not visible



Additionally, it's a good idea to start your app from the console to see
Gtk/GLib assertions.

If you do so using your first code, you will see something like this:

Gtk-WARNING **: Attempting to add a widget with type GtkButton 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 GtkButton

So you have to add a "layout" or "container" widget to your window, e.g.
Gtk.Box, and add your buttons to this container.

See https://valadoc.org/gtk+-3.0/Gtk.Box.html




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]