Kha
Kha copied to clipboard
Need help with window(s) managing system
Hi. I need some help with managing of the window(s).
For example:
- 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)
- Handle events:
- on size changed (native)
- on position changed (native)
- on window maximized/minimized (native)
- on window closed
- Multiwindows (native?):
- make an additional window(s) and manage it
- move window to specific display
- 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:
- method System.init
- method System.initEx
- method System.notifyOnApplicationState
- method System.changeResolution
- method System.windowHeight
- method System.windowWidth
- SystemOptions
- Display
- Cursor
- WindowOptions
- WIndowModeOptions
- Mode
- Position
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.
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 Awesome! Many thanks. Also can I set window mode "Top Most"? I can't find this or similar property.
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 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?
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 ok, Thanks for the help! I keep this issue to be opened
@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?
@primesoftware I'm trying to use several native windows, like in this sample
This is mostly done...
Noooo, not fully done yet.