|
Post by bigbass on Apr 6, 2019 8:15:12 GMT 1
valadoc.org/gtk+-3.0/Gtk.FileChooserDialog.htmlEven though that is vala code It has an excellent explanation of why we need the gtk_dialog_run to get the signal And now its very clear Why there was a problem with the signal it has nothing to do With HUG it is The way it has to be done But anyway its good that This is documented clearly With those two links And a few demos in this thread one more link people.gnome.org/~ryanl/gtk/html/GtkFileChooserDialog.htmlsome code cleanup and introduced a new command name ALIAS gtk_dialog_run TO GETSIGNALINCLUDE hug.bac
GTK$= HUGLIB$("gtk")
IMPORT "gtk_dialog_run(long)" FROM GTK$ TYPE int ALIAS gtk_dialog_run TO GETSIGNAL
win = WINDOW("WINDOW",200,200)
'======================== SUB FILE_DIALOG() '======================== LOCAL File_name$ PRINT "you got to the call back FILE_DIALOG()"
My_filedialog = FILEDIALOG("File Open demo","Open",200,200,0) SHOW(My_filedialog)
'--- its clearer to say what it does and that is to get the signal IF GETSIGNAL(My_filedialog ) == GTK_RESPONSE_ACCEPT THEN PRINT "GETSIGNAL test the sent signal " PRINT "The low level Open button was pressed " file_name$ = GRAB$(My_filedialog) PRINT file_name$ HIDE(My_filedialog) END IF END SUB
My_button = BUTTON("Open",70,30) ATTACH(win,My_button,20,20) CALLBACK(My_button,FILE_DIALOG)
DISPLAY
terminal output
|
|