MouseFunc right;
} MouseConfig;
-void win_window(char* name, void (*errfn)(char*));
-void win_dialog(char* name, void (*errfn)(char*));
+void win_window(char* name, bool isdialog, void (*errfn)(char*));
void win_loop(void);
void win_settext(WinRegion id, char* text);
void win_setlinenums(bool enable);
void onmouseleft(WinRegion id, bool pressed, size_t row, size_t col);
void onmousemiddle(WinRegion id, bool pressed, size_t row, size_t col);
void onmouseright(WinRegion id, bool pressed, size_t row, size_t col);
-bool update_needed(void);
-
Regions[EDIT].clrcsr = config_get_int(ClrEditCsr);
}
-void win_window(char* name, void (*errfn)(char*)) {
+void win_window(char* name, bool isdialog, void (*errfn)(char*)) {
win_init(errfn);
- x11_window(name, config_get_int(WinWidth), config_get_int(WinHeight));
-}
-
-void win_dialog(char* name, void (*errfn)(char*)) {
- win_init(errfn);
- x11_dialog(name, config_get_int(WinWidth), config_get_int(WinHeight));
+ if (isdialog)
+ x11_dialog(name, config_get_int(WinWidth), config_get_int(WinHeight));
+ else
+ x11_window(name, config_get_int(WinWidth), config_get_int(WinHeight));
}
static void win_update(int xfd, void* data) {
x11_deinit();
}
-bool update_needed(void) {
- return false;
-}
-
/* Main Routine
*****************************************************************************/
static void onerror(char* msg) {
char* title = getenv("PICKTITLE");
load_choices();
if (vec_size(&Choices) > 1) {
- win_dialog("pick", onerror);
+ win_dialog("pick", true, onerror);
win_setkeys(Bindings, NULL);
win_settext(STATUS, (title ? title : "pick"));
if (argc >= 2) {
static void initialize(void) {
ShellCmd[0] = "/bin/sh";
- win_window("edit", ondiagmsg);
+ win_window("edit", false, ondiagmsg);
XDisplay = XOpenDisplay(NULL);
win_setkeys(Bindings, NULL);
}
quit();
}
-bool update_needed(void) {
- return false;
-}
-
static void oninput(Rune rune) {
if (win_getregion() == EDIT && pty_active())
pty_send_rune(rune);
if (!ShellCmd[0]) ShellCmd[0] = "/bin/sh";
/* create the window */
- win_window("tide", ondiagmsg);
+ win_window("tide", false, ondiagmsg);
/* open all but the last file in new instances */
for (argc--, argv++; argc > 1; argc--, argv++) {