ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: znepb on Sep 03, 2018, 10:54 PM

Title: Help with clicks in multiple windows.
Post by: znepb on Sep 03, 2018, 10:54 PM
Hey guys! Can I have some help with making the computer receive clicks on the host frame and the app frame? Thanks!
Title: Help with clicks in multiple windows.
Post by: KingofGamesYami on Sep 04, 2018, 02:39 AM
Can you clarify what you mean by "host frame" and "app frame"?  Neither of those things exist in vanilla CC:Tweaked.
Title: Help with clicks in multiple windows.
Post by: osmarks on Sep 04, 2018, 02:51 PM
Also, actually show your code?
Title: Help with clicks in multiple windows.
Post by: znepb on Sep 05, 2018, 09:45 PM
Quote from: KingofGamesYami on Sep 04, 2018, 02:39 AMCan you clarify what you mean by "host frame" and "app frame"?  Neither of those things exist in vanilla CC:Tweaked.

The host frame is the main application that is running with the topbar, and the app frame is whats running the app.

Quote from: osmarks on Sep 04, 2018, 02:51 PMAlso, actually show your code?

https://github.com/Marco-Soft/PantherR/issues/1 I need help with the OS/PantherR/System/Settings.lua, AppRunner.lua, and Desktop.lua.
Title: Help with clicks in multiple windows.
Post by: KingofGamesYami on Sep 06, 2018, 02:00 PM
Ah, in that case, the host frame should capture all user-interaction events and modify them before passing them to the app frame.

Otherwise, it will be ambiguous what the user actually intends to do.  In some cases, the events may not even be passed to the app frame (ex: typing in a search bar in the host frame)

To accomplish this you'll need to learn how to properly manage coroutines.  BombBloke has a brilliant guide here (http://www.computercraft.info/forums2/index.php?/topic/25670-bbs-guide-to-coroutines/), and I have a lovely graphic here (https://forums.computercraft.cc/index.php?topic=26.0).
Title: Help with clicks in multiple windows.
Post by: osmarks on Sep 06, 2018, 09:08 PM
I think you can use the Window API CraftOS has to help with mouse_clicky stuff.
Title: Help with clicks in multiple windows.
Post by: KingofGamesYami on Sep 06, 2018, 09:27 PM
The window API does not deal with events at all.  It would help reposition graphical output though.

The multishell API, on the other hand, does modify where events go and utilize(s) the window API to draw the appropriate program in the correct places.  However, it does not support a customized host frame.  It may be a good resource to look at, but will not accomplish what you want without modification.