|
So I'm creating a text editor, and want the ability to load a file into a specific tab. Now, the tab factory example shows how to communicate between a primary app window and the tab factory via the |
Answered by
zekefast
Jan 4, 2026
Replies: 1 comment 7 replies
|
@Cyncrovee Let me rephrase to see whether I understood what you want to do correctly. Let's say you have tabs 1, 2 (current), 3. You want to press Ctrl+O and you want to make sure it calls |
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Cyncrovee I would do it something like that https://github.com/zekefast/relm4-tabbed-load-file-example
It supports two shortcuts
<Ctrl> + Oand<Ctrl> + <Shift> + O.<Ctrl> + O- opens files in new tabs and allows for multiples files selection<Ctrl> + <Shift> + O- opens file in currently selected tab. It allows to open only single file.Shortcuts send two distinct messages
Msg::OpenFileDialogandMsg::OpenFileInPlaceDialogwhich opensOpenDialogMultiorOpenDialog. Each dialog once files or file selected forward two distinct eventMsg::OpenFilesorMsg::OpenFileInPlace. That's how app opens files in new tabs or replacesgtk::TextBufferin active (i.e. selected) tab.In order to replace