Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Window cannot be replaced by another window via button.
- using GLib;
- using Gtk;
- public class AWE {
- public static int main (string [] args) {
- Gtk.init(ref args);
- new AWE();
- Gtk.main();
- return 0;
- }
- Gtk.Window main_window = new Gtk.Window();
- AWE () {
- X();
- main_window.set_default_size(200,200);
- main_window.set_position(Gtk.WindowPosition.CENTER);
- main_window.show_all();
- main_window.destroy.connect(Gtk.main_quit);
- }
- public void X () {
- main_window.title = "Test";
- var btn = new Gtk.Button.with_label("Click here");
- main_window.add(btn);
- btn.clicked.connect(() => {
- Z();
- });
- }
- public void Z () {
- var btn = new Gtk.Button.with_label("Click There");
- btn.clicked.connect(() => {
- X();
- });
- main_window.set_default(btn);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement