/[gnue]/gnue-forms/src/uidrivers/gtk2/UIdriver.py
ViewVC logotype

Diff of /gnue-forms/src/uidrivers/gtk2/UIdriver.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by siesel, Tue May 20 00:06:35 2003 UTC revision 1.26 by siesel, Mon Aug 4 15:37:30 2003 UTC
# Line 35  pygtk.require('2.0') Line 35  pygtk.require('2.0')
35  import gtk  import gtk
36  import pango  import pango
37    
 __gtk_mainloop = None  
   
38  ## check if we really imported gtk 2.0  ## check if we really imported gtk 2.0
39  if not hasattr(gtk,"keysyms"):  if not hasattr(gtk,"keysyms"):
40    print _("Import error: You need pygtk 2.0 to use the gtk2 user" +\    print _("Import error: You need pygtk 2.0 to use the gtk2 user" +\
# Line 55  from gnue.forms.GFForm import * Line 53  from gnue.forms.GFForm import *
53    
54  from gnue.forms.uidrivers._commonGuiToolkit import UIdriver as commonToolkit  from gnue.forms.uidrivers._commonGuiToolkit import UIdriver as commonToolkit
55    
56  #from gnue.forms.uidrivers.gtk2.GFApp import *  from gnue.forms.uidrivers.gtk2.GFApp import *
57  from gnue.forms.uidrivers.gtk2.SplashScreen import *  from gnue.forms.uidrivers.gtk2.SplashScreen import *
58  from gnue.forms.uidrivers.gtk2.widgets._base  import *  from gnue.forms.uidrivers.gtk2.widgets._base  import *
59  from gnue.forms.uidrivers.gtk2.common import PANGO_SCALE  from gnue.forms.uidrivers.gtk2.common import PANGO_SCALE
# Line 82  class GFUserInterface(commonToolkit.GFUs Line 80  class GFUserInterface(commonToolkit.GFUs
80      # GTK Specifics      # GTK Specifics
81      ################################################################      ################################################################
82    
83        self.app = getApp()
84        
85      #      #
86      # SplashScreen      # SplashScreen
87      #      #
# Line 155  class GFUserInterface(commonToolkit.GFUs Line 155  class GFUserInterface(commonToolkit.GFUs
155      if exitApp:      if exitApp:
156        for child in self._children:        for child in self._children:
157          child.mainWindow.destroy()          child.mainWindow.destroy()
158        gtk.main_quit()        self.app.quit()
159    
160    def _beep(self):    def _beep(self):
161      pass      pass
# Line 171  class GFUserInterface(commonToolkit.GFUs Line 171  class GFUserInterface(commonToolkit.GFUs
171    # mainLoop    # mainLoop
172    #    #
173    # The primary loop of the user interface.  Called once the UI is    # The primary loop of the user interface.  Called once the UI is
174    # fully activated    # fully activated (multiple loops are simulated by GFApp)
175    #    #
176    def mainLoop(self):    def mainLoop(self):
177      global __gtk_mainloop      self.app.mainLoop()
       
     try:  
       if __gtk_mainloop==None:  
         __gtk_mainloop= 1  
         gtk.main()  
     except:  
       __gtk_mainloop = 1  
       gtk.main()  
178    
179    
180    #    #
# Line 192  class GFUserInterface(commonToolkit.GFUs Line 184  class GFUserInterface(commonToolkit.GFUs
184    # a line of text    # a line of text
185    #    #
186    def formAlert(self, event):    def formAlert(self, event):
187      #wxBell()      ui = self._gfObjToUIWidget[event._form]
188      #ui = self._gfObjToUIWidget[event._form]      ui.statusBar1.push(ui.statusBar1.get_context_id("tip"),unicode(event.data))
     #ui.statusBar.SetStatusText(event.data,0)  
     self.statusBar1.push(self.statusBar1.get_context_id("tip"),str(event.data))  
   
189    
190    #    #
191    # Called whenever forms goes into a "wait" state in which user cannot    # Called whenever forms goes into a "wait" state in which user cannot
# Line 255  class GFUserInterface(commonToolkit.GFUs Line 244  class GFUserInterface(commonToolkit.GFUs
244    
245      else:      else:
246        GDebug.printMesg(5,'Unable to open clipboard for write')        GDebug.printMesg(5,'Unable to open clipboard for write')
   
   
   #############################################################################  
   #  
   # Internal Event Processors  
   #  
   # Processes the events from the widget set  
   #  
   
   
   
   #  
   # closeTrap  
   #  
   # intercepts the applications closure and generates an event to the form requesting  
   # closure.  Allows the form to control closure.  If the form approves it'll send  
   # back an event closing the application  
   #`  
   def closeTrap(self,event):  
     if event.CanVeto():  
       self.dispatchEvent('requestEXIT',_form=self._form)  
     else:  
       event.object.Destroy()  

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26