Discussion:
how to set the width of a guidata dialog?
Josh Burnett
2011-09-13 01:04:28 UTC
Permalink
I'm using guidata to create a dialog that has a FileSaveItem, among
other things. Unfortunately, the default width of the resulting
dialog is pretty skinny, and the user will most likely end up resizing
the dialog every time. Is there a way of specifying a width for the
dialog? I've been digging through the source but haven't found this
property yet.

Here's the relevant portion of my code:
#==============================
import guidata
import guidata.dataset.datatypes as dt
import guidata.dataset.dataitems as di

class ComConfig(dt.DataSet):
"""Terminal Configuration"""
comPort = di.ChoiceItem("COM Port",
("COM 1", "COM 2", "COM 3"))
title = di.StringItem("Window title", help="Text added to the
window title to differentiate multiple terminals")

g1 = dt.BeginGroup("Log file details")
enabled = dt.ValueProp(False)
writeLogFile = di.BoolItem("Log output",
default=False).set_prop("display", store=enabled)
logTimestamps = di.BoolItem("Log timestamps",
default=False).set_prop("display", active=enabled).set_pos(col=1)
logFile = di.FileSaveItem("Log file", formats=['txt','log'],
default='log.txt').set_prop("display",
active=enabled)
_g1 = dt.EndGroup("Log file details")
#==============================

I've just started using guidata and guiqwt and am very impressed.
guidata in particular is going to save me a lot of work! Thanks so
much.

Josh

Loading...