GUI keyboard shortcut without using keypressfcn
Mostrar comentarios más antiguos
Hello!
I want to create keyboard shortcuts for a GUI program, but it only appears inspector when I attempt to view callbacks, its .m file is not using callback handles to construct the GUI. The reason and solution HERE do not apply to my case. So the methods illustrated HERE are not working.
Is there a way I can create shortcuts without keypressfcn? Maybe by indexing the object tag?
Any help would be highly appreciated!
10 comentarios
Walter Roberson
el 22 de Ag. de 2022
Is this for guide or app designer?
Walter Roberson
el 23 de Ag. de 2022
Is there a way I can create shortcuts without keypressfcn
Not that I can think of, except in the sense that you can use WindowKeyPressFcn (entire figure) rather than KeyPressFcn (specific axes or specific control)
Bruno Luong
el 23 de Ag. de 2022
@Yukai Xu" but it only appears inspector when I attempt to view callbacks, its .m file is not using callback handles to construct the GUI."
I read it and must admit I don't not understand. I hope you know that you are free to change the callback function AND signature, include handles as input argument if you like.
Yukai Xu
el 24 de Ag. de 2022
Bruno Luong
el 24 de Ag. de 2022
I though you work with GUIDE.
Same here I never able to convert my GUI in AppDesigner. Too much features not convertible, too much speed issue, etc...
Walter Roberson
el 24 de Ag. de 2022
When you use Guide, you need to consider two different items.
The m file holds a couple of header functions, and then contains source code to implement the callbacks. The content of the callback implementation can be modified with any text editor, including outside of the control of Guide. Guide might be needed to connect the controls to the implementation when new functions are added.
The fig file is really a .mat file with a few special variables stored in it, including a figure() object. The graphics objects such as axes and uicontrol have various callback properties. When the callback is actie, what is really done is whatever is stored in the graphics object. Typically what is stored with the graphics object by Guide is a call that retrieves the gui handle object and calls into the function named by the m file name, passing in a character vector containing the name of the implementation function, and passing in the callback parameters, and the gui handles. But if you edit function names in the m file or especially if you rename the m file and fig file without going through Guide, then the m file and graphics object can get out of synchronization.
Occasionally, it can be necessary to examine the properties of the graphics object to see what callback properties are really stored there.
App Designer works a quite different way.
Yukai Xu
el 6 de Sept. de 2022
Bruno Luong
el 6 de Sept. de 2022
Can you just load the fig file in GUIDE and uncheck the option 'Generate FIG file only'?
Yukai Xu
el 6 de Sept. de 2022
Respuestas (0)
Categorías
Más información sobre Desktop en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!