/* * Función mostrarConsultaWindow() * * Parámetros de entrada: * char * dir[3]: nombre direccion y telefono a mostrar * * Parámetros de salida: * Ninguno * * Descripción: * Mostrar en la pantalla una única consulta */ void mostrarConsultaWindow(char* dir[3]) { GtkWidget *datos; GtkWidget *window; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize (GTK_WIDGET (window), 300, 300); gtk_window_set_policy(GTK_WINDOW (window), TRUE, TRUE, FALSE); gtk_window_set_title (GTK_WINDOW (window), "Libro de direcciones"); gtk_container_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_uposition( window, 300, 300 ); datos=gtk_clist_new(3); gtk_clist_set_column_title(GTK_CLIST(datos),0,"Nombre"); gtk_clist_set_column_title(GTK_CLIST(datos),1,"Direccion"); gtk_clist_set_column_title(GTK_CLIST(datos),2,"Telefono"); gtk_clist_column_titles_show(GTK_CLIST(datos)); gtk_clist_set_column_width(GTK_CLIST(datos),0,100); gtk_clist_set_column_width(GTK_CLIST(datos),1,100); gtk_clist_set_column_width(GTK_CLIST(datos),2,50); gtk_container_add (GTK_CONTAINER (window), datos); gtk_clist_append(GTK_CLIST(datos),dir); gtk_widget_show(datos); gtk_grab_add(window); gtk_widget_show(window); }
void SONGDBUI_Redraw(void *w) { SongdbWidgets *widgets=(SongdbWidgets*)w; SongDBSubgroup *sg; GtkWidget *table; GtkWidget *label; gchar *titles[3] = { "ID","Song","Time" }; // if(SONGDB_GroupChanged()) { // sg=SONGDB_GetSubgroupList(); /* Remove all tabs */ //SDL_NotebookClear(widgets->Tabs); // while(sg) // { table = gtk_clist_new_with_titles( 3, titles); gtk_clist_set_column_width (GTK_CLIST(table), 0, 30); gtk_clist_set_column_width (GTK_CLIST(table), 1, 290); gtk_clist_set_column_width (GTK_CLIST(table), 0, 200); /* When a selection is made, we want to know about it. The callback * used is selection_made, and its code can be found further down */ gtk_signal_connect(GTK_OBJECT(table), "select_row", GTK_SIGNAL_FUNC(selection_made), NULL); // SDL_SignalConnect(table,"activate",testplay,table); { gchar *songinfo[3]; int r=0,c=0; for(c=0;c<3;c++) songinfo[c]=malloc(255); // SONGDB_SetActiveSubgroup(sg); for(r=0;r< 3;r++) { for(c=0;c<3;c++) { sprintf(songinfo[c],"Hello%d",c); } gtk_clist_append( (GtkCList *)table, songinfo); } for(c=0;c<3;c++) free(songinfo[c]); } gtk_widget_show(table); label = gtk_label_new ("AAA"); gtk_notebook_append_page (GTK_NOTEBOOK (widgets->Tabs), table, label); // sg=sg->next; // } // sg=SONGDB_GetSubgroupList(); // SONGDB_SetActiveSubgroup(sg); // SDL_WidgetSetFocus(SDL_NotebookGetChildWidget(Widgets->Tabs)); // SDL_WidgetRedrawEvent(widgets->Tabs); } }
static GtkCList *mmio_window_add_page( mmio_window_t mmio, char *name, struct mmio_region *io_rgn ) { GtkCList *list; GtkWidget *scroll; GtkWidget *tab; GtkCheckButton *trace_button; GtkVBox *vbox; scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS ); list = GTK_CLIST(gtk_clist_new(5)); gtk_clist_set_column_width(list, 0, 70); gtk_clist_set_column_width(list, 1, 75); gtk_clist_set_column_width(list, 2, 70); gtk_clist_set_column_width(list, 3, 280); gtk_clist_set_column_width(list, 4, 160); gtk_clist_set_column_justification(list, 0, GTK_JUSTIFY_CENTER ); gtk_clist_set_column_justification(list, 2, GTK_JUSTIFY_CENTER ); gtk_clist_set_column_justification(list, 3, GTK_JUSTIFY_CENTER ); gtk_clist_set_column_title(list, 0, _("Address")); gtk_clist_set_column_title(list, 1, _("Register")); gtk_clist_set_column_title(list, 2, _("Value")); gtk_clist_set_column_title(list, 3, _("Bit Pattern")); gtk_clist_set_column_title(list, 4, _("Description")); gtk_clist_column_titles_show(list); gtk_widget_modify_font( GTK_WIDGET(list), gui_fixed_font ); tab = gtk_label_new(_(name)); gtk_container_add( GTK_CONTAINER(scroll), GTK_WIDGET(list) ); vbox = GTK_VBOX(gtk_vbox_new( FALSE, 0 )); gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(scroll) ); trace_button = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("Trace access"))); if( io_rgn != NULL ) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(trace_button), io_rgn->trace_flag ? TRUE : FALSE); } gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(trace_button) ); gtk_box_set_child_packing( GTK_BOX(vbox), GTK_WIDGET(trace_button), FALSE, FALSE, 0, GTK_PACK_START ); gtk_notebook_append_page( GTK_NOTEBOOK(mmio->notebook), GTK_WIDGET(vbox), tab ); gtk_object_set_data( GTK_OBJECT(mmio->window), name, list ); g_signal_connect ((gpointer) trace_button, "toggled", G_CALLBACK (on_trace_button_toggled), io_rgn); return list; }
/* * Finalise hierarchical tree. */ static void gdisp_finaliseHierarchicalTree ( Kernel_T *kernel, GtkWidget *cTree ) { guint optimalWidth = 0; /* * Change tree global aspect. */ gtk_clist_set_row_height(GTK_CLIST(cTree), /* CLIST, and not CTREE !! */ 15); gtk_ctree_set_indent(GTK_CTREE(cTree), 16); /* * Compute first column optimal length. */ optimalWidth = gtk_clist_optimal_column_width(GTK_CLIST(cTree), 0 /* first column */); gtk_clist_set_column_width(GTK_CLIST(cTree), 0, /* first column */ optimalWidth); }
GtkWidget* PLAYLISTUI_CreateWindow(void *pl) { GtkWidget *pui = NULL; TRACE("PLAYLISTUI_CreateWindow"); pui = gtk_clist_new(2); gtk_clist_set_column_width (GTK_CLIST(pui), 0, 150); /* Add the CList widget to the vertical box and show it. */ gtk_container_add(GTK_CONTAINER(pl), pui); { int indx; /* Something silly to add to the list. 4 rows of 2 columns each */ gchar *drink[4][2] = { { "Milk", "3 Oz" }, { "Water", "6 l" }, { "Carrots", "2" }, { "Snakes", "55" } }; /* Here we do the actual adding of the text. It's done once for * each row. */ for ( indx=0 ; indx < 4 ; indx++ ) gtk_clist_append( (GtkCList *) pui, drink[indx]); } gtk_widget_show(pui); return pui; }
GtkWidget *dt_clist_get_data_widget(struct formfill *form, GCallback *activatefunc, gpointer funcdata) { GtkWidget *data_widget; GtkWidget *clist; int i; data_widget = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(data_widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_show(data_widget); clist = gtk_clist_new(2); gtk_widget_show(clist); for ( i = 0 ; i < 2 ; i ++ ) { gtk_clist_set_column_width(GTK_CLIST(clist), i, gtk_clist_optimal_column_width(GTK_CLIST(clist), i)); } gtk_container_add(GTK_CONTAINER(data_widget), clist); return data_widget; }
void init_breakpoints() { int i; GtkWidget *boxH1, *scrolledwindow1, *boxV1, *buAdd, *buRemove; breakpoints_opened = 1; for(i=0; i<BREAKPOINTS_MAX_NUMBER; i++) { bp_addresses[i]=0; } for(i=0; i<BREAKPOINTS_MAX_NUMBER; i++) { selected[i]=0; } //=== Creation of Breakpoints Management ===========/ winBreakpoints = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW(winBreakpoints), "Breakpoints"); gtk_window_set_default_size( GTK_WINDOW(winBreakpoints), 100, 150); gtk_container_set_border_width( GTK_CONTAINER(winBreakpoints), 2); boxH1 = gtk_hbox_new( FALSE, 0 ); gtk_container_add( GTK_CONTAINER(winBreakpoints), boxH1 ); //=== Creation of Breakpoints Display ==============/ scrolledwindow1 = gtk_scrolled_window_new( NULL, NULL ); gtk_box_pack_start( GTK_BOX(boxH1), scrolledwindow1, FALSE, FALSE, 0); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC ); gtk_range_set_update_policy( GTK_RANGE (GTK_SCROLLED_WINDOW(scrolledwindow1)->hscrollbar), GTK_POLICY_AUTOMATIC ); clBreakpoints = gtk_clist_new( 1 ); gtk_container_add( GTK_CONTAINER(scrolledwindow1), clBreakpoints ); gtk_clist_set_selection_mode( GTK_CLIST(clBreakpoints), GTK_SELECTION_EXTENDED ); gtk_clist_set_column_width( GTK_CLIST(clBreakpoints), 0, 80 ); gtk_clist_set_auto_sort( GTK_CLIST(clBreakpoints), TRUE ); //=== Creation of the Buttons ======================/ boxV1 = gtk_vbox_new( FALSE, 2 ); gtk_box_pack_end( GTK_BOX(boxH1), boxV1, FALSE, FALSE, 0 ); buAdd = gtk_button_new_with_label("Add"); gtk_box_pack_start( GTK_BOX(boxV1), buAdd, FALSE, FALSE, 0 ); buRemove = gtk_button_new_with_label( "Remove" ); gtk_box_pack_start( GTK_BOX(boxV1), buRemove, FALSE, FALSE, 0 ); gtk_widget_show_all(winBreakpoints); //=== Signal Connections ===========================/ gtk_signal_connect( GTK_OBJECT(clBreakpoints), "select-row", on_row_selection, NULL ); gtk_signal_connect( GTK_OBJECT(clBreakpoints), "unselect-row", on_row_unselection, NULL ); gtk_signal_connect( GTK_OBJECT(buAdd), "clicked", on_add, NULL ); gtk_signal_connect( GTK_OBJECT(buRemove), "clicked", on_remove, NULL ); gtk_signal_connect( GTK_OBJECT(winBreakpoints), "destroy", on_close, NULL ); }
GtkWidget *create_cwidget (GtkWidget *scrollwin, struct clist_def *cldef) { GtkWidget *alignment; GtkWidget *label; GtkWidget *clist; char buf[256]; int i; switch (cldef->type) { case CWIDGET_CLIST: clist = gtk_clist_new (cldef->columns); break; case CWIDGET_CTREE: clist = gtk_ctree_new (cldef->columns, 0); gtk_ctree_set_line_style (GTK_CTREE (clist), GTK_CTREE_LINES_NONE); gtk_ctree_set_expander_style (GTK_CTREE (clist), GTK_CTREE_EXPANDER_TRIANGLE); gtk_ctree_set_indent (GTK_CTREE (clist), 10); break; default: return NULL; } gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); GTK_CLIST_SET_FLAG (GTK_CLIST (clist), CLIST_SHOW_TITLES); gtk_container_add (GTK_CONTAINER (scrollwin), clist); gtk_clist_set_selection_mode (GTK_CLIST (clist), cldef->mode); for (i = 0; i < cldef->columns; i++) { g_snprintf (buf, 256, "/" CONFIG_FILE "/%s Geometry/%s=%d", cldef->name, cldef->cols[i].name, cldef->cols[i].width); gtk_clist_set_column_width (GTK_CLIST (clist), i, config_get_int (buf)); if (cldef->cols[i].justify != GTK_JUSTIFY_LEFT) { gtk_clist_set_column_justification (GTK_CLIST (clist), i, cldef->cols[i].justify); } alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0); label = gtk_label_new (_(cldef->cols[i].name)); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_container_add (GTK_CONTAINER (alignment), label); gtk_widget_show (label); cldef->cols[i].widget = label; gtk_clist_set_column_widget (GTK_CLIST (clist), i, alignment); gtk_widget_show (alignment); } gtk_clist_set_sort_column (GTK_CLIST (clist), cldef->sort_column); gtk_clist_set_sort_type (GTK_CLIST (clist), cldef->sort_type); clist_column_set_title (GTK_CLIST (clist), cldef, TRUE); return clist; }
void gtk_clist_do_auto_resize(GtkCList *clist) { gint i; for (i = 0; i < clist->cols; i++) if (clist->coldata[i].auto_resize) { gtk_clist_set_column_width(clist, i, clist->coldata[i].width); } }
void module_glist (struct session *sess) { gchar *titles[] = { _("Name"), _("Description") }; GtkWidget *okb, *ulb; if (modlist) return; modlist = gtk_dialog_new (); gtk_signal_connect (GTK_OBJECT (modlist), "delete_event", GTK_SIGNAL_FUNC (module_glist_close), 0); gtk_widget_set_usize (modlist, 350, 200); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (modlist)->vbox), 4); gtk_window_set_position (GTK_WINDOW (modlist), GTK_WIN_POS_CENTER); gtk_window_set_title (GTK_WINDOW (modlist), _("X-Chat Plugins")); gtk_window_set_wmclass (GTK_WINDOW (modlist), "plugins", "X-Chat"); modclist = gtk_clist_new_with_titles (2, titles); gtk_clist_set_selection_mode (GTK_CLIST (modclist), GTK_SELECTION_BROWSE); gtk_clist_column_titles_passive (GTK_CLIST (modclist)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (modlist)->vbox), modclist, 1, 1, 10); gtk_widget_show (modclist); gtk_clist_set_column_width (GTK_CLIST (modclist), 0, 40); #ifdef USE_GNOME okb = gnome_stock_button (GNOME_STOCK_BUTTON_OK); #else okb = gtk_button_new_with_label (_("Ok")); #endif gtk_box_pack_start (GTK_BOX (GTK_DIALOG (modlist)->action_area), okb, 1, 1, 10); gtk_signal_connect (GTK_OBJECT (okb), "clicked", GTK_SIGNAL_FUNC (module_glist_close), (gpointer) modlist); gtk_widget_show (okb); ulb = gtk_button_new_with_label (_("Unload")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (modlist)->action_area), ulb, 1, 1, 10); gtk_signal_connect (GTK_OBJECT (ulb), "clicked", GTK_SIGNAL_FUNC (module_glist_unload), (gpointer) sess); gtk_widget_show (ulb); fe_pluginlist_update (); gtk_widget_show (modlist); }
void CheckDir( GtkWidget * list,char * directory ) { struct stat fs; int i; glob_t gg; if ( !fsFilter[0] ) return; gtk_widget_hide( list ); gtk_clist_clear( GTK_CLIST( list ) ); clist_append_fname(list, ".", dpixmap, dmask); clist_append_fname(list, "..", dpixmap, dmask); glob( "*",0,NULL,&gg ); for( i=0;(unsigned)i<gg.gl_pathc;i++ ) { stat( gg.gl_pathv[i],&fs ); if( !S_ISDIR( fs.st_mode ) ) continue; clist_append_fname(list, gg.gl_pathv[i], dpixmap, dmask); } globfree( &gg ); if ( strchr( fsFilter,',' ) ) { char tmp[8]; int i,c,glob_param = 0; for ( i=0,c=0;i<(int)strlen( fsFilter ) + 1;i++,c++ ) { tmp[c]=fsFilter[i]; if ( ( tmp[c] == ',' )||( tmp[c] == '\0' ) ) { tmp[c]=0; c=-1; glob( Filter( tmp ),glob_param,NULL,&gg ); glob_param=GLOB_APPEND; } } } else glob( Filter( fsFilter ),0,NULL,&gg ); for( i=0;(unsigned)i<gg.gl_pathc;i++ ) { stat( gg.gl_pathv[i],&fs ); if( S_ISDIR( fs.st_mode ) ) continue; clist_append_fname(list, gg.gl_pathv[i], fpixmap, fmask); } globfree( &gg ); gtk_clist_set_column_width( GTK_CLIST( list ),0,17 ); gtk_clist_select_row( GTK_CLIST( list ),0,1 ); gtk_widget_show( list ); }
void fe_dcc_open_chat_win (int passive) { GtkWidget *vbox, *bbox; gchar *titles[] = { _("Status"), _("To/From"), _("Recv"), _("Sent"), _("StartTime") }; if (dcccwin.window) { fe_dcc_update_chat_win (); if (!passive) wins_bring_tofront (dcccwin.window); return; } dcccwin.window = maingui_window ("dccchat", _("X-Chat: DCC Chat List"), FALSE, TRUE, close_dcc_chat_window, NULL, 550, 0, &dcccwin.window); vbox = wins_get_vbox (dcccwin.window); dcccwin.list = gtkutil_clist_new (5, titles, vbox, GTK_POLICY_ALWAYS, chat_row_selected, 0, 0, 0, GTK_SELECTION_BROWSE); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 0, 65); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 1, 100); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 2, 65); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 3, 65); bbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 2); gtk_widget_show (bbox); gtkutil_button (dcccwin.window, 0, _("Accept"), accept_chat_clicked, 0, bbox); gtkutil_button (dcccwin.window, 0, _("Abort"), abort_chat_clicked, 0, bbox); gtk_widget_show (dcccwin.window); fe_dcc_update_chat_win (); }
void notify_opengui (void) { GtkWidget *vbox, *bbox; gchar *titles[] = { _("User"), _("Status"), _("Server"), _("Last Seen") }; if (notify_window) { wins_bring_tofront (notify_window); return; } notify_window = maingui_window ("notify", _("X-Chat: Notify List"), FALSE, TRUE, notify_closegui, NULL, 400, 120, ¬ify_window); vbox = wins_get_vbox (notify_window); notify_guilist = gtkutil_clist_new (4, titles, vbox, GTK_POLICY_ALWAYS, 0, 0, 0, 0, GTK_SELECTION_BROWSE); gtk_clist_set_column_width (GTK_CLIST (notify_guilist), 0, 100); gtk_clist_set_column_width (GTK_CLIST (notify_guilist), 1, 60); gtk_clist_set_column_width (GTK_CLIST (notify_guilist), 2, 100); gtk_clist_set_auto_sort (GTK_CLIST (notify_guilist), FALSE); bbox = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); gtkutil_button (notify_window, GNOME_STOCK_PIXMAP_NEW, _("Add"), notify_add_clicked, 0, bbox); gtkutil_button (notify_window, GNOME_STOCK_PIXMAP_CLOSE, _("Remove"), notify_remove_clicked, 0, bbox); notify_gui_update (); gtk_widget_show (notify_window); }
static GtkWidget * init_FGR_col() { GtkCList *cl; int i; char *txt[2]; char txt_regnum[6]; txt[0] = txt_regnum; txt[1] = "MMMMMMMMMM"; cl = (GtkCList *) gtk_clist_new(2); gtk_widget_modify_font(GTK_WIDGET(cl), debugger_font_desc); gtk_clist_set_column_resizeable(cl, 0, FALSE); gtk_clist_set_column_resizeable(cl, 1, FALSE); for (i=0; i<32; i++) { sprintf(txt_regnum, "%d", i); gtk_clist_append(cl, txt); } gtk_clist_set_column_width(cl, 0, gtk_clist_optimal_column_width(cl, 0)); gtk_clist_set_column_width(cl, 1, gtk_clist_optimal_column_width(cl, 1)); return GTK_WIDGET(cl); }
/********************************************************************\ * gnc_query_list_recompute_widths * * Given a new widget width, recompute the widths of each column. * * Give any excess allocation to the description field. This also * * handles the case of allocating column widths when the list is * * first filled with data. * * * * Args: list - a GncQueryList widget * * allocated - the allocated width for this list * * Returns: nothing * \********************************************************************/ static void gnc_query_list_recompute_widths (GNCQueryList *list, gint allocated) { GtkCList *clist = GTK_CLIST(list); gint total_width, desc_width = 0, excess, i; /* Prevent loops when allocation is bigger than total widths */ if (allocated == list->prev_allocation) return; /* Enforce column minimum widths */ total_width = 0; for (i = 0; i < list->num_columns; i++) { gint width; width = gtk_clist_optimal_column_width(clist, i); if (width < list->title_widths[i]) width = list->title_widths[i]; total_width += width; gtk_clist_set_column_width (clist, i, width); if (i == 2) desc_width = width; } /* Did the list use its full allocation? * * Add/subtract any underage/overage to/from the description column */ if (allocated <= 1) allocated = list->prev_allocation; list->prev_allocation = allocated; excess = allocated - total_width - VSCROLLBAR_SLOP; /* XXX: Choose a generic column to resize */ gtk_clist_set_column_width (clist, 2, desc_width + excess); }
void DownloadUI::CreateDownloadList(GtkWidget *box) { static const char *titles[] = { "Song Title", "Status" }; m_List = gtk_clist_new_with_titles(2, (gchar **)titles); gtk_container_add(GTK_CONTAINER(box), m_List); gtk_clist_set_column_width(GTK_CLIST(m_List), 0, 200); gtk_signal_connect(GTK_OBJECT(m_List), "select_row", GTK_SIGNAL_FUNC(set_current_sel_internal), this); gtk_widget_show(m_List); gtk_clist_column_titles_passive(GTK_CLIST(m_List)); }
static void add_filter_callback_2(GtkWidget *widget, GtkWidget *nothing) { (void)widget; (void)nothing; int i; GtkCList *cl; if(!GLOBALS->filesel_ok) { return; } if(*GLOBALS->fileselbox_text) { for(i=0;i<GLOBALS->num_file_filters;i++) { if(GLOBALS->filesel_filter[i]) { if(!strcmp(GLOBALS->filesel_filter[i], *GLOBALS->fileselbox_text)) { status_text("Filter already imported.\n"); if(GLOBALS->is_active_translate_c_5) gdk_window_raise(GLOBALS->window_translate_c_11->window); return; } } } } GLOBALS->num_file_filters++; load_file_filter(GLOBALS->num_file_filters, *GLOBALS->fileselbox_text); if(GLOBALS->xl_file_filter[GLOBALS->num_file_filters] && (*GLOBALS->fileselbox_text /* scan-build */)) { if(GLOBALS->filesel_filter[GLOBALS->num_file_filters]) free_2(GLOBALS->filesel_filter[GLOBALS->num_file_filters]); GLOBALS->filesel_filter[GLOBALS->num_file_filters] = malloc_2(strlen(*GLOBALS->fileselbox_text) + 1); strcpy(GLOBALS->filesel_filter[GLOBALS->num_file_filters], *GLOBALS->fileselbox_text); cl=GTK_CLIST(GLOBALS->clist_translate_c_4); gtk_clist_freeze(cl); gtk_clist_append(cl,(gchar **)&(GLOBALS->filesel_filter[GLOBALS->num_file_filters])); gtk_clist_set_column_width(cl,0,gtk_clist_optimal_column_width(cl,0)); gtk_clist_thaw(cl); } else { GLOBALS->num_file_filters--; } if(GLOBALS->is_active_translate_c_5) gdk_window_raise(GLOBALS->window_translate_c_11->window); }
void fe_dcc_open_send_win (int passive) { GtkWidget *vbox, *bbox; gchar *titles[] = { _("Status"), _("File"), _("Size"), _("Position"), _("Ack"), "%", _("CPS"), _("ETA"), _("To") }; if (dccswin.window) { fe_dcc_update_send_win (); if (!passive) wins_bring_tofront (dccswin.window); return; } dccswin.window = maingui_window ("dccsend", _("X-Chat: File Send List"), FALSE, TRUE, close_dcc_send_window, NULL, 595, 0, &dccswin.window); vbox = wins_get_vbox (dccswin.window); dccswin.list = gtkutil_clist_new (9, titles, vbox, GTK_POLICY_ALWAYS, send_row_selected, 0, 0, 0, GTK_SELECTION_SINGLE); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 0, 65); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 1, 100); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 2, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 3, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 4, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 5, 30); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 6, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 7, 50); gtk_clist_set_column_justification (GTK_CLIST (dccswin.list), 5, GTK_JUSTIFY_CENTER); bbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 2); gtk_widget_show (bbox); gtkutil_button (dccswin.window, 0, _("Abort"), abort_send_clicked, 0, bbox); gtkutil_button (dccswin.window, 0, _("Info"), info_send_clicked, 0, bbox); gtk_widget_show (dccswin.window); fe_dcc_update_send_win (); }
void init_regSI() { GtkWidget *boxH1, *boxV1, *labRegSI[32]; int i; char **txt; txt=malloc( sizeof(char*) ); txt[0]=malloc( 64*sizeof(char) ); frRegSI = gtk_frame_new("Serial Interface"); boxH1 = gtk_hbox_new( FALSE, 2); gtk_container_add( GTK_CONTAINER(frRegSI), boxH1 ); gtk_container_set_border_width( GTK_CONTAINER(boxH1), 5); //=== Creation of Labels "SD_*_REG" Column =======/ boxV1 = gtk_vbox_new( FALSE, 0); gtk_box_pack_start( GTK_BOX(boxH1), boxV1, FALSE, FALSE, 0); labRegSI[0] = gtk_label_new( mnemonicSI[0] ); gtk_box_pack_start( GTK_BOX(boxV1), labRegSI[0], FALSE, TRUE, 1); for( i=1; i<4; i++) { labRegSI[i] = gtk_label_new( mnemonicSI[i] ); gtk_box_pack_start( GTK_BOX(boxV1), labRegSI[i], FALSE, TRUE, 0); } //=== Creation of Registers Value Display ========/ clRegSI = gtk_clist_new(1); gtk_box_pack_start( GTK_BOX(boxH1), clRegSI, TRUE, TRUE, 0); gtk_clist_set_selection_mode( GTK_CLIST(clRegSI), GTK_SELECTION_SINGLE); gtk_clist_set_column_width( GTK_CLIST(clRegSI), 0, 130); strcpy( txt[0], "Undefined"); for( i=0; i<4; i++) { gtk_clist_append( GTK_CLIST(clRegSI), txt); } //=== Fantom Registers Initialisation ============/ for( i=0; i<4; i++) { gui_fantom_reg_SI[i] = 0x12345678; //Should be put to the least probable value. } }
static void on_tclist_dialog_ok (GtkWidget * widget, GbWidgetNewData * data) { GtkWidget *new_widget, *spinbutton, *dialog, *label; #ifndef GTK_HAVE_FEATURES_1_1_4 GtkAdjustment *adjustment; #endif gint cols, i; dialog = gtk_widget_get_toplevel (widget); /* Only call callback if placeholder/fixed widget is still there */ if (gb_widget_can_finish_new (data)) { spinbutton = gtk_object_get_data (GTK_OBJECT (dialog), "cols"); g_return_if_fail (spinbutton != NULL); cols = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spinbutton)); new_widget = tclist_new (cols); gtk_clist_column_titles_show (GTK_CLIST (new_widget)); for (i = 0; i < cols; i++) { label = new_label (new_widget); gtk_clist_set_column_widget (GTK_CLIST (new_widget), i, label); gtk_clist_set_column_width (GTK_CLIST (new_widget), i, 80); } /* Connect signals for redrawing. */ /* The CList doesn't have scrollbars in 1.1.4+. We'll have to do this another way at some point. */ #ifndef GTK_HAVE_FEATURES_1_1_4 adjustment = gtk_range_get_adjustment (GTK_RANGE (GTK_CLIST (new_widget)->hscrollbar)); gtk_signal_connect_after (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) hadjustment_value_changed, new_widget); adjustment = gtk_range_get_adjustment (GTK_RANGE (GTK_CLIST (new_widget)->vscrollbar)); gtk_signal_connect_after (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) vadjustment_value_changed, new_widget); #endif gb_widget_initialize (new_widget, data); (*data->callback) (new_widget, data); } gtk_widget_destroy (dialog); }
/* * Creates a new GtkWidget of class GtkCList, performing any specialized * initialization needed for the widget to work correctly in this environment. * If a dialog box is used to initialize the widget, return NULL from this * function, and call data->callback with your new widget when it is done. * If the widget needs a special destroy handler, add a signal here. */ static GtkWidget * gb_tclist_new (GbWidgetNewData * data) { GtkWidget *new_widget; #ifndef GTK_HAVE_FEATURES_1_1_4 GtkAdjustment *adjustment; #endif gint cols = 0, i; if (data->action == GB_LOADING) { cols = load_int (data->loading_data, Cols); if (cols == 0) cols = 1; new_widget = tclist_new (cols); /* GtkCList has problems if the title buttons aren't created. */ for (i = 0; i < cols; i++) { gtk_clist_set_column_widget (GTK_CLIST (new_widget), i, new_unnamed_label (new_widget)); gtk_clist_set_column_width (GTK_CLIST (new_widget), i, 80); editor_add_mouse_signals_to_existing (GTK_CLIST (new_widget)->column[i].button); } /* Connect signals for redrawing. */ /* The CList doesn't have scrollbars in 1.1.4+. We'll have to do this another way at some point. */ #ifndef GTK_HAVE_FEATURES_1_1_4 adjustment = gtk_range_get_adjustment (GTK_RANGE (GTK_CLIST (new_widget)->hscrollbar)); gtk_signal_connect_after (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) hadjustment_value_changed, new_widget); adjustment = gtk_range_get_adjustment (GTK_RANGE (GTK_CLIST (new_widget)->vscrollbar)); gtk_signal_connect_after (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) vadjustment_value_changed, new_widget); #endif return new_widget; } else { show_tclist_dialog (data); return NULL; } }
/** * Queue a bitzi queries from the search context menu */ void on_popup_search_metadata_activate(GtkMenuItem *unused_menuitem, gpointer unused_udata) { GList *node_list; GSList *data_list; search_t *search; guint32 bitzi_debug; (void) unused_menuitem; (void) unused_udata; search = search_gui_get_current_search(); g_assert(search != NULL); gtk_clist_freeze(GTK_CLIST(search->tree)); node_list = g_list_copy(GTK_CLIST(search->tree)->selection); data_list = search_cb_collect_ctree_data(GTK_CTREE(search->tree), node_list, gui_record_sha1_eq); /* Make sure the column is actually visible. */ { static const gint min_width = 80; GtkCList *clist = GTK_CLIST(search->tree); gtk_clist_set_column_visibility(clist, c_sr_meta, TRUE); if (clist->column[c_sr_meta].width < min_width) gtk_clist_set_column_width(clist, c_sr_meta, min_width); } /* Queue up our requests */ gnet_prop_get_guint32_val(PROP_BITZI_DEBUG, &bitzi_debug); if (bitzi_debug > 10) g_debug("on_popup_search_metadata_activate: %d items, %p", g_slist_position(data_list, g_slist_last(data_list)) + 1, cast_to_gconstpointer(data_list)); G_SLIST_FOREACH(data_list, search_gui_queue_bitzi_by_sha1); gtk_clist_thaw(GTK_CLIST(search->tree)); g_slist_free(data_list); g_list_free(node_list); }
void url_opengui () { GtkWidget *vbox, *hbox; GSList *list; if (urlgrabberwindow) { wins_bring_tofront (urlgrabberwindow); return; } urlgrabberwindow = maingui_window ("urlgrabber", _("X-Chat: URL Grabber"), FALSE, TRUE, url_closegui, NULL, 350, 100, &urlgrabberwindow); vbox = wins_get_vbox (urlgrabberwindow); urlgrabberlist = gtkutil_clist_new (1, 0, vbox, GTK_POLICY_AUTOMATIC, 0, 0, 0, 0, GTK_SELECTION_BROWSE); gtk_signal_connect (GTK_OBJECT (urlgrabberlist), "button_press_event", GTK_SIGNAL_FUNC (url_clicklist), 0); gtk_widget_set_usize (urlgrabberlist, 350, 0); gtk_clist_set_column_width (GTK_CLIST (urlgrabberlist), 0, 100); hbox = gtk_hbox_new (FALSE, 1); gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); gtk_widget_show (hbox); gtkutil_button (urlgrabberwindow, GNOME_STOCK_PIXMAP_CLEAR, _("Clear"), url_button_clear, 0, hbox); gtkutil_button (urlgrabberwindow, GNOME_STOCK_PIXMAP_SAVE, _("Save"), url_button_save, 0, hbox); gtk_widget_show (urlgrabberwindow); list = url_list; while (list) { url_addurlgui ((char *) list->data); list = list->next; } }
void dt_clist_delete_data(struct formfill *form, GtkWidget *hbox, GtkWidget *data_widget) { GtkCList *clist = (GtkCList*) GTK_BIN(data_widget)->child; int i; gtk_clist_freeze(clist); gtk_clist_clear(clist); gtk_object_remove_data(GTK_OBJECT(data_widget), "data"); gtk_widget_set_usize(hbox, -1, DT_CLIST_EMPTY_HEIGHT); for ( i = 0 ; i < 2 ; i ++ ) { gtk_clist_set_column_width(clist, i, gtk_clist_optimal_column_width(clist, i)); } gtk_clist_thaw(clist); }
void init_regHiLo() { int i; char **txt=malloc(sizeof(char*)); txt[0]=malloc(16*sizeof(char)); frRegHiLo = gtk_frame_new("Hi/Lo"); clRegHiLo = gtk_clist_new(1); gtk_container_add( GTK_CONTAINER(frRegHiLo), clRegHiLo ); strcpy( txt[0], "Undefined" ); for(i=0;i<2;i++) { gtk_clist_append( GTK_CLIST(clRegHiLo), txt ); } gtk_clist_set_column_width( GTK_CLIST(clRegHiLo), i, 130); gui_fantom_hi=0x1234567890LL; gui_fantom_lo=0x1234567890LL; }
void dt_clist_store_data(struct formfill *form, GtkWidget *hbox, GtkWidget *data_widget, const GByteArray *data) { GtkCList *clist = (GtkCList*) GTK_BIN(data_widget)->child; int i; gtk_clist_freeze(clist); gtk_clist_clear(clist); gtk_object_remove_data(GTK_OBJECT(data_widget), "data"); if(data) { GByteArray *internal = g_byte_array_new(); g_byte_array_append(internal, data->data, data->len); gtk_object_set_data_full(GTK_OBJECT(data_widget), "data", internal, (GtkDestroyNotify) free_internal_data); if (internal->len > 0) { GQTypeDisplayClass* klass = g_type_class_ref(form->dt_handler); if (DT_CLIST(klass)->fill_clist) { DT_CLIST(klass)->fill_clist(form, hbox, data_widget, internal, GTK_WIDGET(clist)); } g_type_class_unref(klass); } for ( i = 0 ; i < 2 ; i ++ ) { gtk_clist_set_column_width(GTK_CLIST(clist), i, gtk_clist_optimal_column_width(clist, i)); } } gtk_clist_thaw(clist); }
GtkWidget * create_file_view(FileView *view) { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *menu_bar; GtkWidget *button; GtkWidget *pixmapwid; GdkPixmap *pixmap; GdkBitmap *mask; GtkStyle *style; GdkFont *font; GtkWidget *sw; gint i; /* Top Pane */ vbox = gtk_vbox_new(FALSE, 0); gtk_widget_show(vbox); menu_bar = create_filelist_menu_bar(view); gtk_widget_show(menu_bar); gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0); hbox = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox); /* Show/Hide Button */ if (view == &app.right_view) button = gtk_button_new_with_label("<"); else button = gtk_button_new_with_label(">"); GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); gtk_signal_connect(GTK_OBJECT(button), "button_press_event", GTK_SIGNAL_FUNC(show_hide_file_view_cb), view); gtk_tooltips_set_tip(GTK_TOOLTIPS(app.tooltips), button, _("Left Click: Maximize/Minimize File View\n" "Right Click: Sync Dirs"), NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); /* Hidden files toggle button */ view->hidden_toggle = gtk_toggle_button_new_with_label("H"); GTK_WIDGET_UNSET_FLAGS(view->hidden_toggle, GTK_CAN_FOCUS); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(view->hidden_toggle), view->show_hidden); gtk_signal_connect(GTK_OBJECT(view->hidden_toggle), "toggled", GTK_SIGNAL_FUNC(toggle_show_hidden_cb), view); gtk_tooltips_set_tip(GTK_TOOLTIPS(app.tooltips), view->hidden_toggle, _("Show/Hide hidden files"), NULL); gtk_box_pack_start(GTK_BOX(hbox), view->hidden_toggle, FALSE, FALSE, 0); gtk_widget_show(view->hidden_toggle); /* Dir Entry Combo */ view->dir_entry = gtk_combo_new(); gtk_combo_disable_activate(GTK_COMBO(view->dir_entry)); gtk_combo_set_use_arrows_always(GTK_COMBO(view->dir_entry), TRUE); gtk_combo_set_case_sensitive(GTK_COMBO(view->dir_entry), TRUE); gtk_signal_connect(GTK_OBJECT(GTK_COMBO(view->dir_entry)->entry), "activate", GTK_SIGNAL_FUNC(dir_entry_cb), view); gtk_signal_connect(GTK_OBJECT(GTK_COMBO(view->dir_entry)->popwin), "hide", GTK_SIGNAL_FUNC(dir_popwin_cb), view); gtk_box_pack_start(GTK_BOX(hbox), view->dir_entry, TRUE, TRUE, 0); gtk_widget_show(view->dir_entry); /* Up Dir Button */ button = gtk_button_new(); GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); gtk_signal_connect(GTK_OBJECT(button), "button_press_event", GTK_SIGNAL_FUNC(updir_click_cb), view); gtk_tooltips_set_tip(GTK_TOOLTIPS(app.tooltips), button, _("Left Click: Up Dir Right Click: Home"), NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); style = gtk_widget_get_style(app.main_window); pixmap = gdk_pixmap_create_from_xpm_d(app.main_window->window, &mask, &style->bg[GTK_STATE_NORMAL], icon_dirparent_xpm); pixmapwid = gtk_pixmap_new(pixmap, mask); gtk_container_add(GTK_CONTAINER(button), pixmapwid); gtk_widget_show(pixmapwid); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); sw = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW(sw), cfg.scrollbar_pos); gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); gtk_widget_show(sw); /* File List */ view->clist = gtk_clist_new(MAX_COLUMNS); for (i = 0; i < MAX_COLUMNS; i++) { GtkWidget *hbox = gtk_hbox_new(FALSE, 0); GtkWidget *label = gtk_label_new(all_columns[i].title); view->sort_arrows[i] = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_IN); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); gtk_box_pack_end(GTK_BOX(hbox), view->sort_arrows[i], FALSE, TRUE, 0); gtk_widget_show(label); gtk_widget_show(hbox); gtk_clist_set_column_widget(GTK_CLIST(view->clist), i, hbox); GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(view->clist)->column[i].button, GTK_CAN_FOCUS); } gtk_clist_column_titles_show(GTK_CLIST(view->clist)); gtk_clist_set_shadow_type(GTK_CLIST(view->clist), GTK_SHADOW_ETCHED_IN); gtk_clist_set_selection_mode(GTK_CLIST(view->clist), GTK_SELECTION_EXTENDED); gtk_clist_set_use_drag_icons(GTK_CLIST(view->clist), TRUE); gtk_clist_set_row_height(GTK_CLIST(view->clist), 0); font = gdk_font_load(cfg.list_font); if (font != NULL) { style = gtk_style_copy(gtk_widget_get_style(view->clist)); style->font = font; gtk_widget_set_style(view->clist, style); } for (i = 0; i < MAX_COLUMNS; i++) { gtk_clist_set_column_width(GTK_CLIST(view->clist), i, all_columns[i].size); gtk_clist_set_column_visibility(GTK_CLIST(view->clist), i, all_columns[i].is_visible); } gtk_signal_connect(GTK_OBJECT(view->clist), "select_row", GTK_SIGNAL_FUNC(select_row_cb), view); gtk_signal_connect(GTK_OBJECT(view->clist), "button_press_event", GTK_SIGNAL_FUNC(mouse_click_cb), view); gtk_signal_connect(GTK_OBJECT(view->clist), "key_press_event", GTK_SIGNAL_FUNC(file_list_key_press_cb), view); gtk_signal_connect(GTK_OBJECT(view->clist), "click_column", GTK_SIGNAL_FUNC(column_button_cb), view); gtk_signal_connect(GTK_OBJECT(view->clist), "drag_data_get", GTK_SIGNAL_FUNC(clist_drag_data_get), view); gtk_signal_connect(GTK_OBJECT(view->clist), "drag_motion", GTK_SIGNAL_FUNC(clist_drag_motion), view); gtk_signal_connect(GTK_OBJECT(view->clist), "drag_leave", GTK_SIGNAL_FUNC(clist_drag_leave), view); gtk_signal_connect(GTK_OBJECT(view->clist), "drag_data_received", GTK_SIGNAL_FUNC(clist_drag_data_received), view); gtk_drag_dest_set(view->clist, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, target_table, n_targets, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK); gtk_container_add(GTK_CONTAINER(sw), view->clist); gtk_widget_show(view->clist); /* Set the CLIST_COLOR for resetting from the DRAG_HILIGHT color */ { GtkStyle *style = gtk_widget_get_style(view->clist); CLIST_COLOR.red = style->base[GTK_STATE_NORMAL].red; CLIST_COLOR.green = style->base[GTK_STATE_NORMAL].green; CLIST_COLOR.blue = style->base[GTK_STATE_NORMAL].blue; } return vbox; }
static void change_day(history_calendar_dlg *hcdlg) { int count, i, itemid; char key[50]; char *str, *event; int hour, minute; gint row; char *append[2]; NetRequest *request; NetResult *result; if (hcdlg->firstyear == 0) return; /* this can happen if they cancelled the getdaycounts */ request = XXX("getevents"); net_request_seti(request, "truncate", 50); net_request_seti(request, "prefersubject", 1); net_request_seti(request, "noprops", 1); net_request_copys(request, "selecttype", "day"); net_request_copys(request, "lineendings", "dots"); net_request_seti(request, "year", hcdlg->year); net_request_seti(request, "month", hcdlg->mon); net_request_seti(request, "day", hcdlg->day); result = net_request_run(hcdlg->win, "Loading day calendar...", request); net_request_free(request); if (!net_result_succeeded(result)) { net_result_free(result); return; } /* it would have been better if net_result_geti used a GError */ str = net_result_get(result, "events_count"); if (str == NULL) return; count = atoi(str); if (count == 0) { /* FIXME? no events this day; whoops. can happen if they delete. */ MARKMONTH_CUR(hcdlg) &= ~(1L << hcdlg->day); gtk_clist_clear(GTK_CLIST(hcdlg->evlist)); append[0] = ""; append[1] = "[no events]"; gtk_clist_append(GTK_CLIST(hcdlg->evlist), append); gtk_clist_set_selectable(GTK_CLIST(hcdlg->evlist), 0, FALSE); net_result_free(result); return; } gtk_clist_freeze(GTK_CLIST(hcdlg->evlist)); gtk_clist_clear(GTK_CLIST(hcdlg->evlist)); for (i = 1; i < count+1; i++) { sprintf(key, "events_%d_event", i); event = net_result_get(result, key); sprintf(key, "events_%d_eventtime", i); str = net_result_get(result, key); sscanf(str+11, "%2d:%2d", &hour, &minute); sprintf(key, "events_%d_itemid", i); str = net_result_get(result, key); if (str == NULL) continue; itemid = atoi(str); sprintf(key, "%02d:%02d", hour, minute); append[0] = key; append[1] = event; row = gtk_clist_append(GTK_CLIST(hcdlg->evlist), append); gtk_clist_set_row_data(GTK_CLIST(hcdlg->evlist), row, GINT_TO_POINTER(itemid)); } gtk_clist_thaw(GTK_CLIST(hcdlg->evlist)); gtk_clist_set_column_width(GTK_CLIST(hcdlg->evlist), 0, gtk_clist_optimal_column_width(GTK_CLIST(hcdlg->evlist), 0)); net_result_free(result); }
gint gw_plugin_settings_quick_search_pane_create ( GtkWindow *settings, GtkContainer *parent, GtkWidget **pane) { gint result = -1; GtkWidget *hbox; GtkWidget *scr_clist_hidden; GtkWidget *clist_hidden; GtkWidget *col_title_hidden; GtkWidget *vbox_btn; GtkWidget *btn_hidden; GtkWidget *btn_show; GtkWidget *scr_clist_visible; GtkWidget *clist_visible; GtkWidget *col_title_visible; GtkTooltips *tooltips; gchar *text_utf8 = NULL; #ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); #endif if ( settings != NULL && parent != NULL ) { #ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT g_print ( "*** GW - %s (%d) :: %s() : Creating configuration pane...\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); #endif tooltips = gtk_tooltips_new ( ); hbox = gtk_hbox_new ( FALSE, 0); gtk_widget_ref ( GTK_WIDGET ( settings)); gtk_object_set_data_full ( GTK_OBJECT ( hbox), GW_PLUGIN_SETTINGS_WINDOW, settings, (GtkDestroyNotify) gtk_widget_unref); gtk_container_set_border_width ( GTK_CONTAINER ( hbox), 5); scr_clist_visible = gtk_scrolled_window_new ( NULL, NULL); gtk_box_pack_start ( GTK_BOX ( hbox), scr_clist_visible, TRUE, TRUE, 0); clist_visible = gtk_clist_new ( 1); gtk_widget_ref ( clist_visible); gtk_object_set_data_full ( GTK_OBJECT ( hbox), GW_PLUGIN_SETTINGS_QUICK_SEARCH_LIST_VISIBLE, clist_visible, (GtkDestroyNotify) gtk_widget_unref); gtk_container_add ( GTK_CONTAINER ( scr_clist_visible), clist_visible); gtk_clist_set_column_width ( GTK_CLIST ( clist_visible), 0, 80); gtk_clist_optimal_column_width ( GTK_CLIST ( clist_visible), 0); gtk_clist_column_titles_show (GTK_CLIST (clist_visible)); g_strdup_to_gtk_text ( _( "Visible"), text_utf8); col_title_visible = gtk_label_new ( text_utf8); g_free ( text_utf8); gtk_clist_set_column_widget ( GTK_CLIST ( clist_visible), 0, col_title_visible); vbox_btn = gtk_vbox_new ( TRUE, 0); gtk_box_pack_start ( GTK_BOX ( hbox), vbox_btn, TRUE, TRUE, 5); g_strdup_to_gtk_text ( _( "Hide"), text_utf8); btn_hidden = gtk_button_new_with_label ( text_utf8); g_free ( text_utf8); gtk_box_pack_start ( GTK_BOX ( vbox_btn), btn_hidden, FALSE, FALSE, 0); g_strdup_to_gtk_text ( _( "Show"), text_utf8); btn_show = gtk_button_new_with_label ( text_utf8); g_free ( text_utf8); gtk_box_pack_start ( GTK_BOX ( vbox_btn), btn_show, FALSE, FALSE, 0); scr_clist_hidden = gtk_scrolled_window_new ( NULL, NULL); gtk_box_pack_start ( GTK_BOX ( hbox), scr_clist_hidden, TRUE, TRUE, 0); clist_hidden = gtk_clist_new ( 1); gtk_widget_ref ( clist_hidden); gtk_object_set_data_full ( GTK_OBJECT ( hbox), GW_PLUGIN_SETTINGS_QUICK_SEARCH_LIST_HIDDEN, clist_hidden, (GtkDestroyNotify) gtk_widget_unref); gtk_container_add ( GTK_CONTAINER (scr_clist_hidden), clist_hidden); gtk_clist_set_column_width ( GTK_CLIST ( clist_hidden), 0, 80); gtk_clist_optimal_column_width ( GTK_CLIST ( clist_hidden), 0); gtk_clist_column_titles_show ( GTK_CLIST ( clist_hidden)); g_strdup_to_gtk_text ( _( "Hidden"), text_utf8); col_title_hidden = gtk_label_new ( text_utf8); g_free ( text_utf8); gtk_clist_set_column_widget ( GTK_CLIST ( clist_hidden), 0, col_title_hidden); *pane = hbox; gw_plugin_settings_quick_search_pane_load ( hbox); /* Connects signals after loading. */ #ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT g_print ( "*** GW - %s (%d) :: %s() : connecting all callbacks to signals...\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); #endif gtk_signal_connect ( GTK_OBJECT ( hbox), "destroy", (GtkSignalFunc)gw_plugin_settings_quick_search_destroy, NULL); gtk_signal_connect ( GTK_OBJECT ( btn_hidden), "clicked", (GtkSignalFunc)gw_plugin_settings_quick_search_btn_hide_click, hbox); gtk_signal_connect ( GTK_OBJECT ( btn_show), "clicked", (GtkSignalFunc)gw_plugin_settings_quick_search_btn_show_click, hbox); result = 0; } return result; }
void fe_dcc_open_recv_win (int passive) { GtkWidget *vbox, *bbox; #ifdef USE_GNOME gchar *titles[] = { _("Status"), _("File"), _("Size"), _("Position"), "%", _("CPS"), _("ETA"), _("From"), _("MIME Type") }; #else gchar *titles[] = { _("Status"), _("File"), _("Size"), _("Position"), "%", _("CPS"), _("ETA"), _("From") }; #endif if (dccrwin.window) { fe_dcc_update_recv_win (); if (!passive) wins_bring_tofront (dccrwin.window); return; } dccrwin.window = maingui_window ("dccrecv", _("X-Chat: File Receive List"), FALSE, TRUE, close_dcc_recv_window, NULL, 601, 0, &dccrwin.window); vbox = wins_get_vbox (dccrwin.window); #ifdef USE_GNOME dccrwin.list = gtkutil_clist_new (9, titles, vbox, GTK_POLICY_ALWAYS, recv_row_selected, 0, 0, 0, GTK_SELECTION_SINGLE); #else dccrwin.list = gtkutil_clist_new (8, titles, vbox, GTK_POLICY_ALWAYS, recv_row_selected, 0, 0, 0, GTK_SELECTION_SINGLE); #endif gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 0, 65); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 1, 100); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 2, 50); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 3, 50); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 4, 30); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 5, 50); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 6, 60); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 7, 60); gtk_clist_set_column_justification (GTK_CLIST (dccrwin.list), 4, GTK_JUSTIFY_CENTER); bbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 2); gtk_widget_show (bbox); gtkutil_button (dccrwin.window, 0, _("Accept"), accept_clicked, 0, bbox); gtkutil_button (dccrwin.window, 0, _("Resume"), resume_clicked, 0, bbox); gtkutil_button (dccrwin.window, 0, _("Abort"), abort_clicked, 0, bbox); gtkutil_button (dccrwin.window, 0, _("Info"), info_clicked, 0, bbox); #ifdef USE_GNOME gtkutil_button (dccrwin.window, 0, _("Open"), open_clicked, 0, bbox); #endif gtk_widget_show (dccrwin.window); fe_dcc_update_recv_win (); }