2022-09-29 16:28:05 +02:00
package io.gitlab.jfronny.inceptum.gtk ;
import ch.bailu.gtk.GTK ;
import ch.bailu.gtk.gio.ApplicationFlags ;
import ch.bailu.gtk.gtk.* ;
import ch.bailu.gtk.type.Str ;
import ch.bailu.gtk.type.Strs ;
2022-11-24 21:11:07 +01:00
import io.gitlab.jfronny.commons.ref.R ;
2022-09-29 16:28:05 +02:00
public class TestStart {
public static void main ( String [ ] args ) {
var app = new Application ( GtkMain . ID , ApplicationFlags . FLAGS_NONE ) ;
app . onActivate ( ( ) - > {
var button = Button . newWithLabelButton ( new Str ( " Test " ) ) ;
button . onClicked ( TestStart : : test ) ;
var window = new ApplicationWindow ( app ) ;
window . setDefaultSize ( 200 , 50 ) ;
2022-09-29 18:19:43 +02:00
window . setTitle ( new Str ( " Inceptum " ) ) ;
2022-09-29 16:28:05 +02:00
window . setChild ( button ) ;
window . show ( ) ;
GtkEnvBackend . INSTANCE . dialogParent = window ;
window . onCloseRequest ( ( ) - > {
GtkEnvBackend . INSTANCE . dialogParent = null ;
return GTK . FALSE ;
} ) ;
} ) ;
System . exit ( app . run ( args . length , new Strs ( args ) ) ) ;
}
private static void test ( ) {
GtkEnvBackend backend = GtkEnvBackend . INSTANCE ;
2022-09-29 17:53:49 +02:00
2022-11-04 17:02:24 +01:00
backend . getInput ( " Ae " , " IoU \ naee " , " Def " , R : : nop , R : : nop ) ;
2022-09-29 16:28:05 +02:00
// backend.showInfo("Some message", "Title");
// backend.showError("Yes!", "AAee");
// backend.showError("Nes!", new ArrayIndexOutOfBoundsException("Top 500 cheese"));
// backend.showOkCancel("Some Message\nYes!", "TitL", () -> backend.showInfo("Pressed OK", "OK"), () -> backend.showError("Pressed CANCEL", "CANCEL"));
// backend.getInput("This is a prompt", """
// These are some extremely interesting and detailed (hence the name) details!
// This is a second line, since these details
// are just THAT important!""", "Default", value -> backend.showInfo("Received " + value, "Input"), () -> backend.showInfo("Got no input :/", "Input"));
}
}