mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-21 16:44:07 +00:00
file chooser
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@408 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -75,7 +75,27 @@ static void files_activate(MwWidget handle, void* user, void* call) {
|
||||
|
||||
(void)user;
|
||||
|
||||
scan(handle->parent, fc->sorted_entries[index - 1]->name);
|
||||
if(fc->sorted_entries[index - 1]->type == MwDIRECTORY_DIRECTORY) {
|
||||
char* p = MwDirectoryJoin(fc->path, fc->sorted_entries[index - 1]->name);
|
||||
|
||||
scan(handle->parent, p);
|
||||
|
||||
free(p);
|
||||
} else {
|
||||
okay(fc->okay, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void addr_up_activate(MwWidget handle, void* user, void* call) {
|
||||
filechooser_t* fc = handle->parent->opaque;
|
||||
char* p = MwDirectoryJoin(fc->path, "..");
|
||||
|
||||
(void)user;
|
||||
(void)call;
|
||||
|
||||
scan(handle->parent, p);
|
||||
|
||||
free(p);
|
||||
}
|
||||
|
||||
static void layout(MwWidget handle) {
|
||||
@@ -178,6 +198,7 @@ static void layout(MwWidget handle) {
|
||||
fc->addr_up = MwVaCreateWidget(MwButtonClass, "addr_up", handle, wx, wy, ww, wh,
|
||||
MwNpixmap, fc->up,
|
||||
NULL);
|
||||
MwAddUserHandler(fc->addr_up, MwNactivateHandler, addr_up_activate, NULL);
|
||||
} else {
|
||||
MwVaApply(fc->addr_up,
|
||||
MwNx, wx,
|
||||
|
||||
Reference in New Issue
Block a user