WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-02-2015, 07:57 AM
sbilleter sbilleter is offline
Member
 
Join Date: Mar 2015
Posts: 3
vizdlg inside a vizinfo

Is it possible to integrate a AskDialog into an InfoPanel ?

It seems that it is possible to add a vizdlg.Panel as a simple part of the InfoPanel
(Custom GUI Layout of the Vizard documentation). And as the AdkDialog is inheritating from the Dialog and then the Panel, it should be possible, but for the moment, my InfoPanel is just empty

Can you help me ?

it would be much easier than recreating the Askdialog inside the InfoPanel.
Thanks.

Stéphane
Reply With Quote
  #2  
Old 12-04-2015, 10:53 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
Yes, here's an example:

Code:
import viz
import vizinfo
import vizdlg
import viztask

viz.go()

dojo = viz.addChild('dojo.osgb')

info = vizinfo.InfoPanel('An InfoPanel with Dialog')
info.addSeparator()

options = [('Option 1'),('Option 2')]
dialog = vizdlg.AskDialog(options=options, title='Ask Dialog')
info.addItem(dialog)

def showdialog():
    while True:
        dialog.selection = 0
        yield dialog.show()

        if dialog.accepted:
            print 'accepted', options[dialog.selection]
        else:
            print 'cancelled'

        yield viztask.waitTime(1)

viztask.schedule(showdialog())
Reply With Quote
Reply

Tags
vizdlg, vizinfo

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Draw order of vizinfo Panel mape2k Vizard 2 10-08-2015 02:59 PM
vizinfo, vizdlg related questions mape2k Vizard 4 07-27-2015 03:46 AM
check user input using vizinfo panel armo Vizard 0 01-22-2015 02:05 AM
Vizinfo box: help with aligning text Woosuk Jang Vizard 4 07-15-2010 04:01 PM
Modifying Vizinfo to Support Re-parenting Tip Gladsomebeast Vizard 0 12-16-2008 05:34 PM


All times are GMT -7. The time now is 06:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC