1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
<!DOCTYPE HTML PUBLIC "-//Netscape_Microsoft//DTD HTML 3.0//EN">
<HTML>
<!-- This file generated using the Python HTMLgen module. -->
<HEAD>
<META NAME="GENERATOR" CONTENT="HTMLgen 1.1">
<TITLE>PmwComboBoxDialog.py</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<PRE>
<FONT COLOR="#DD0000"># Not Based on iwidgets version.</FONT>
import Pmw
<STRONG><FONT COLOR="#CC6600">class ComboBoxDialog</FONT></STRONG>(Pmw.Dialog):
<FONT COLOR="#DD0000"># Dialog window with simple combobox.</FONT>
<FONT COLOR="#DD0000"># Dialog window displaying a list and entry field and requesting</FONT>
<FONT COLOR="#DD0000"># the user to make a selection or enter a value</FONT>
<STRONG> def __init__</STRONG>(self, parent = None, **kw):
<FONT COLOR="#DD0000"># Define the megawidget options.</FONT>
INITOPT = Pmw.INITOPT
optiondefs = (
(<FONT COLOR="#009900">'borderx'</FONT>, 10, INITOPT),
(<FONT COLOR="#009900">'bordery'</FONT>, 10, INITOPT),
)
self.defineoptions(kw, optiondefs)
<FONT COLOR="#DD0000"># Initialise the base class (after defining the options).</FONT>
Pmw.Dialog.__init__(self, parent)
<FONT COLOR="#DD0000"># Create the components.</FONT>
interior = self.interior()
aliases = (
(<FONT COLOR="#009900">'listbox'</FONT>, <FONT COLOR="#009900">'combobox_listbox'</FONT>),
(<FONT COLOR="#009900">'scrolledlist'</FONT>, <FONT COLOR="#009900">'combobox_scrolledlist'</FONT>),
(<FONT COLOR="#009900">'entry'</FONT>, <FONT COLOR="#009900">'combobox_entry'</FONT>),
(<FONT COLOR="#009900">'label'</FONT>, <FONT COLOR="#009900">'combobox_label'</FONT>),
)
self._combobox = self.createcomponent(<FONT COLOR="#009900">'combobox'</FONT>,
aliases, None,
Pmw.ComboBox, (interior,),
scrolledlist_dblclickcommand = self.invoke,
dropdown = 0,
)
self._combobox.pack(side=<FONT COLOR="#009900">'top'</FONT>, expand=<FONT COLOR="#009900">'true'</FONT>, fill=<FONT COLOR="#009900">'both'</FONT>,
padx = self[<FONT COLOR="#009900">'borderx'</FONT>], pady = self[<FONT COLOR="#009900">'bordery'</FONT>])
<FONT COLOR="#DD0000"># Check keywords and initialise options.</FONT>
self.initialiseoptions(ComboBoxDialog)
Pmw.forwardmethods(ComboBoxDialog, Pmw.ComboBox, <FONT COLOR="#009900">'_combobox'</FONT>)
</PRE>
</BODY> </HTML>
|