@m_adam thank you for your answer from the code, it similar to what i already try, but this way looks like not a perfect solution. actually after read most c4d gui sdk and write some examples, i think maybe c4d should update gui model? sometimes it not flexible. just my personal thoughts, don't mind : ) expect python 3.x and pyside2 coming : )
M
Best posts made by mike
-
RE: QuickTabCustomGui.GetData() is None
-
GeUserarea crash when Redraw() in Message()
hi,
i write a GUI and use mouse left to refresh GeUserarea , mouse right stop refresh. Unfortunately, when click mouser left, it crash. Somebody can tell me what I did wrong ? this is my code.
Hope your help!import c4d from c4d import gui class MyArea(gui.GeUserArea): def __init__(self) : self.leftclick = False def GetMinSize(self) : return (600, 500) def DrawMsg(self,x1, y1, x2, y2, msg): self.DrawSetPen( c4d.Vector(.21) ) self.DrawRectangle(x1, y1, x2, y2) def Message(self, msg, result): if msg.GetId(): if self.leftclick: self.Redraw() return c4d.gui.GeUserArea.Message(self, msg, result) def InputEvent(self, msg) : if msg[c4d.BFM_INPUT_DEVICE] == c4d.BFM_INPUT_MOUSE: if msg[c4d.BFM_INPUT_CHANNEL] == c4d.BFM_INPUT_MOUSELEFT: self.leftclick = True if msg[c4d.BFM_INPUT_CHANNEL] == c4d.BFM_INPUT_MOUSERIGHT: self.leftclick = False return True class Dialog(gui.GeDialog): def __init__(self, area) : self.area = area def CreateLayout(self) : self.AddUserArea(10010, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT) self.AttachUserArea(self.area, 10010) return True def main(): area = MyArea() MyDialog = Dialog(area) MyDialog.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE) if __name__ == "__main__": main()