gdxapp4d/gdxapp4d-lib-imxmi/src/main/java/love/distributedrebirth/imxmi/lang/ImButtonˣᴹᴵ.java

42 lines
830 B
Java
Raw Normal View History

2022-02-07 13:29:23 +00:00
package love.distributedrebirth.imxmi.lang;
2022-02-07 22:38:44 +00:00
import imgui.ImGui;
2022-02-07 14:30:07 +00:00
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
2022-08-24 15:33:39 +00:00
@BãßBȍőnAuthorInfoʸᴰ(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
2022-02-07 22:38:44 +00:00
public class ImButtonˣᴹᴵ extends AbstractImComponentˣᴹᴵ {
private String label;
private Runnable callback;
public ImButtonˣᴹᴵ() {
}
public ImButtonˣᴹᴵ(String label) {
setLabel(label);
}
@Override
public void renderComponent() {
if (ImGui.button(label) && callback != null) {
callback.run();
}
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Runnable getCallback() {
return callback;
}
public void setCallback(Runnable callback) {
this.callback = callback;
}
2022-02-07 13:29:23 +00:00
}