M🇷
Size: a a a
M🇷
D
M🇷
M🇷
g
using Gtk;
public class SyncSample : Window {
Button button;
Label label;
Entry userEntry;
Entry computerEntry;
HeaderBar titlebar;
MenuButton menuButton;
private int counter;
void window_setups(){
this.title = "Fast Type";
this.window_position = WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);
this.decorated = true;
this.set_titlebar(titlebar);
set_default_size (300, 20);
}
void widget_constructors(){
button = new Button.with_label("+");
label = new Label("0");
userEntry = new Entry();
computerEntry = new Entry();
titlebar = new HeaderBar();
menuButton = new MenuButton();
}
void widgets_setups(){
button.clicked.connect (() => {
label.set_text(@"$(counter++)");
});
button.tooltip_text = "Increment";
menuButton.add(new Image.from_icon_name("document-open",IconSize.BUTTON));
titlebar.show_close_button = true;
titlebar.pack_end(menuButton);
var hbox = new Box (Orientation.VERTICAL, 5);
hbox.homogeneous = true;
hbox.add (button);
hbox.add (label);
hbox.add (userEntry);
hbox.add (computerEntry);
add (hbox);
}
public SyncSample () {
widget_constructors();
window_setups();
widgets_setups();
}
public static int main (string[] args) {
Gtk.init (ref args);
var window = new SyncSample ();
window.show_all ();
Gtk.main ();
return 0;
}
}
M🇷
g
g
D
g
g
g
M🇷
M🇷
M🇷