[Twilight GUI] TWGui (fwd)

Stelios Xanthakis sxanth at ceid.upatras.gr
Tue Oct 19 04:31:24 EEST 2004


The patch:

diff -ur twgui-0.6.old/wrap_tkinter.py twgui-0.6.new/wrap_tkinter.py
--- twgui-0.6.old/wrap_tkinter.py    2004-10-15 09:04:18.000000000 +0200
+++ twgui-0.6.new/wrap_tkinter.py    2004-10-18 16:16:06.000000000 +0200
@@ -16,7 +16,9 @@
 import string
 
 havePIL = True
-try: import PIL
+try:
+    import PIL
+    import Image,ImageTk
 except ImportError: havePIL = False
 
 #
@@ -182,8 +184,8 @@
     if not havePIL:
         self.img0 = Tkinter.PhotoImage (file=img)
     else: # untested...
-        im = PIL.Image.open (img)
-        self.img0 = PIL.ImageTk.PhotoImage (im)
+        im = Image.open (img)
+        self.img0 = ImageTk.PhotoImage (im)
     self.this ['image'] = self.img0
 
 #
diff -ur twgui-0.6.old/wrap_wxpython.py twgui-0.6.new/wrap_wxpython.py
--- twgui-0.6.old/wrap_wxpython.py    2004-10-16 04:34:09.000000000 +0200
+++ twgui-0.6.new/wrap_wxpython.py    2004-10-18 16:12:17.000000000 +0200
@@ -200,13 +200,13 @@
                 font = font [:i]
             else:
                 nm = self.this.GetFont ().GetPointSize ()
-            self.this.SetFont (wx.Font (nm, wx.SWISS, wx.NORMAL, 
wx.NORMAL, face=font))
+            self.this.SetFont (wx.Font (nm, wx.SWISS, wx.NORMAL, 
wx.NORMAL, faceName=font))
         if dims [0] and dims [1]:
             if dims [0]: gx = self.this.GetCharWidth () * dims [0]
             else: gx = -1
             if dims [1]: gy = self.this.GetCharHeight () * dims [1]
             else: gy = -1
-            self.this.SetMinSize ((gx, gy))
+            self.this.SetSizeHints (minW=gx, minH=gy)
     self.set_editable (editable)
     # available to code
     def get_text (self):
@@ -544,7 +544,7 @@
 
 class Window (___wxsheet___):
     def start_construction (self):
-        self.win = wx.Frame (None)
+        self.win = wx.Frame (None,-1,"")
         ___wxsheet___.start_construction (self)
     def end_construction (self):
         ___wxsheet___.end_construction (self)




More information about the twg-devel mailing list