Hi I want to change bgcolor and other things but I do not know how to do that…
self.newWindow = base.openWindow(props=wp, gsg = None)
it does not work. I’m sure I’m missing something. Can you tell me what? thanks.
setBackgroundColor should be a method of ShowBase, not of GraphicsWindow. Can you try self.setBackgroundColor(…) (if self is a ShowBase’s instance)?
works perfectly rdb =D
but look, I still do not understand how self.newWindow could be treated as if it was base (ShowBase()). For instance, how to listen for mouse events? or how to load models just in self.newWindow? it is a bit confusing for me now… only the default window responds to base.accept("").
newWindow is not a ShowBase, and cannot be treated like one. But to listen for events, you only need to inherit from DirectObject (which ShowBase does, but any of your own classes can too). However, you can’t make the window inherit from DirectObject, so you can’t use newWindow.accept(). But you can use self.accept() if your own class inherits from DirectObject.
Sometimes people use base.accept() instead of self.accept() as a convenient shortcut to avoid inheriting from DirectObject.
Thank you for trying to help me… =D
but I can’t solve my problem (facepalm), both base.accept and self.accept work only in the default window, I’m writing a new camera control and I can’t get any key pressed or mouse click in newWindow.
Oh, that’s different. To generate button events for the new window, you need to create a new MouseWatcher and ButtonThrower for that window. Here’s a thread that illustrates doing this.
exactly what I needed. MouseWatcher and ButtonThrower were what I missed. I thank you David. =D