Font Dialog not working on Mac
hwg <[email protected]> Mon, 11 Apr 2011 19:12:52 -0700 (PDT)
| Newsgroups | gmane.comp.python.pythoncard |
|---|---|
| Message-ID | <[email protected]> |
--===============1640453783027875831==
Content-Type: multipart/alternative; boundary="0-1093512289-1302574372=:13048"
--0-1093512289-1302574372=:13048
Content-Type: text/plain; charset=us-ascii
On Mac it seems the FontDialog does not work properly. When you try to open the
font dialog, it flashes on the screen for a split second (in the lower right
corner), then disappears.
The same code run in Windows works fine.
The code is pasted below. Any help would be appreciated.
-hwg
--------------------------------------
# fontDialog.py
from PythonCard import model, dialog
class MainWindow(model.Background):
def on_btnColor_mouseClick(self, event):
a = dialog.colorDialog(self).color
self.components.txtTyping.foregroundColor = a
event.target.backgroundColor = a
def on_btnFont_mouseClick(self, event):
a = dialog.fontDialog(self, event.target.font)
self.components.txtTyping.font = a.font
event.target.font = a.font
app = model.Application(MainWindow)
app.MainLoop()
#fontDialog.rsrc.py
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u'Standard Template with File->Exit menu',
'size':(400, 300),
'menubar': {'type':'MenuBar',
'menus': [
{'type':'Menu',
'name':'menuFile',
'label':'&File',
'items': [
{'type':'MenuItem',
'name':'menuFileExit',
'label':'E&xit',
'command':'exit',
},
]
},
]
},
'components': [
{'type':'Button',
'name':'btnColor',
'position':(316, 10),
'label':u'Color...',
},
{'type':'Button',
'name':'btnFont',
'position':(10, 10),
'label':u'Font...',
},
{'type':'TextArea',
'name':'txtTyping',
'position':(10, 32),
'size':(381, 231),
},
] # end components
} # end background
] # end backgrounds
} }
--0-1093512289-1302574372=:13048
Content-Type: text/html; charset=us-ascii
<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">On Mac it seems the FontDialog does not work properly. When you try to open the font dialog, it flashes on the screen for a split second (in the lower right corner), then disappears.<br><br>The same code run in Windows works fine.<br><br>The code is pasted below. Any help would be appreciated.<br><br>-<span style="font-family: arial,helvetica,sans-serif;"> </span>hwg<br><br><br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">--------------------------------------</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,
sans-serif;"># fontDialog.py</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;">from PythonCard import model, dialog</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">class MainWindow(model.Background):</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> def on_btnColor_mouseClick(self, event):</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> a = dialog.colorDialog(self).color</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;
"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> self.components.txtTyping.foregroundColor =
a</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> event.target.backgroundColor = a</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> def on_btnFont_mouseClick(self, event):</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> a = dialog.fontDialog(self, event.target.font)</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family
: Courier New,courier,monaco,monospace,sans-serif;"> self.components.txtTyping.font = a.font</span><br style="font-family:
Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> event.target.font = a.font</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">app = model.Application(MainWindow)</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">app.MainLoop()</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style=
"font-family: Courier New,courier,monaco,monospace,sans-serif;">#fontDialog.rsrc.py</span><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">{'application':{'type':'Application',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'name':'Template',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'backgrounds': [</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> {'type':'Background',</span><br style="font-fa
mily: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"> 'name':'bgTemplate',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'title':u'Standard Template with File->Exit menu',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'size':(400, 300),</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courie
r New,courier,monaco,monospace,sans-serif;"> 'menubar': {'type':'MenuBar',</span><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'menus': [</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> {'type':'Menu',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'name':'menuFile',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,mo
naco,monospace,sans-serif;"> 'label':'&File',</span><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'items': [</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> {'type':'MenuItem',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'name':'menuFileExit',</span><br style="font-family:
Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"> 'label':'E&xit',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'command':'exit',</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><s
pan style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> ]</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> ]</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
'components': [</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">{'type':'Button', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'name':'btnColor', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'position':(316, 10), </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'label':u'Color...', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-
serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">{'type':'Button', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'name':'btnFont', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'position':(10, 10), </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'label':u'Font...', </
span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">{'type':'TextArea', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'name':'txtTyping', </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'position':(10, 32), </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style
="font-family: Courier New,courier,monaco,monospace,sans-serif;"> 'size':(381, 231), </span><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">] # end components</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">} # end background</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">] # end backgrounds</span><br style="font-family: Courier New,courier,monaco,mo
nospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">} }</span><br><div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"><div style="font-family: times,serif; font-size: 12pt;"><br>
</div></div>
</div></body></html>
--0-1093512289-1302574372=:13048--
--===============1640453783027875831==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
--===============1640453783027875831==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Pythoncard-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--===============1640453783027875831==--