Hello to all of you,
I’m playing with python and bethon, and while writing the code I stucked on a (maybe trivial) problem.
When I show a modal window it is possible to pass the focus to the main window on the background, giving a modal window unfocused ontop and the main windows focused on the background. I want to avoid this, so I looked for window flags and I found that there’s a B_AVOID_FOCUS flag available, great!
But here’s the problem:
let’s take my self.Flags() is 537395200
if i address a
self.SetFlags(B_AVOID_FOCUS)
It works but I erase all previous settings not only focus setting
(btw B_AVOID_FOCUS is 8192)
but I cannot do a
self.SetFlags(self.Flags()|B_AVOID_FOCUS) → Note: “|” is a bitwise operand
I cannot even do a:
x=537395200|8192
self.SetFlags(x)
the main window is created this way:
BWindow.init(self, frame, ‘Title of window’, B_TITLED_WINDOW, B_WILL_DRAW)
the modal window is created this way:
BWindow.init(self, self.kWindowFrame, self.kWindowName, B_MODAL_WINDOW, B_NOT_RESIZABLE|B_WILL_DRAW)
B_WILL_DRAW is 536870912
looking at init process i thought I could do a self.SetFlags(B_WILL_DRAW), but returns the same error, so I start thinking that the flags are a subset of the actual value of self.Flags()
the error it returns:
BWindow.error: (-2147483643, ‘Invalid Argument’)
Does anyone know some workaround or has any suggestion or see where I’m wrong?
Thank you