|
#1
|
|||
|
|||
Vizinfopanel automatic resize problem
Hi, I've ran into an issue with an infopanel in one of my projects. The default behavior of the infopanel is that it automatically resizes to the text or objects inside, which is fine for my application. However when I want to change one of the texts during the task, the panel doesn't automatically resize.
I've isolated the problem to this. The following code works, and the infobox is wrapped nicely around the new line. Code:
import viz, vizinfo viz.go() ip = vizinfo.InfoPanel('', icon=False, align=viz.ALIGN_CENTER) text = ip.addItem(viz.addText('hi'), fontSize=18, align=viz.ALIGN_CENTER_CENTER) def setMessage(): text.message('this is a looooooooong line') setMessage() Code:
import viz, vizinfo, vizact viz.go() ip = vizinfo.InfoPanel('', icon=False, align=viz.ALIGN_CENTER) text = ip.addItem(viz.addText('hi'), fontSize=18, align=viz.ALIGN_CENTER_CENTER) def setMessage(): text.message('this is a looooooooong line') vizact.onkeydown(' ', setMessage) |
#2
|
|||
|
|||
Thanks for the examples and good to know you already found workarounds. I will pass this along to the developers in case this is a bug.
|
#3
|
|||
|
|||
The following code adds a line to mark the panel as dirty and recompute the layout. Does this work the way you would expect?
Code:
import viz, vizinfo, vizact viz.go() ip = vizinfo.InfoPanel('', icon=False, align=viz.ALIGN_CENTER) text = ip.addItem(viz.addText('hi'), fontSize=18, align=viz.ALIGN_CENTER_CENTER) panel = ip.getPanel() def setMessage(): text.message('this is a looooooooong line') panel.dirtyLayout() vizact.onkeydown(' ', setMessage) |
#4
|
|||
|
|||
That works great, thanks!
|
#5
|
|||
|
|||
I can resize the window but the screen resolution keeps stucks at a max of 1280x1024. The resolution of the host is 1600x900 or 1920x1200 (=external monitor).I'll try your suggestions and give feedback..
|
#6
|
|||
|
|||
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cave Collision problem | TopazFrost | Vizard | 2 | 02-13-2014 02:34 PM |
The problem of adding two .ive models | hengshan.li | Vizard | 1 | 08-08-2011 12:04 AM |
Vizard problem | mizutani_jun | Vizard | 4 | 01-09-2011 03:39 PM |
problem with female animations | vmonkey | Vizard | 1 | 10-07-2005 10:36 AM |
PROBLEM: Picture-in-Picture breaks textures?!? | vcarlson | Vizard | 4 | 10-05-2004 04:22 PM |