0 Members and 2 Guests are viewing this topic.
Is this project still active or is it dead? (It looks sooooo cool! )
Has this taken advantage of callbacks yet, given that Axe now has variable function calls? All modern GUI designs these days are callback-based because it makes the programming simple and minimal.
Dilog("Are you sure?",LMYes,LMNo)
This would create a dialog with the text "Are you sure?" and when the "Yes" button is clicked, calls the label MYes and when "No" or cancel is clicked, calls the label MNo. This is just an example implementation, but I wonder if its similar?
gint result = gtk_dialog_run (GTK_DIALOG (dialog));switch (result) { case GTK_RESPONSE_ACCEPT: do_application_specific_something (); break; default: do_nothing_since_dialog_was_cancelled (); break; }gtk_widget_destroy (dialog);
dialog = gtk.MessageDialog(self, 0, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, "Are you sure you want to exit?") dialog.format_secondary_text( "We don't want you to lose any data.") response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: gtk.main_quit() elif response == gtk.RESPONSE_NO: print "Not exiting."
*********************************** Hello world! [X] ************************************ +--------+ ** | Button | ** +--------+ ***********************************
import gtkclass PyApp(gtk.Window): def __init__(self): super(PyApp, self).__init__() self.set_title("Hello world!") self.set_size_request(250, 200) self.set_position(gtk.WIN_POS_CENTER) self.connect("destroy", gtk.main_quit) self.fixed = gtk.Fixed() self.add(self.fixed) button = gtk.Button("Button") button.set_size_request(80, 35) button.connect("clicked", self.on_clicked) # There's the callback! :) self.fixed.put(button, 50, 50) self.set_tooltip_text("Window widget") button.set_tooltip_text("Button widget") self.show_all() def on_clicked(self, widget): # This handle the event dialog = gtk.MessageDialog(self, 0, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, "Are you sure you want to exit?") dialog.format_secondary_text( "We don't want you to lose any data.") response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: gtk.main_quit() elif response == gtk.RESPONSE_NO: print "Not exiting."PyApp()gtk.main()
AddButton(A,1,2)While Z!=15getKey->ZIf Z=1Y+1->YEnd. etc...If Z=19 .or whatever ENTER isDlgBox("Hello world!")End
uh...you lost me.