[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lgi / gtk : how to create a button from stock ?
- From: Pavel Holejsovsky <pavel.holejsovsky@...>
- Date: Sun, 8 Jul 2012 20:19:21 +0000 (UTC)
Hi Laurent,
On Sat, 07 Jul 2012 10:46:55 -0700, Laurent FAILLIE wrote:
> Well,
>
> What I would like to have : here is with label button but I would like
> the same construct with stock ones. :
>
> local window = Gtk.Window {
> has_resize_grip = true,
> window_position = Gtk.WindowPosition.MOUSE, -- put it under to
> mouse child = Gtk.Button{
> label = "_hello",
> use_underline = true,
> on_clicked = function () print("Click !") end
> },
> on_destroy = Gtk.main_quit
> }
>
http://developer.gnome.org/gtk3/stable/GtkButton.html#GtkButton--use-stock
So something like this should work:
local window = Gtk.Window {
has_resize_grip = true,
window_position = 'MOUSE',
child = Gtk.Button {
label = "gtk-yes", -- or Gtk.STOCK_YES, if you like
use_stock = true,
on_clicked = function () print("Click !") end
},
on_destroy = Gtk.main_quit
}
HTH,
pavel