root/branch/k0p/umitInterfaceEditor/Main.py @ 1442

Revision 1442, 22.1 kB (checked in by kop-labs, 6 years ago)

Fixed at actions menu

Line 
1#!/usr/bin/env python
2# Copyright (C) 2005 Insecure.Com LLC.
3#
4# Author: Luis A. Bastiao Silva <luis.kop@gmail.com>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20
21from gettext import gettext as _
22
23import gtk
24
25#HIG
26
27from higwidgets.higwindows import HIGWindow, HIGMainWindow
28from higwidgets.higboxes import HIGVBox, HIGHBox, HIGSpacer,hig_box_space_holder
29from higwidgets.higexpanders import HIGExpander
30from higwidgets.higlabels import HIGSectionLabel, HIGEntryLabel
31from higwidgets.higscrollers import HIGScrolledWindow
32from higwidgets.higtextviewers import HIGTextView
33from higwidgets.higbuttons import HIGButton
34from higwidgets.higtables import HIGTable
35from higwidgets.higdialogs import HIGAlertDialog, HIGDialog
36from higwidgets.hignotebooks import HIGNotebook
37from higwidgets.higframe import HIGFrame
38import gobject
39from os.path import split, join
40
41from umitInterfaceEditor.Profile import ProfileEdit
42from umitInterfaceEditor.WizardEditor import WizardEdit
43from umitCore.Logging import log
44from umitCore.I18N import _
45#PWE project
46#from umitInterfaceEditor.PWOptions import PWOptions
47#from umitInterfaceEditor.Editor import Editor
48from umitInterfaceEditor.OptionManager import OptionList, OptionDisplay, OptionDisplayMainFrame
49#END
50from umitCore.Paths import Path
51#Path.set_umit_conf(join(split(__file__)[0], 'config', 'umit.conf'))
52
53profile_editor =  Path.profile_editor
54wizard =  Path.wizard
55
56from umitInterfaceEditor.Tools import ToolDesign, Proprieties
57
58from umitInterfaceEditor.Command import command_manager
59
60
61class umitInterfaceEditor(HIGMainWindow):
62    def __init__(self):
63        HIGMainWindow.__init__(self)
64        self._proprieties = None
65        self.profile_box = None 
66        self.wizard_box = None 
67        self._current_edit_mode = None 
68        self._tooldesign = None
69        self.profile_box_b = None 
70        self.wizard_box_b = None 
71        self.set_title(_('Umit Interface Editor - v0.1'))
72        self.set_size_request(800, 400)
73        self.set_position(gtk.WIN_POS_CENTER)
74        #self.maximize()
75        self.list_options_box = OptionList()
76        self.notebook = HIGNotebook()
77        self._proprieties = Proprieties()
78        self.create_profile_edit()
79        self.create_wizard_edit()
80        self.obj = self.profile_box
81        #Create Widgets
82        self.__create_widgets()
83        #Packing - Group of widgets 
84        self.__pack_widgets()   
85        self.__option_display()
86        self.edit_mode_opt = "Options"
87
88       
89        self.connect("delete_event", self._destroy)
90
91        self.opt_display.set_profile(self.profile_box)
92        self.opt_display.set_wizard(self.wizard_box)
93        self.profile_box.notebook.connect_after('need-save', self._update_menu_s)
94        self.wizard_box.notebook.connect_after('need-save', self._update_menu_s)
95        self.profile_box.notebook.connect_after('changed', self._update_menu)
96        self.wizard_box.notebook.connect_after('changed', self._update_menu)
97        self.opt_display.connect_after('need-save', self._update_menu_s)
98   
99    def _update_menu(self, actions, others, page):
100        obj = None 
101        if self.edit_mode_opt == "Profile":
102            obj = self.profile_box
103        elif self.edit_mode_opt == "Wizard":
104            obj = self.wizard_box
105        if obj == None:
106            return 
107        #Check if there is something selected:
108        current_page = obj.notebook.get_nth_page(obj.notebook.get_current_page())
109        if obj.notebook._old_select != None:
110            #Section is Selected
111            log.debug('Section is selected << updating toolbar')
112           
113            pass
114        elif current_page._old_selected != None:
115            #Item Selected
116            log.debug('Item is selected << updating toolbar')
117            pass
118       
119       
120   
121    def _update_menu_s(self, action, others, page):
122        log.debug('<<< Update Main menubar ')
123        save = self.main_action_group.get_action('Save')
124        if self.edit_mode_opt == "Profile":
125            log.debug('profile updating menubar save')
126            save.set_sensitive(self.profile_box.is_changed())
127        elif self.edit_mode_opt == "Wizard":
128            log.debug('wizard updating menubar save')
129            save.set_sensitive(self.wizard_box.is_changed())
130        elif self.edit_mode_opt == 'Options': 
131            log.debug('options updating menubar save')
132            save.set_sensitive(self.opt_display.is_changed())
133       
134           
135       
136        #
137       
138       
139    def _destroy(self, widget, event):
140        self.destroy()
141    def create_wizard_edit(self):
142        '''
143        create a profile area editing
144        and connect to Undo Redo Manager to update the buttons
145        '''
146        if self.wizard_box != None:
147            self.wizard_box.set_proprieties(self._proprieties)
148            #return
149        if self.wizard_box ==None :
150            self.wizard_box = WizardEdit(self.list_options_box.get_list_option())
151        #else:
152        #    self.profile_box.show_all()
153        #command_manager.connect_after('changed', self._update_undo_redo_cb)
154        self.wizard_box.set_notebook(self.notebook)
155       
156    def create_profile_edit(self):
157        '''
158        create a profile area editing
159        and connect to Undo Redo Manager to update the buttons
160        '''
161        if self.profile_box != None:
162            self.profile_box.set_proprieties(self._proprieties)
163            #return
164        if self.profile_box ==None :
165            self.profile_box = ProfileEdit(self.list_options_box.get_list_option())
166        #else:
167        #    self.profile_box.show_all()
168        command_manager.connect_after('changed', self._update_undo_redo_cb)
169        self.profile_box.set_notebook(self.notebook)
170    def _update_undo_redo_cb(self, action, other):
171        '''
172        Verify if exists undo and redo
173        and update the buttons on the toolbar/menubar
174        #DO:
175        - sensitive -> True/False
176        - Ajust tips
177        ####
178        '''
179       
180        can_undo = command_manager.can_undo() 
181        can_redo = command_manager.can_redo()
182        self.main_action_group.get_action('Undo').set_sensitive(can_undo)
183        self.main_action_group.get_action('Redo').set_sensitive(can_redo)
184        if can_undo:
185            self.main_action_group.get_action('Undo').tooltip = 'sss'
186            self.main_action_group.get_action('Undo').create_menu_item()
187    def __create_widgets(self):
188        """
189        Create widgets
190        """
191        self.main_vbox = gtk.VBox()
192        self.widgets = {}
193       
194        #UI Manager
195        self.__create_ui_manager()
196        #Table - contains menubar and toolbar
197       
198       
199        #Menubar
200        self.__create_menubar()
201        #Toolbar
202        self.__create_toolbar()
203
204        self.display_frame = HIGFrame()
205        self.display_frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
206        self.display_frame.set_border_width(6)
207       
208        self.hbox_edit = gtk.HBox()
209        self.hspacer = gtk.HPaned()
210        self.hspacer.set_border_width(0)
211        self.vbox_right = HIGVBox()
212        self.vbox_left = HIGVBox()
213       
214       
215       
216        self.edit_mode_exp = gtk.Expander(_('Edit Modes'))
217        self.edit_mode_box = self.create_edit_mode()
218
219
220
221
222        self.notebook.set_scrollable(True)
223        self.notebook.append_page(self.list_options_box, 
224                                  HIGEntryLabel(_('Option List')))
225       
226        self.list_options_box.reload()
227
228        self.__create_status_bar()
229    def __option_display(self):
230
231        self.display_frame.set_label('Options')
232        self.opt_display = OptionDisplayMainFrame()
233        self.opt_display.set_options_list(self.list_options_box)
234        self.list_options_box.set_option_display(self.opt_display)
235        self.display_frame.add_with_properties(self.opt_display)
236        self.vbox_left.pack_start(self.display_frame, False, False)
237       
238
239    def __pack_widgets(self):
240        """
241        Packing widgets of mainly windows
242        """
243
244        self.add(self.main_vbox)
245     
246        #Pack widgets to main_box
247
248        self.main_vbox.pack_start(self.hbox_edit, True, True)
249       
250        #Paned
251        self.hbox_edit.pack_start(self.hspacer)
252        separator = gtk.VSeparator()
253        self.hspacer.pack1(self.vbox_left, False, False)
254        self.hspacer.set_position(580)
255        self.hspacer.pack2(self.vbox_right, False, True)
256       
257        #Edit Mode
258        self.edit_mode_exp.add(self.edit_mode_box)
259        self.edit_mode_exp.set_expanded(True)
260       
261        #Frame right
262        self.vbox_right.pack_start(self.edit_mode_exp, False, False)
263        self.vbox_right.pack_end(self.notebook, True, True)
264   
265        #Status bar
266        self.main_vbox.pack_start(self.statusbar,False, False)
267   
268    def create_edit_mode(self):
269        """
270        Create a treeview that contains a three edit modes
271        returns vbox contains a treeview
272       
273        @return: returns the treeview with list of edit modes
274        @rtype: vbox
275        """
276
277        model =  gtk.TreeStore(gtk.gdk.Pixbuf,gobject.TYPE_STRING)
278        self.edit_mode_tv = gtk.TreeView(model)
279        self.edit_mode_tv.set_headers_visible(False)
280        renderer = gtk.CellRendererText()
281        cell_renderer_pix = gtk.CellRendererPixbuf()
282        column = gtk.TreeViewColumn()
283        column.set_title(_('Name'))
284        column.pack_start(cell_renderer_pix, False)
285        column.add_attribute(cell_renderer_pix, 'pixbuf', 0)
286        column.pack_start(renderer, True)
287        column.add_attribute(renderer, 'text', 1)
288       
289       
290        self.edit_mode_tv.append_column(column)
291        myiter = model.insert_before(None, None)
292        icon = gtk.Image()
293        icon = icon.render_icon('gtk-edit',gtk.ICON_SIZE_MENU)
294        model.set_value(myiter, 0, icon)
295        model.set_value(myiter, 1, "Profile")
296        myiter = model.insert_before(None, None)
297        icon = gtk.Image()
298        icon = icon.render_icon('gtk-convert',gtk.ICON_SIZE_MENU)
299        model.set_value(myiter, 0, icon)
300        model.set_value(myiter, 1, "Wizard")
301        myiter = model.insert_before(None, None)
302        icon = gtk.Image()
303       
304        icon = icon.render_icon(gtk.STOCK_DND_MULTIPLE, gtk.ICON_SIZE_MENU)
305        model.set_value(myiter, 0, icon)
306        model.set_value(myiter, 1, "Options")
307        selection = self.edit_mode_tv.get_selection()
308        selection.select_iter(myiter)
309        self.edit_mode_tv.connect("cursor-changed", self.change_edit_mode)
310        vbox = HIGVBox()
311        vbox.pack_start(self.edit_mode_tv, False, False)
312        return vbox
313   
314       
315    def change_edit_mode(self, widget):
316        """
317        Change box of main screen and others changes at toolbar
318        """
319        selection  = self.edit_mode_tv.get_selection()
320        (model,iter) = selection.get_selected() 
321        edit = model.get_value(iter, 1)
322        if edit == "Options" and not self.edit_mode_opt == "Options":
323            #
324            self._remove_previews()
325            self.edit_mode_opt = "Options"
326            #self.vbox_left.pack_start(self.display_frame, False, False )
327            self.display_frame.show_all()
328            if self.notebook.get_n_pages > 1 :
329                self.notebook.remove_page(-1)
330                self.notebook.remove_page(-1)
331            self._set_menus_editor(False)
332
333               
334        elif edit == "Profile" and not self.edit_mode_opt == "Profile":
335            #
336            self._remove_previews()
337            self.edit_mode_opt="Profile"
338            bool = self.profile_box_b==None 
339            self.create_profile_edit()
340            if bool:
341                self.vbox_left.pack_start(self.profile_box, True, True)
342                self.profile_box_b= True
343            log.debug('<<< show :: Profile Edit Mode :: ')
344            self.profile_box.show_all()
345            self.profile_box.notebook.put_on_page()
346            self._create_tooldesign()
347            self._set_menus_editor(True)
348            self.profile_box.show()
349            self.obj = self.profile_box
350        elif edit == "Wizard" and not self.edit_mode_opt == "Wizard":
351            log.debug('<<< show :: Wizard Edit Mode - basic mode ')
352            self._remove_previews()
353            self.edit_mode_opt="Wizard"
354            self._set_menus_editor(True)
355            bool = self.wizard_box_b==None 
356            self.create_wizard_edit()
357            if bool:
358                self.vbox_left.pack_start(self.wizard_box, True, True)
359                self.wizard_box_b = True
360           
361            self.wizard_box.show_all()
362            self.wizard_box.notebook.put_on_page()
363            self._create_tooldesign()
364            self.wizard_box.show()
365            self.obj = self.wizard_box     
366           
367   
368    def _remove_previews(self):
369        '''
370        Remove the previews Edit mode
371       
372        '''
373        #XXX Lack the toolbars and some ajusts
374        if self.edit_mode_opt == "Profile":
375            #self.vbox_left.remove(self.profile_box)
376            self.profile_box.hide_all()
377        elif self.edit_mode_opt == "Options":
378            #self.vbox_left.remove(self.display_frame)
379            self.display_frame.hide_all()
380        elif self.edit_mode_opt == "Wizard":
381            self.wizard_box.hide_all()
382           
383    def _create_tooldesign(self):
384        '''
385        create tooldesign that contains widgets to put
386        in work area of edit profile
387        '''
388        if self._tooldesign == None :     
389            self._tooldesign = ToolDesign()
390
391        if self._proprieties == None :
392            self._proprieties = Proprieties()
393        if self.notebook.get_n_pages() < 2:
394            self.notebook.append_page(self._tooldesign, 
395                                      HIGEntryLabel(_('Design')))
396            self.notebook.append_page(self._proprieties, 
397                                      HIGEntryLabel(_('Proprieties')))
398        self.notebook.show_all()
399        if self.edit_mode_opt == "Profile":
400            obj = self.profile_box
401        elif self.edit_mode_opt == "Wizard":
402            obj = self.wizard_box
403        obj.set_proprieties(self._proprieties)
404        profilecore = obj.get_profilecore()
405        self._proprieties.set_profilecore(profilecore)
406       
407    def __optinlist_from_group(self):
408        """
409        After Select a Option from a group this treeview refresh options lists
410        that each group contains
411        """
412        model =  gtk.TreeStore(gobject.TYPE_STRING)
413        self.profile_optionlist_tvw = gtk.TreeView(model)
414        renderer = gtk.CellRendererText()
415        column = gtk.TreeViewColumn("Name", renderer, text=0)
416        self.profile_optionlist_tvw.append_column(column)
417       
418        self.wizard_file = PWOptions(profile_editor)
419        group_list = self.wizard_file.read("group", "name", "group")
420        for i,v in group_list:
421            myiter = model.insert_after(None, None)
422            model.set_value(myiter, 0, i)
423    def __proprieties(self):
424        """
425        Create a editable options - Proprieties of Options
426        """
427        #Create a listview with options
428        self.prop_frame_option = gtk.Frame()
429        self.prop_frame_option.set_label("List Options")
430        self.prop_frame_option.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
431        prop_sw = HIGScrolledWindow()
432        prop_sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
433        prop_sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
434        model =  gtk.TreeStore(gobject.TYPE_STRING)
435        treeview = gtk.TreeView(model)
436        renderer = gtk.CellRendererText()
437        column = gtk.TreeViewColumn("Name", renderer, text=0)
438        treeview.append_column(column)
439        self.prop_frame_option.add(treeview)
440        self.prop_frame_option.add(prop_sw)
441       
442       
443
444        """
445        Box Edit
446        """
447
448        #Frame
449        self.prop_frame = gtk.Frame()
450        self.prop_frame.set_label("Edit Option")
451        self.prop_frame.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
452       
453        self.prop_exp = HIGExpander("Proprieties")
454
455        label = gtk.Label('s')
456        self.prop_exp.add(label)
457        self.prop_frame.add(self.prop_exp)   
458       
459
460
461    def __grouplist(self):
462        """
463        Group List, Tree view
464        """
465
466        model =  gtk.TreeStore(gobject.TYPE_STRING)
467        self.treeview = gtk.TreeView(model)
468        renderer = gtk.CellRendererText()
469        column = gtk.TreeViewColumn("Name", renderer, text=0)
470        self.treeview.append_column(column)
471       
472        self.wizard_file = PWOptions(profile_editor)
473        group_list = self.wizard_file.read("group", "name", "group")
474        for i,v in group_list:
475            myiter = model.insert_after(None, None)
476            model.set_value(myiter, 0, i)
477
478    def __create_toolbar(self):
479        """
480        Create a Main Toolbar of Profile Wizard Editor
481        """
482       
483        self.toolbar = self.ui_manager.get_widget('/toolbar')
484        self.toolbar.set_style(gtk.TOOLBAR_BOTH)
485
486        self.main_vbox.pack_start(self.toolbar, False, True,0)
487        self.toolbar.show_all()
488    def save_all(self, widget):
489        pass
490   
491    def _set_menus_editor(self, value):
492        self.main_action_group.get_action('Items').set_sensitive(value)
493        self.main_action_group.get_action('Section').set_sensitive(value)
494   
495    def save(self, widget):
496        if self.edit_mode_opt == 'Options':
497            obj = self.list_options_box
498        elif self.edit_mode_opt  == 'Profile':
499            obj = self.profile_box
500        elif self.edit_mode_opt == 'Wizard':
501            obj = self.wizard_box
502       
503        obj.save()
504    def quit(self, widget):
505        self.destroy()
506    def np(self, widget):
507        print "Don't work yet"
508    def __create_ui_manager(self):
509        """
510        Create a UI Manager
511        """
512        self.ui_manager = gtk.UIManager()
513        self.main_action_group = gtk.ActionGroup('MainActionGroup')
514        self.main_actions = [ \
515            ('File', None, _('_File'), None),
516            ('Save', gtk.STOCK_SAVE, _('_Save'), None, _('Save'), self.save),
517            ('Save all', gtk.STOCK_SAVE, _('_Save all'), None, _('Save all'),
518             self.np),
519            ('Quit', gtk.STOCK_QUIT, _('_Quit'), None, _('Quit'), self.quit),
520            ('Edit', None, _('Edit'), None),
521            ('Undo', gtk.STOCK_UNDO, _('_Undo'), None, _('Undo'), self._undo_cb),
522            ('Redo', gtk.STOCK_REDO, _('_Redo'), None, _('Redo'), self._redo_cb),
523            ('View', None, _('View'), None),
524            ('Right Bar', None, _('_Right Bar'), None, 
525             _('Right Bar'), self.np),
526            ('Tools', None, _('Tools'), None),
527            ('Section', None, _('Section'), None),
528            ('Items', None, _('Items'), None),
529            ('Insert label', None, _('_Label'), None, 
530             _('Insert label'), self.np),
531            ('New Section', None, _('_New Section'), None, 
532             _('New Section'), self._add_section),         
533            ('Remove Section Label', None, _('_Remove Section Label'), None, 
534             _('Remove Section Label'), self._remove_section),
535            ('Remove Section', None, _('_Remove Section'), None, 
536             _('Remove Section'), self._remove_section),
537            ('Add new voidplace', None, _('_Add new voidplace'), None, 
538             _('Add new voidplace'), self._add_place),
539            ('Remove option', None, _('_Remove Option'), None, 
540             _('Remove option'), self._remove_option),
541            ('Remove voidplace', None, _('_Remove voidplace'), None, 
542             _('Remove voidplace'), self._remove_option),
543            ('Add option selected', None, _('_Add option selected'), None, 
544             _('Add option selected'), self.np),
545            ('Move Section Left', None, _('_Move Section Left'), None, 
546             _('Move Section Left'), self._move_section_left),
547            ('Move Section Right', None, _('_Move Section Right'), None, 
548             _('Move Section Right'), self._move_section_right),
549            ('Move Item Down', None, _('_Move Item Down'), None, 
550             _('Move Item Down'), self._move_item_down),
551            ('Move Item Up', None, _('_Move Item Up'), None, 
552             _('Move Item Up'), self._move_item_up),
553            ('Help', None, _('Help'), None),
554            ('About', gtk.STOCK_PASTE, _('_About'), None, _('About'), self.np),
555           
556        ]
557
558        self.ui_info = """
559        <menubar>
560            <menu action='File'>
561            <menuitem action='Save'/>
562            <menuitem action='Save all'/>
563            <separator/>
564            <menuitem action='Quit'/>
565            </menu>
566            <menu action='Edit'>
567            <menuitem action='Undo'/>
568            <menuitem action='Redo'/>
569            </menu>
570            <menu action='View'>
571            <menuitem action='Right Bar'/>
572            </menu>
573            <menu action='Section'>
574                    <menuitem action='Insert label'/>
575                    <menuitem action='New Section'/>
576                    <menuitem action='Remove Section Label'/>
577                    <menuitem action='Remove Section'/>
578                    <menuitem action='Move Section Left'/>
579                    <menuitem action='Move Section Right'/>
580            </menu>
581            <menu action='Items'>
582                    <menuitem action='Add new voidplace'/>
583                    <menuitem action='Remove option'/>
584                    <menuitem action='Remove voidplace'/>
585                    <menuitem action='Move Item Up'/>
586                    <menuitem action='Move Item Down'/>
587            </menu>             
588            <menu action='Help'>
589            <menuitem action='About'/>
590            </menu>
591        </menubar>
592            <toolbar>
593            <toolitem action='Save'/>
594            <toolitem action='Save all'/>
595            <separator/>
596            <toolitem action='Undo'/>
597            <toolitem action='Redo'/>
598           
599            <separator/>
600            <toolitem action='Quit'/>
601        </toolbar>
602        """
603
604
605        self.main_action_group.add_actions(self.main_actions)
606        self.main_accel_group = gtk.AccelGroup()
607        for action in self.main_action_group.list_actions():
608           
609            action.set_accel_group(self.main_accel_group)
610            action.connect_accelerator()
611           
612        #ENABLE = FALSE
613        self.main_action_group.get_action('Save all').set_sensitive(False)
614        self.main_action_group.get_action('Save').set_sensitive(False)
615        self.main_action_group.get_action('Undo').set_sensitive(False)
616        self.main_action_group.get_action('Redo').set_sensitive(False)
617
618        self._set_menus_editor(False)
619        #END ENABLE
620       
621        self.ui_manager.insert_action_group(self.main_action_group, 0)
622        #try:
623        self.ui_manager.add_ui_from_string(self.ui_info)
624        #except gobject.GError, msg:
625        #    print "Fails %s" % msg
626   
627   
628    # ACTIONS
629    def _add_section(self, widget):
630        self.obj._toolbar._add_section(widget)
631    def _remove_section(self, widget):
632        self.obj._toolbar._remove_section(widget) 
633    def _add_place(self,widget):
634        self.obj._toolbar._add_place(widget) 
635    def _move_item_up(self, widget):   
636        self.obj._toolbar._move_item_down(widget)
637    def _move_item_down(self, widget):   
638        self.obj._toolbar._move_item_down(widget)
639    def _move_section_left(self, widget):
640        self.obj._toolbar._move_section_left(widget)
641    def _move_section_right(self, widget):
642        self.obj._toolbar._move_section_right(widget)
643    def _remove_option(self, widget):
644        self.obj._toolbar._remove_option(widget)
645   
646   
647    def _undo_cb(self, widget):
648        command_manager.do_undo()
649    def _redo_cb(self, widget):
650        command_manager.do_redo()
651   
652    def __create_menubar(self):
653        """
654        Create a menubar
655        """
656       
657        self.menubar = self.ui_manager.get_widget('/menubar')
658       
659        self.main_vbox.pack_start(self.menubar,False,True, 0)
660       
661        self.menubar.show_all()
662   
663    def __create_status_bar(self):
664        '''
665        create status bar
666        '''
667        self.statusbar = gtk.Statusbar()
668
669        context_id = self.statusbar.push(1," ")
670        self.statusbar.show()
671   
672   
673if __name__ == '__main__':
674    p = umitInterfaceEditor()
675    p.show_all()
676    gtk.main()
Note: See TracBrowser for help on using the browser.