Kha icon indicating copy to clipboard operation
Kha copied to clipboard

Need help with window(s) managing system

Open R3D9477 opened this issue 8 years ago • 10 comments

Hi. I need some help with managing of the window(s).

For example:

  1. Get/Set properties of window:
    • window's title
    • window's size (native)
    • window's position (native)
    • maximize/minimize window (native)
    • make fullscreen (native)
    • set/unset borderless (native)
    • set/unset topmost (native)
  2. Handle events:
    • on size changed (native)
    • on position changed (native)
    • on window maximized/minimized (native)
    • on window closed
  3. Multiwindows (native?):
    • make an additional window(s) and manage it
    • move window to specific display
  4. Cursor:
    • hide cursor
    • set a custom cursor

In kha-api I found a several intresting classes and methods, but I can't find more detailed information about them:

I can only get/set size of current (main) window's by System.windowHeight, System.windowWidth, System.changeResolution (by I'm no sure, that is the correct way).

Maybe somebody have an ideas/information how to use these and how to manage needed parameters?

(an similar topic on Kha's forum) Thanks.

R3D9477 avatar Apr 06 '17 07:04 R3D9477

For 3) you can take a look at the provided sample:

  • https://github.com/Kode/Kha/tree/master/Tests/MultiWindow

To move a window to a specific display, use WindowOptions.targetDisplay. WindowOptions.Mode lets you set Windowed / Borderless / Fullscreen mode. This currently only works at initialization time.

sh-dave avatar Apr 06 '17 07:04 sh-dave

@sh-dave Awesome! Many thanks. Also can I set window mode "Top Most"? I can't find this or similar property.

R3D9477 avatar Apr 06 '17 07:04 R3D9477

Currently not, but pull requests are always welcome :wink: Also, not all properties are actually implemented on all targets. I did most of the multiwindow code and only implemented what i actually needed at work (windows+opengl for development; linux for release later). So multiwindow probably won't work for like windows + directx. Also not implemented for macos at all.

sh-dave avatar Apr 06 '17 08:04 sh-dave

@sh-dave Well, thank you for the update. For Linux your Multiwindow system also works fine! I opened enhancement issue for "Top Most" parameter. What about window's events? Is it supported?

R3D9477 avatar Apr 06 '17 08:04 R3D9477

Sorry, never tried it as i don't have a use case for that. The app i build only creates static sized, borderless windows and never lets the user change anything. But it might be a good idea to ask some questions in the irc (especially in the evening as more people are on), as i'm not sure how many ppl actually watch the issues here.

sh-dave avatar Apr 06 '17 08:04 sh-dave

@sh-dave ok, Thanks for the help! I keep this issue to be opened

R3D9477 avatar Apr 06 '17 08:04 R3D9477

@r3d9u11 Are you trying to use native windows that can move anywhere or do you want to open up dialogs contained within the main Kha windows?

dresch86 avatar May 12 '17 20:05 dresch86

@primesoftware I'm trying to use several native windows, like in this sample

R3D9477 avatar Jun 28 '17 07:06 R3D9477

This is mostly done...

RobDangerous avatar Jul 16 '18 11:07 RobDangerous

Noooo, not fully done yet.

RobDangerous avatar Jul 23 '18 11:07 RobDangerous