milsko-node/lib/widgets/window.ts
2026-05-04 11:38:58 -07:00

82 lines
1.9 KiB
TypeScript

import { NativeClasses } from "../milsko";
import { Widget } from "../widget";
import { MwSizeHints } from "../structs";
import { WidgetOptions, Pixmap } from "../types";
export class Window extends Widget {
constructor(options: WidgetOptions) {
super(NativeClasses.Window, options);
}
public setTitle(value: string): this {
return this.setString("Stitle", value);
}
get title(): string {
return this.getString("Stitle");
}
set title(value: string) {
this.setString("Stitle", value);
}
public setMain(value: boolean): this {
return this.setInteger("Imain", +value);
}
get main(): boolean {
return this.getInteger("Imain") != 0;
}
set main(value: boolean) {
this.setInteger("Imain", +value);
}
public setIconPixmap(value: Pixmap): this {
return this.setVoid("ViconPixmap", value);
}
get iconPixmap(): Pixmap {
return this.getVoid("ViconPixmap") as Pixmap;
}
set iconPixmap(value: Pixmap) {
this.setVoid("ViconPixmap", value);
}
public setSizeHints(value: MwSizeHints): this {
return this.setVoid("VsizeHints", value);
}
get sizeHints(): MwSizeHints {
return this.getVoid("VsizeHints") as MwSizeHints;
}
set sizeHints(value: MwSizeHints) {
this.setVoid("VsizeHints", value);
}
public setHasBorder(value: boolean): this {
return this.setInteger("IhasBorder", +value);
}
get hasBorder(): boolean {
return this.getInteger("IhasBorder") != 0;
}
set hasBorder(value: boolean) {
this.setInteger("IhasBorder", +value);
}
public setInverted(value: boolean): this {
return this.setInteger("Iinverted", +value);
}
get inverted(): boolean {
return this.getInteger("Iinverted") != 0;
}
set inverted(value: boolean) {
this.setInteger("Iinverted", +value);
}
}