Skip to content

menu#16

Merged
iqbaleff214 merged 2 commits intodevelopfrom
feature/14-menu
Mar 18, 2025
Merged

menu#16
iqbaleff214 merged 2 commits intodevelopfrom
feature/14-menu

Conversation

@iqbaleff214
Copy link
Copy Markdown
Member

@iqbaleff214 iqbaleff214 commented Mar 17, 2025

resolve #14.

image image image image

})
fileMenu.AddSeparator()
fileMenu.AddText("Save", keys.CmdOrCtrl("s"), func(_ *menu.CallbackData) {
runtime.EventsEmit(m.ctx, "menu:save")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kode runtime.EventsEmit(m.ctx, "...") ini ngirim event ke FE, nanti tinggal listen aja pakai window?.runtime?.EventsOn("...", callback)

<script>
    import {WriteFile} from "../wailsjs/go/filesystem/FileManager";
    import {MessageInfoDialog} from "../wailsjs/go/filesystem/Dialog";
    
    let currentActiveFilePath = $state('');
    let obfuscated = $state('');

    const saveFile = (path) => {
        WriteFile(path, obfuscated).then(() => {
            // do something if success
        }).catch((error: any) => {
            MessageInfoDialog('Error', error);
        });
    };

    onMount(() => {
        window?.runtime?.EventsOn("menu:save", () => saveFile(currentActiveFilePath));
    });
</script>

Copy link
Copy Markdown
Member Author

@iqbaleff214 iqbaleff214 Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kalau sudah merge tolong dibantu tambahin di sveltenya ya, bung @andikasujanadi, di hampir semua menu ada event emitnya

@iqbaleff214 iqbaleff214 self-assigned this Mar 17, 2025
@iqbaleff214 iqbaleff214 merged commit f860810 into develop Mar 18, 2025
1 check passed
@iqbaleff214 iqbaleff214 deleted the feature/14-menu branch March 18, 2025 06:28
@andikasujanadi
Copy link
Copy Markdown
Contributor

takut gwej @iqbaleff214

@iqbaleff214
Copy link
Copy Markdown
Member Author

sudah aku bantu update buat branch ui_improvement, @andikasujanadi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants