def __create_widgets(self): """ """ self.__content = BWVBox() self.__head = BWHBox(spacing=2) self.__notebook = NodeNotebook(self.__node) # create head elements # icon with node's score color self.__color_box = gtk.EventBox() self.__color_image = gtk.Image() self.__color_image.set_from_file(self.__icon.get_icon('border')) self.__color_box.add(self.__color_image) self.__color_box.set_size_request(15, 15) r, g, b = drawing.cairo_to_gdk_color( self.__node.get_draw_info('color')) self.__color_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(r, g, b)) # title with the node ip and hostname self.__title = "" if self.__node.get_info('hostname') != None: self.__title = self.__node.get_info('hostname') + ' - ' self.__title += self.__node.get_info('ip') self.__title_label = BWSectionLabel(self.__title) self.__title_label.modify_font(self.__title_font) # icon to collapse window self.__collapse_box = gtk.EventBox() self.__collapse_img = gtk.Image() self.__collapse_img.set_from_file(self.__icon.get_icon('collapse')) self.__collapse_box.add(self.__collapse_img) self.__collapse_box.connect('button_press_event', self.collapse_window) self.__collapse_box.add_events(gtk.gdk.BUTTON_PRESS_MASK) # icon to close window self.__close_box = gtk.EventBox() self.__close_img = gtk.Image() self.__close_img.set_from_file(self.__icon.get_icon('close')) self.__close_box.add(self.__close_img) self.__close_box.connect('button_press_event', self.close_window) self.__close_box.add_events(gtk.gdk.BUTTON_PRESS_MASK) # packing head elements self.__head.bw_pack_start_noexpand_nofill(self.__color_box) self.__head.bw_pack_start_expand_fill(self.__title_label) self.__head.bw_pack_start_noexpand_nofill(self.__collapse_box) self.__head.bw_pack_start_noexpand_nofill(self.__close_box) # packing all to content self.__content.bw_pack_start_noexpand_nofill(self.__head) self.__content.bw_pack_start_expand_fill(self.__notebook) # add context to window self.add(self.__content)
def __create_widgets(self): """ """ self.__content = BWVBox() self.__head = BWHBox(spacing=2) self.__notebook = NodeNotebook(self.__node) # create head elements # icon with node's score color self.__color_box = gtk.EventBox() self.__color_image = gtk.Image() self.__color_image.set_from_file(self.__icon.get_icon('border')) self.__color_box.add(self.__color_image) self.__color_box.set_size_request(15, 15) r, g, b = drawing.cairo_to_gdk_color( self.__node.get_draw_info('color')) self.__color_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(r, g, b)) # title with the node ip and hostname self.__title = self.__node.get_host().get_hostname() self.set_title(self.__title) self.__title_label = BWSectionLabel(self.__title) self.__title_label.modify_font(self.__title_font) # packing head elements self.__head.bw_pack_start_noexpand_nofill(self.__color_box) self.__head.bw_pack_start_expand_fill(self.__title_label) # packing all to content self.__content.bw_pack_start_noexpand_nofill(self.__head) self.__content.bw_pack_start_expand_fill(self.__notebook) # add content to window self.add(self.__content)