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" +\ |
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 |
80 |
# GTK Specifics |
# GTK Specifics |
81 |
################################################################ |
################################################################ |
82 |
|
|
83 |
|
self.app = getApp() |
84 |
|
|
85 |
# |
# |
86 |
# SplashScreen |
# SplashScreen |
87 |
# |
# |
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 |
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 |
# |
# |
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 |
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() |
|