Help with clicks in multiple windows.

Started by znepb, Sep 03, 2018, 10:54 PM

Previous topic - Next topic

znepb

Hey guys! Can I have some help with making the computer receive clicks on the host frame and the app frame? Thanks!

KingofGamesYami

Can you clarify what you mean by "host frame" and "app frame"?  Neither of those things exist in vanilla CC:Tweaked.
I'm a ComputerCraft veteran with over 3k posts on the old ComputerCraft Forum.  I'm mostly inactive in CC having moved on to bigger, more interesting projects but still contribute to the community.

osmarks


znepb

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.

KingofGamesYami

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, and I have a lovely graphic here.
I'm a ComputerCraft veteran with over 3k posts on the old ComputerCraft Forum.  I'm mostly inactive in CC having moved on to bigger, more interesting projects but still contribute to the community.

osmarks

I think you can use the Window API CraftOS has to help with mouse_clicky stuff.

KingofGamesYami

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.
I'm a ComputerCraft veteran with over 3k posts on the old ComputerCraft Forum.  I'm mostly inactive in CC having moved on to bigger, more interesting projects but still contribute to the community.