@TCH: Viszont, meg tudnád mutatni, hogy hogy néz ki Pythonban és C++-ban a következő cucc?
#include <gtkmm.h>
using namespace std;
using namespace Gtk;
using namespace Glib;
Window* window;
Button* button;
Entry* entry;
void on_button_clicked() {
entry->set_text("kecske");
}
int main(int argc, char* argv[]) {
Main app(argc, argv);
RefPtr<Builder> builder = Builder::create_from_file("kecske.glade");
builder->get_widget("window", window);
builder->get_widget("entry", entry);
builder->get_widget("button", button);
button->signal_clicked().connect(sigc::ptr_fun(on_button_clicked));
app.run(*window);
return 0;
}
import gtk
class kecske:
def on_window_destroy(self, widget, data=None):
gtk.main_quit()
#end on_window_destroy
def on_button_clicked(self, widget, data=None):
self.entry.set_text('kecske')
#end on_button_clicked
def __init__(self):
self.builder = gtk.Builder()
self.builder.add_from_file('kecske.glade')
self.window = self.builder.get_object('window')
self.entry = self.builder.get_object('entry')
self.builder.connect_signals(self)
#end __init__
#end class
if __name__ == '__main__':
app = kecske()
app.window.show()
gtk.main()
#end if |