• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_SIGNAL_FUNC函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_SIGNAL_FUNC函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_SIGNAL_FUNC函数的具体用法?C++ GTK_SIGNAL_FUNC怎么用?C++ GTK_SIGNAL_FUNC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_SIGNAL_FUNC函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: view_file


//.........这里部分代码省略.........
  gtk_window_set_title (GTK_WINDOW (dialog), filename);
  gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
                              5);
  gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->action_area), TRUE);
#else
  dialog = gtk_dialog_new_with_buttons (filename, NULL, 0,
                                        GTK_STOCK_CLOSE,
                                        GTK_RESPONSE_CLOSE,
                                        NULL);
#endif
  gtk_window_set_wmclass (GTK_WINDOW(dialog), "fileview", "gFTP");
  gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5);
  gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5);
  gtk_widget_realize (dialog);

  if (gftp_icon != NULL)
    {
      gdk_window_set_icon (dialog->window, NULL, gftp_icon->pixmap,
                           gftp_icon->bitmap);
      gdk_window_set_icon_name (dialog->window, gftp_version);
    }

  table = gtk_table_new (1, 2, FALSE);
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, TRUE, TRUE, 0);

#if GTK_MAJOR_VERSION == 1
  view = gtk_text_new (NULL, NULL);
  gtk_text_set_editable (GTK_TEXT (view), FALSE);
  gtk_text_set_word_wrap (GTK_TEXT (view), TRUE);

  gtk_table_attach (GTK_TABLE (table), view, 0, 1, 0, 1,
		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK,
		    0, 0);
  gtk_widget_show (view);

  tempwid = gtk_vscrollbar_new (GTK_TEXT (view)->vadj);
  gtk_table_attach (GTK_TABLE (table), tempwid, 1, 2, 0, 1,
		    GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
  gtk_widget_show (tempwid);

  vadj = GTK_TEXT (view)->vadj;
#else
  view = gtk_text_view_new ();
  gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);

  tempwid = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (tempwid),
                                 GTK_POLICY_AUTOMATIC,
                                 GTK_POLICY_AUTOMATIC);

  gtk_container_add (GTK_CONTAINER (tempwid), view);
  gtk_widget_show (view);

  gtk_table_attach (GTK_TABLE (table), tempwid, 0, 1, 0, 1,
		    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK,
		    0, 0);
  gtk_widget_show (tempwid);

  vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (tempwid));
#endif
  gtk_widget_set_size_request (table, 500, 400);
  gtk_widget_show (table);

#if GTK_MAJOR_VERSION == 1
  tempwid = gtk_button_new_with_label (_("  Close  "));
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), tempwid,
		      FALSE, FALSE, 0);
  gtk_signal_connect_object (GTK_OBJECT (tempwid), "clicked",
			     GTK_SIGNAL_FUNC (gtk_widget_destroy),
			     GTK_OBJECT (dialog));
  gtk_widget_show (tempwid);
#else
  g_signal_connect_swapped (GTK_OBJECT (dialog), "response",
                            G_CALLBACK (gtk_widget_destroy),
                            GTK_OBJECT (dialog));
#endif

  buf[sizeof (buf) - 1] = '\0';
  while ((n = read (fd, buf, sizeof (buf) - 1)) > 0)
    {
      buf[n] = '\0';
#if GTK_MAJOR_VERSION == 1
      gtk_text_insert (GTK_TEXT (view), NULL, NULL, NULL, buf, -1);
#else
      textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
      gtk_text_buffer_get_iter_at_offset (textbuf, &iter, -1);
      gtk_text_buffer_insert (textbuf, &iter, buf, -1);
#endif
    }

  if (doclose)
    close (fd);

  gtk_widget_show (dialog);

  if (!start_pos)
    gtk_adjustment_set_value (vadj, vadj->upper);
}
开发者ID:GNOME,项目名称:gftp,代码行数:101,代码来源:view_dialog.c


示例2: create_FileSelect


//.........这里部分代码省略.........

 gtk_widget_realize( fsFileSelect );
 gtkAddIcon( fsFileSelect );

 style=gtk_widget_get_style( fsFileSelect );
 dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm );
 fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm );

 vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 );
 hbox4=AddHBox( vbox4,1 );

 fsCombo4=gtk_combo_new();
 gtk_widget_set_name( fsCombo4,"fsCombo4" );
 gtk_widget_show( fsCombo4 );
 gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 );
 gtk_widget_set_usize( fsCombo4,-2,20 );

 fsPathCombo=GTK_COMBO( fsCombo4 )->entry;
 gtk_widget_set_name( fsPathCombo,"fsPathCombo" );
 gtk_widget_show( fsPathCombo );
 gtk_widget_set_usize( fsPathCombo,-2,20 );

 vseparator1=gtk_vseparator_new();
 gtk_widget_set_name( vseparator1,"vseparator1" );
 gtk_widget_show( vseparator1 );
 gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 );
 gtk_widget_set_usize( vseparator1,7,20 );

 upstyle=gtk_widget_get_style( fsFileSelect );
 uppixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&upmask,&upstyle->bg[GTK_STATE_NORMAL],(gchar **)up_xpm );
 uppixmapwid=gtk_pixmap_new( uppixmap,upmask );
 gtk_widget_show( uppixmapwid );

 fsUp=gtk_button_new();
 gtk_container_add( GTK_CONTAINER(fsUp ),uppixmapwid );
 gtk_widget_show( fsUp );
 gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 );
 gtk_widget_set_usize( fsUp,65,15 );

 AddHSeparator( vbox4 );

 hbox6=AddHBox( NULL,0 );
   gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 );

 fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL );
 gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" );
 gtk_widget_show( fsFNameListWindow );
 gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 );
 gtk_widget_set_usize( fsFNameListWindow,-2,145 );
 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( fsFNameListWindow ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );

 fsFNameList=gtk_clist_new( 2 );
 gtk_widget_set_name( fsFNameList,"fsFNameList" );
 gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList );
 gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 );
 gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE );
 gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) );
 gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT );

 AddHSeparator( vbox4 );

 List=gtk_combo_new();
 gtk_widget_set_name( List,"List" );
 gtk_widget_ref( List );
 gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref );
 gtk_widget_show( List );
 gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 );
 gtk_widget_set_usize( List,-2,20 );

 fsFilterCombo=GTK_COMBO( List )->entry;
 gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" );
 gtk_widget_show( fsFilterCombo );
 gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE );

 AddHSeparator( vbox4 );

 hbuttonbox3=AddHButtonBox( vbox4 );
   gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END );
   gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 );

 fsOk=AddButton( MSGTR_Ok,hbuttonbox3 );
 fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 );

 gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_Destroy ), NULL );
 gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );

 gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
 gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo );
 gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
 gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo );
 gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList );
 gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 );
 gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL );
 gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL );
 gtk_signal_connect( GTK_OBJECT( fsFNameList ),"event", (GtkSignalFunc)fs_fsFNameList_event,NULL );

 gtk_widget_grab_focus( fsFNameList );

 return fsFileSelect;
}
开发者ID:JasonFengIce,项目名称:mplayer-android,代码行数:101,代码来源:fileselect.c


示例3: gv_tool_real_activate

static void
gv_tool_real_activate(GvTool *tool, GvViewArea *view)
{
    GvToolClass *klass;
    
    if (tool->view)
    {
	g_warning("gv_tool_activate(): tool %s is already active on a view",
		  gtk_type_name(GTK_OBJECT_TYPE(tool)));
	return;
    }

    tool->view = view;
    gtk_object_ref(GTK_OBJECT(view));
    klass = (GvToolClass*)gtk_type_class(GTK_OBJECT_TYPE(tool));

    /* This could be done through an indirect function call which
       emits a tool signal.  Probably better but more overhead... */

    if (klass->draw)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "gldraw",
				  GTK_SIGNAL_FUNC(klass->draw),
				  GTK_OBJECT(tool));	
    }
    if (klass->button_press)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "button-press-event",
				  GTK_SIGNAL_FUNC(klass->button_press),
				  GTK_OBJECT(tool));
    }
    if (klass->button_release)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "button-release-event",
				  GTK_SIGNAL_FUNC(klass->button_release),
				  GTK_OBJECT(tool));
    }
    if (klass->motion_notify)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "motion-notify-event",
				  GTK_SIGNAL_FUNC(klass->motion_notify),
				  GTK_OBJECT(tool));
    }
    if (klass->key_press)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "key-press-event",
				  GTK_SIGNAL_FUNC(klass->key_press),
				  GTK_OBJECT(tool));
    }
    if (klass->enter_notify)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "enter-notify-event",
				  GTK_SIGNAL_FUNC(klass->enter_notify),
				  GTK_OBJECT(tool));
    }
    if (klass->leave_notify)
    {
	gtk_signal_connect_object(GTK_OBJECT(view), "leave-notify-event",
				  GTK_SIGNAL_FUNC(klass->leave_notify),
				  GTK_OBJECT(tool));
    }

    /* Install cursor for this tool */
    if (GTK_WIDGET_REALIZED(GTK_WIDGET(view)))
    {
	gdk_window_set_cursor(GTK_WIDGET(view)->window, tool->cursor);
    }
}
开发者ID:Onjrew,项目名称:OpenEV,代码行数:68,代码来源:gvtool.c


示例4: searchbox

/*
 * mainline..
 */
void searchbox(char *title, GtkSignalFunc func)
{
    int i;
    GtkWidget *menu, *menuitem, *optionmenu;
    GSList *group;
    GtkWidget *small_hbox;

    GtkWidget *scrolled_win;
    GtkWidget *vbox1, *hbox, *hbox0;
    GtkWidget *button1, *button2, *button3, *button3a, *button4, *button5, *button6, *button7;
    GtkWidget *label;
    gchar *titles[]={"Matches"};
    GtkWidget *frame1, *frame2, *frameh, *frameh0;
    GtkWidget *table;
    GtkTooltips *tooltips;
    GtkAdjustment *adj;
    GtkWidget *align;

    if(is_active) 
	{
	gdk_window_raise(window->window);
	return;
	}

    is_active=1;
    cleanup=func;
    num_rows=selected_rows=0;

    /* create a new modal window */
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW (window), title);
    gtk_signal_connect(GTK_OBJECT (window), "delete_event",
                       (GtkSignalFunc) destroy_callback, NULL);

    tooltips=gtk_tooltips_new_2();

    table = gtk_table_new (256, 1, FALSE);
    gtk_widget_show (table);

    vbox1 = gtk_vbox_new (FALSE, 0);
    gtk_container_border_width (GTK_CONTAINER (vbox1), 3);
    gtk_widget_show (vbox1);
    frame1 = gtk_frame_new (NULL);
    gtk_container_border_width (GTK_CONTAINER (frame1), 3);
    gtk_widget_show(frame1);
    gtk_table_attach (GTK_TABLE (table), frame1, 0, 1, 0, 1,
                        GTK_FILL | GTK_EXPAND,
                        GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1);

    label=gtk_label_new("Signal Search Expression");
    gtk_widget_show(label);

    gtk_box_pack_start (GTK_BOX (vbox1), label, TRUE, TRUE, 0);

    entry = gtk_entry_new_with_max_length (256);
    gtk_signal_connect(GTK_OBJECT(entry), "activate",
		       GTK_SIGNAL_FUNC(enter_callback),
		       entry);
    gtk_entry_set_text (GTK_ENTRY (entry), searchbox_text);
    gtk_entry_select_region (GTK_ENTRY (entry),
			     0, GTK_ENTRY(entry)->text_length);
    gtk_widget_show (entry);
    gtk_tooltips_set_tip_2(tooltips, entry, 
		"Enter search expression here.  POSIX Wildcards are allowed.  Note that you may also "
		"modify the search criteria by selecting ``[W]Range'', ``[W]Strand'', or ``None'' for suffix "
		"matching.",NULL);

    gtk_box_pack_start (GTK_BOX (vbox1), entry, TRUE, TRUE, 0);

    /* Allocate memory for the data that is used later */
    pdata = calloc_2(1, sizeof(SearchProgressData) );
    pdata->value = pdata->oldvalue = 0.0;
    /* Create a centering alignment object */  
    align = gtk_alignment_new (0.5, 0.5, 0, 0);
    gtk_widget_show(align);
    /* Create a Adjustment object to hold the range of the
     * progress bar */
    adj = (GtkAdjustment *) gtk_adjustment_new (0.0, 0.0, (gfloat)((numfacs>1)?numfacs-1:1), 0, 0, 0);
    pdata->adj = adj;
    /* Create the GtkProgressBar using the adjustment */
    pdata->pbar = gtk_progress_bar_new_with_adjustment (adj);
    /* Set the format of the string that can be displayed in the
     * trough of the progress bar:
     * %p - percentage
     * %v - value
     * %l - lower range value
     * %u - upper range value */
    gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar), "(%p%%)");
    gtk_progress_set_show_text (GTK_PROGRESS (pdata->pbar), TRUE);
    gtk_widget_show(pdata->pbar);
    gtk_box_pack_start (GTK_BOX (vbox1), pdata->pbar, TRUE, TRUE, 0);

    gtk_container_add (GTK_CONTAINER (frame1), vbox1);


    frame2 = gtk_frame_new (NULL);
    gtk_container_border_width (GTK_CONTAINER (frame2), 3);
//.........这里部分代码省略.........
开发者ID:embisi-github,项目名称:embisi_gip,代码行数:101,代码来源:search.c


示例5: main

int main(int argc, char *argv[]){

 GtkWidget *window1;
 GtkWidget *vbox1;
 GtkWidget *scrollw1;
 GtkWidget *active_plot;
 GtkWidget *canvas;
 gint page_width, page_height;
 gfloat scale = 1.;
 GtkPlotDTnode p;
 GtkPlotDT *dtdata;
 char buffer[1000];
 FILE *f;
 gdouble xmin=1e99;
 gdouble xmax=-1e99;
 gdouble ymin=1e99;
 gdouble ymax=-1e99;
 gdouble dx,dy;
 gint num_triangles = 0;
 
 page_width = GTK_PLOT_LETTER_W * scale;
 page_height = GTK_PLOT_LETTER_H * scale;
 
 gtk_init(&argc,&argv);

 window1=gtk_window_new(GTK_WINDOW_TOPLEVEL);
 gtk_window_set_title(GTK_WINDOW(window1), "GtkPlotFlux Demo");
 gtk_widget_set_usize(window1,550,650);
 gtk_container_border_width(GTK_CONTAINER(window1),0);

 gtk_signal_connect (GTK_OBJECT (window1), "destroy",
		     GTK_SIGNAL_FUNC (quit), NULL);

 vbox1=gtk_vbox_new(FALSE,0);
 gtk_container_add(GTK_CONTAINER(window1),vbox1);
 gtk_widget_show(vbox1);

 scrollw1=gtk_scrolled_window_new(NULL, NULL);
 gtk_container_border_width(GTK_CONTAINER(scrollw1),0);
 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollw1),
				GTK_POLICY_ALWAYS,GTK_POLICY_ALWAYS);
 gtk_box_pack_start(GTK_BOX(vbox1),scrollw1, TRUE, TRUE,0);
 gtk_widget_show(scrollw1);

 canvas = gtk_plot_canvas_new(page_width, page_height, 1.);
 GTK_PLOT_CANVAS_SET_FLAGS(GTK_PLOT_CANVAS(canvas), GTK_PLOT_CANVAS_DND_FLAGS);
 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrollw1), canvas);

/*
 gdk_color_parse("light blue", &color);
 gdk_color_alloc(gtk_widget_get_colormap(canvas), &color);
 gtk_plot_canvas_set_background(GTK_PLOT_CANVAS(canvas), &color);
*/

 gtk_widget_show(canvas);

 if (argc!=2) {
   fprintf(stderr,"\nUsage:\n\ttestgtkplotdt X-Y-FILE\n");
   exit(-1);
 }
 if (!(f=fopen(argv[1],"r"))) {
   fprintf(stderr,"\ncould not open file '%s' for reading\n",argv[1]);
   exit(-2);
 }
 
 /* init with nodelist size 0 */
 dtdata= GTK_PLOT_DT(gtk_plot_dt_new(0));
 if (!dtdata) exit(-1);
 /* register the progressmeter */
 dtdata->pbar= simpleprogressbar;
 
 /* read X/Y pairs from f: */
 while (fgets(buffer,1000,f)) {
   if (sscanf(buffer,"%lf %lf", &p.x, &p.y)==2) {
     /* add this node */
     gtk_plot_dt_add_node(dtdata,p);
     if (xmin>p.x) xmin= p.x;
     if (xmax<p.x) xmax= p.x;
     if (ymin>p.y) ymin= p.y;
     if (ymax<p.y) ymax= p.y;
   }
 }
 dx= (xmax-xmin)*.02;
 dy= (ymax-ymin)*.02;
 fclose(f);
 /* start the triangulation */
 fprintf(stderr,"data ranges from (%g,%g) to (%g,%g)\n",
	 xmin,ymin,xmax,ymax);
 num_triangles= gtk_plot_dt_triangulate(dtdata);

 active_plot = new_layer(canvas);
 gtk_plot_set_range(GTK_PLOT(active_plot), xmin-dx, xmax+dx, ymin-dy, ymax+dy);
 gtk_plot_legends_move(GTK_PLOT(active_plot), .500, .05);
 gtk_plot_set_legends_border(GTK_PLOT(active_plot), 0, 0);
 gtk_plot_axis_hide_title(GTK_PLOT(active_plot), GTK_PLOT_AXIS_TOP);
 gtk_plot_axis_show_ticks(GTK_PLOT(active_plot), 3, 15, 3);
 gtk_plot_axis_set_ticks(GTK_PLOT(active_plot), 0, (xmax-xmin)/10., 1);
 gtk_plot_axis_set_ticks(GTK_PLOT(active_plot), 1, (ymax-ymin)/10., 1);
 gtk_plot_axis_set_visible(GTK_PLOT(active_plot), GTK_PLOT_AXIS_TOP, TRUE);
 gtk_plot_axis_set_visible(GTK_PLOT(active_plot), GTK_PLOT_AXIS_RIGHT, TRUE);
//.........这里部分代码省略.........
开发者ID:Onjrew,项目名称:OpenEV,代码行数:101,代码来源:testgtkplotdt.c


示例6: do_menu

void
do_menu (GtkWidget * vbox)
{
    GtkWidget *menu_bar, *menu, *smenu;
    GtkWidget *mi;
    GtkWidget *handlebox;

    menu_bar = gtk_menu_bar_new ();

    menu = gtk_menu_item_new_with_label (_("File"));
    gtk_widget_show (menu);
    smenu = gtk_menu_new ();
    gtk_widget_show (smenu);
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), smenu);

    mi = gtk_menu_item_new_with_label (_("C-Wizard"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate", GTK_SIGNAL_FUNC (clist),
	NULL);
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);


    mi = gtk_menu_item_new_with_label (_("Connect"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate", GTK_SIGNAL_FUNC (cbox),
	NULL);
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);

    mi = gtk_menu_item_new_with_label (_("Disconnect"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate",
	GTK_SIGNAL_FUNC (disconnect), NULL);
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);

    mi = gtk_menu_item_new ();
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);

    /*
    mi = gtk_menu_item_new_with_label (_("Preferences..."));
    gtk_signal_connect (GTK_OBJECT (mi), "activate",
	GTK_SIGNAL_FUNC (show_config), NULL);
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);
    */

    mi = gtk_menu_item_new ();
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);

    mi = gtk_menu_item_new_with_label (_("Exit"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate",
	GTK_SIGNAL_FUNC (bmud_exit), NULL);
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);
    gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), menu);

    menu = gtk_menu_item_new_with_label (_("Tools"));
    gtk_widget_show (menu);
    smenu = gtk_menu_new ();
    gtk_widget_show (smenu);
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), smenu);
    mi = gtk_menu_item_new_with_label (_("Equip"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate", GTK_SIGNAL_FUNC (NULL),
	NULL);
    gtk_widget_set_sensitive (GTK_WIDGET (mi), FALSE);

    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);
    mi = gtk_menu_item_new_with_label (_("Map"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate", GTK_SIGNAL_FUNC (NULL),
	NULL);
    gtk_widget_set_sensitive (GTK_WIDGET (mi), FALSE);

    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);
    gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), menu);

    menu = gtk_menu_item_new_with_label (_("Help"));
    gtk_widget_show (menu);
    gtk_menu_item_right_justify (GTK_MENU_ITEM (menu));
    smenu = gtk_menu_new ();
    gtk_widget_show (smenu);
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), smenu);
    mi = gtk_menu_item_new_with_label (_("About"));
    gtk_signal_connect (GTK_OBJECT (mi), "activate",
	GTK_SIGNAL_FUNC (do_about), NULL);
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);
    mi = gtk_menu_item_new_with_label (_("Manual"));	/* I d'no about this one */

/*	gtk_signal_connect(GTK_OBJECT(mi),"activate",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);	*/
    gtk_widget_show (mi);
    gtk_menu_append (GTK_MENU (smenu), mi);
    gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), menu);

    gtk_widget_show (menu_bar);

    handlebox = gtk_handle_box_new ();
    gtk_widget_show (handlebox);
//.........这里部分代码省略.........
开发者ID:erikg,项目名称:bmud,代码行数:101,代码来源:gtk-compat.c


示例7: DIA_getASharp

//
//      Video is in YV12 Colorspace
//
//
uint8_t DIA_getASharp(ASHARP_PARAM *param, AVDMGenericVideoStream *in)
{
        int ret;
        uint32_t l,f;
        uint32_t max=in->getInfo()->nb_frames;
        
        incoming=in;
        // Allocate space for green-ised video
        w=in->getInfo()->width;
        h=in->getInfo()->height;

        rgbbuffer=new uint32_t[w*h];

        imgdst=new ADMImage(w,h);
        imgsrc=new ADMImage(w,h);
        imgdisplay=new ADMImage(w,h);

        if(curframe<max) max=curframe;
        
        ADM_assert(in->getFrameNumberNoAlloc(max, &l, imgsrc,&f));
        // chroma is not changed by this filter
        
        memcpy(UPLANE(imgdisplay),UPLANE(imgsrc),(w*h)>>2);
        memcpy(VPLANE(imgdisplay),VPLANE(imgsrc),(w*h)>>2);
        memcpy(&myHue,param,sizeof(myHue));
        dialog=create_dialog1();
        gtk_register_dialog(dialog);

        gtk_widget_set_usize(WID(drawingarea1), w,h);

        upload();
        gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
            GTK_SIGNAL_FUNC(draw),
            NULL);
//
        gtk_signal_connect(GTK_OBJECT(WID(hscale1)), "value_changed",GTK_SIGNAL_FUNC(frame_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(spinbuttonT)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(spinbuttonD)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(spinbuttonB)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
     //   gtk_signal_connect(GTK_OBJECT(WID(checkbuttonBF)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
        gtk_widget_show(dialog);

        update();
        draw();
        ret=0;
        int response;
        response=gtk_dialog_run(GTK_DIALOG(dialog));

        if(response==GTK_RESPONSE_OK)
        {
            memcpy(param,&myHue,sizeof(myHue));
            ret=1;
        }
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
    
        delete imgdst;
        delete imgsrc;
        delete imgdisplay;
        delete [] rgbbuffer;
        

        rgbbuffer=NULL;
        imgdst=NULL;
        imgsrc=NULL;
        dialog=NULL;
        imgdisplay=NULL;
        return ret;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:73,代码来源:DIA_asharp.cpp


示例8: create_term_menu

GtkWidget *
create_term_menu(ZvtTerm *term, gchar *command)
{
	GtkWidget *menu_bar;
	GtkWidget *menu;
	GtkWidget *menu_item;
	GtkWidget *vide_menu;
	GtkWidget *tools_menu;
	GtkWidget *term_label;
	GdkColor color = TAB_COLOR;
	GtkStyle *defstyle;
	GtkStyle *style = gtk_style_new();

	menu_bar = gtk_menu_bar_new();

	defstyle = gtk_widget_get_default_style();
	style = gtk_style_copy(defstyle);
	style->fg[0] = color;

	menu = gtk_menu_new();
	gtk_signal_connect(GTK_OBJECT(menu), "key_press_event",
			GTK_SIGNAL_FUNC(menu_key_cb), NULL);

	gtk_object_set_data(GTK_OBJECT(term), "menu_bar", menu_bar);

	
	/* The terminal is running vi */
	if(GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(term))))
	{
		add_menu_item(menu, "Open File in Buffer", create_fileselector,
				GUINT_TO_POINTER(0));
		if(strcmp(cfg.vi_clone, "vi"))
  		add_menu_item (menu, "Split Buffer & Open File", create_fileselector,
					GUINT_TO_POINTER(1));
		if(!strcmp(cfg.vi_clone, "vim"))
			add_menu_item (menu, "VSplit Buffer & Open File", create_fileselector,
					GUINT_TO_POINTER(2));
  	add_menu_separator (menu);
	}
	add_menu_item(menu, "Open File in New Term", 
			create_fileselector, GUINT_TO_POINTER(3));
  add_menu_separator (menu);
	add_menu_item(menu, "New Shell", split_zterm, NULL);
	add_menu_separator(menu);
	add_menu_item(menu, "List Pages", create_page_menu, NULL);
	add_menu_separator(menu);
	add_menu_item(menu, "Detach Term", detach_term, term);
	add_menu_separator(menu);
  add_menu_item (menu, "Cancel", NULL, NULL);
  vide_menu = add_submenu (menu_bar, "_Vide", menu);
	gtk_object_set_data(GTK_OBJECT(term), "vide_menu", vide_menu);

	menu = gtk_menu_new();
	gtk_signal_connect(GTK_OBJECT(menu), "key_press_event",
			GTK_SIGNAL_FUNC(menu_key_cb), NULL);
	add_menu_item(menu, "Look up word", lookup_word, term);
	add_menu_separator(menu);

	/* 
	add_menu_item(menu, "Compare file to..", compare_file, term);
	add_menu_separator(menu);
	*/

	/* I don't know how to visually select text in nvi and vile 
	if((!strcmp("vim", cfg.vi_clone) | (!strcmp("elvis", cfg.vi_clone))))
	{
		add_menu_item(menu, "Copy", copy_text, term);
		add_menu_separator(menu);
		add_menu_item(menu, "Paste", paste_text, term);
		add_menu_separator(menu);
	}
	*/
	add_menu_item(menu, "Cancel", NULL, NULL);
	tools_menu = add_submenu(menu_bar, "_Tools", menu);
	gtk_object_set_data(GTK_OBJECT(term), "tools_menu", tools_menu);

	/* label for filename on menubar */
	menu = gtk_menu_new();
	menu_item = gtk_menu_item_new();
	term_label = gtk_widget_new(GTK_TYPE_LABEL,
			"GtkWidget::visible", TRUE,
			"GtkWidget::parent", menu_item,
			"GtkMisc::xalign", 0, 0, NULL);
	gtk_label_set_text(GTK_LABEL(term_label), command);
	gtk_widget_set_style(GTK_WIDGET(term_label), style);
	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), menu);
	gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), menu_item);
	gtk_menu_item_right_justify(GTK_MENU_ITEM(menu_item));
	gtk_widget_show(menu_item);
	gtk_object_set_data(GTK_OBJECT(term), "term_label", term_label);


	return  menu_bar;


}
开发者ID:xaizek,项目名称:vide,代码行数:96,代码来源:term_menu.c


示例9: detach_term

static void
detach_term(GtkWidget *widget, ZvtTerm *term)
{
	GtkWidget *term_window;
	GtkWidget *menu_bar;
	GtkWidget *vbox;
	GtkWidget *term_label;
	gchar *label_text;
	gint term_count;
	guint child_died_signal_id;
	guint title_change_signal;

	vbox = gtk_object_get_data(GTK_OBJECT(term), "vbox");
	term_count = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(vbox),
				"term_count"));
	child_died_signal_id = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(term),
				"child_died_signal_id"));
	gtk_signal_disconnect(GTK_OBJECT(term), child_died_signal_id);
	title_change_signal = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(term),
				"title_change_signal"));
	gtk_signal_disconnect(GTK_OBJECT(term), title_change_signal);
	term_label = gtk_object_get_data(GTK_OBJECT(term), "term_label");
	gtk_label_get(GTK_LABEL(term_label), &label_text);

	term_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title(GTK_WINDOW(term_window), label_text);
	gtk_signal_connect(GTK_OBJECT(term_window), "delete-event",
			GTK_SIGNAL_FUNC(gtk_widget_destroy), term_window);
	gtk_widget_realize(term_window);


	menu_bar = gtk_object_get_data(GTK_OBJECT(term), "menubar");
	gtk_widget_destroy(menu_bar);

	/* Need to use ref and unref with reparent here - don't know why? */
	gtk_widget_ref(GTK_WIDGET(term));
	gtk_widget_reparent(GTK_WIDGET(term), term_window);
	gtk_widget_unref(GTK_WIDGET(term));

	gtk_signal_connect(GTK_OBJECT(term), "child_died",
			GTK_SIGNAL_FUNC(close_term_window), NULL);
	gtk_signal_connect(GTK_OBJECT(term), "title_changed",
			GTK_SIGNAL_FUNC(change_title), term_window);

	
	gtk_widget_grab_focus(GTK_WIDGET(term));

	gtk_widget_show(term_window);

	if(term_count > 1)
	{
		GList *child, *tmp;
		ZvtTerm *tmp_term;
		GtkWidget *ch;
		GtkWidget *page_label;
		GtkWidget *term_label;
		char *label_text;
		gchar buf[NAME_MAX];

		term_count--;
		gtk_object_set_data(GTK_OBJECT(vbox), "term_count",
				GUINT_TO_POINTER(term_count));
		child = GTK_BOX(vbox)->children;

		term_count = 0;
		for(tmp = child; tmp != NULL; tmp = tmp->next)
		{
			ch = ((GtkBoxChild*)(tmp->data))->widget;
			if(ZVT_IS_TERM(ch))
			{
				term_count++;
				gtk_object_set_data(GTK_OBJECT(ch), "term_number",
							GUINT_TO_POINTER(term_count));
			}
		}
		tmp_term = get_nth_zvt(GTK_NOTEBOOK(app.notebook),
				gtk_notebook_get_current_page(GTK_NOTEBOOK(app.notebook)));
		term_count = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(tmp_term),
					"term_number"));
		gtk_object_set_data(GTK_OBJECT(vbox), "focus_term", 
				GUINT_TO_POINTER(term_count));
		cfg.current_term = tmp_term;
		term_label = gtk_object_get_data(GTK_OBJECT(tmp_term), "term_label");
	 	page_label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(app.notebook),
		gtk_notebook_get_nth_page(GTK_NOTEBOOK(app.notebook), 
		gtk_notebook_get_current_page(GTK_NOTEBOOK(app.notebook))));
		gtk_label_get(GTK_LABEL(term_label), &label_text);
		g_snprintf(buf, sizeof(buf), "%d %s",
				gtk_notebook_get_current_page(GTK_NOTEBOOK(app.notebook)) +1,
			 label_text);
		gtk_label_set_text(GTK_LABEL(page_label), buf);


		gtk_widget_grab_focus(GTK_WIDGET(tmp_term));


	}
	else
	{
		gint page;
//.........这里部分代码省略.........
开发者ID:xaizek,项目名称:vide,代码行数:101,代码来源:term_menu.c


示例10: l_mater1

int   l_mater1(iceb_u_str *kod,iceb_u_str *naim,
int skl_poi, // склад
const char *grup,
int metka_skl, //0-все 1-только материалы карточки которых есть на складе
int metka_cen, //0-с нулевой ценой не выбирать 1-выбирать с любой ценой
GtkWidget *wpredok)
{
printf("l_mater1-%s\n",naim->ravno());

class mater1_data data;
char bros[512];
GdkColor color;

data.poisk.clear_zero();

data.skl_poi=skl_poi;
data.metka_skl=metka_skl;
data.poisk.grupa.new_plus(grup);
data.metka_cen=metka_cen;

if(naim->getdlinna() > 1)
 {
  data.poisk.metka_poi=1;
  data.poisk.naim.new_plus(naim->ravno());
 }
data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

//gtk_window_set_default_size (GTK_WINDOW  (data.window),400,-1);
//gdk_color_parse("black",&color);
//gtk_widget_modify_bg(data.window,GTK_STATE_NORMAL,&color);


sprintf(bros,"%s %s",name_system,gettext("Список материаллов"));

gtk_window_set_title (GTK_WINDOW (data.window),bros);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(mater1_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox);

data.label_kolstr=gtk_label_new (gettext("Список материалов"));
//gdk_color_parse("green",&color);
//gtk_widget_modify_fg(data.label_kolstr,GTK_STATE_NORMAL,&color);


gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);

data.label_sklad=gtk_label_new ("");
data.label_poisk=gtk_label_new ("");
gdk_color_parse("red",&color);
gtk_widget_modify_fg(data.label_poisk,GTK_STATE_NORMAL,&color);
gtk_widget_modify_fg(data.label_sklad,GTK_STATE_NORMAL,&color);

gtk_box_pack_start (GTK_BOX (vbox2),data.label_sklad,FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2),data.label_poisk,FALSE, FALSE, 0);

data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),400,300);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];

sprintf(bros,"F2 %s",gettext("Запись"));
data.knopka[FK2]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(mater1_knopka),&data);
//.........这里部分代码省略.........
开发者ID:zaharchuktv,项目名称:linuxbuh,代码行数:101,代码来源:l_mater1.c


示例11: gb_gnome_dialog_new

/*
 * Creates a new GtkWidget of class GnomeDialog, 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_gnome_dialog_new (GbWidgetNewData *data)
{
  GtkWidget *new_widget, *placeholder;
  GList *elem;

  if (data->action == GB_CREATING)
    {
      /* When creating a new dialog, we add a few standard buttons, which
	 the user can change/delete easily. */
      new_widget = gnome_dialog_new (NULL,
				     GTK_STOCK_CANCEL,
				     GTK_STOCK_OK,
				     NULL);

      /* Now turn the buttons into GbWidgets so the user can edit them. */
      elem = GNOME_DIALOG (new_widget)->buttons;
      gb_widget_create_from (GTK_WIDGET (elem->data), "button");
      gtk_object_set_data (GTK_OBJECT (elem->data), GladeButtonStockIDKey,
			   GTK_STOCK_CANCEL);

      elem = elem->next;
      gb_widget_create_from (GTK_WIDGET (elem->data), "button");
      gtk_object_set_data (GTK_OBJECT (elem->data), GladeButtonStockIDKey,
			   GTK_STOCK_OK);

      /* We need to size the placeholders or the dialog is very small. */
      placeholder = editor_new_placeholder ();
      gtk_widget_set_usize (placeholder, 300, 200);
      gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (new_widget)->vbox),
			  placeholder, TRUE, TRUE, 0);
    }
  else
    {
      /* When loading we create the bare dialog with no buttons. */
      new_widget = gnome_dialog_new (NULL, NULL);
    }

  gb_widget_create_from (GNOME_DIALOG (new_widget)->vbox,
			 data->action == GB_CREATING ? "dialog-vbox" : NULL);
  gb_widget_set_child_name (GNOME_DIALOG (new_widget)->vbox, GladeChildDialogVBox);

  gb_widget_create_from (GNOME_DIALOG (new_widget)->action_area,
			 data->action == GB_CREATING ? "dialog-action_area"
						     : NULL);
  gb_widget_set_child_name (GNOME_DIALOG (new_widget)->action_area,
			    GladeChildDialogActionArea);

  /* We connect a close signal handler which always returns TRUE so that
     the built-in close functionality is skipped. */
  gtk_signal_connect (GTK_OBJECT (new_widget), "close",
		      GTK_SIGNAL_FUNC (gtk_true), NULL);

  /* Now we connect our normal delete_event handler. */
  gtk_signal_connect (GTK_OBJECT (new_widget), "delete_event",
		      GTK_SIGNAL_FUNC (editor_close_window), NULL);

  gtk_object_set_data (GTK_OBJECT (new_widget), TypeHint,
		       GINT_TO_POINTER (GLADE_TYPE_HINT_DIALOG_INDEX));

  return new_widget;
}
开发者ID:jubalh,项目名称:deadbeef,代码行数:69,代码来源:gnomedialog.c


示例12: dialogGameFinderCreate


//.........这里部分代码省略.........
  gtk_widget_ref (button6);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "button6", button6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button6);
  gtk_table_attach (GTK_TABLE (table1), button6, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  idc_gamefindjoin = gtk_button_new_with_label ("Join");
  gtk_widget_ref (idc_gamefindjoin);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "idc_gamefindjoin", idc_gamefindjoin,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_gamefindjoin);
  gtk_table_attach (GTK_TABLE (table1), idc_gamefindjoin, 3, 4, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_widget_set_sensitive (idc_gamefindjoin, FALSE);

  idc_gamefindrejoin = gtk_button_new_with_label ("Rejoin");
  gtk_widget_ref (idc_gamefindrejoin);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "idc_gamefindrejoin", idc_gamefindrejoin,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_gamefindrejoin);
  gtk_table_attach (GTK_TABLE (table1), idc_gamefindrejoin, 3, 4, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_widget_set_sensitive (idc_gamefindrejoin, FALSE);

  button7 = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (button7);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "button7", button7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button7);
  gtk_table_attach (GTK_TABLE (table1), button7, 3, 4, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label13 = gtk_label_new ("");
  gtk_widget_ref (label13);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "label13", label13,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label13);
  gtk_table_attach (GTK_TABLE (table1), label13, 1, 2, 1, 2,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);

  label14 = gtk_label_new ("");
  gtk_widget_ref (label14);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "label14", label14,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label14);
  gtk_table_attach (GTK_TABLE (table1), label14, 1, 2, 2, 3,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);

  label12 = gtk_label_new ("                                                            ");
  gtk_widget_ref (label12);
  gtk_object_set_data_full (GTK_OBJECT (dialogGameFinder), "label12", label12,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table1), label12, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  /* Signals */
//  gtk_signal_connect (GTK_OBJECT(list1), "select", GTK_SIGNAL_FUNC(dialogGameFinderSelect), NULL);
  gtk_signal_connect(GTK_OBJECT(dialogGameFinder), "show", GTK_SIGNAL_FUNC(dialogGameFinderShow), 0);
  gtk_signal_connect(GTK_OBJECT(button1), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderTracker), 0);
  gtk_signal_connect(GTK_OBJECT(button8), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderSetName), 0);
   gtk_signal_connect(GTK_OBJECT(button4), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderRefresh), 0);
  gtk_signal_connect(GTK_OBJECT(button7), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderCancel), 0);
  gtk_signal_connect(GTK_OBJECT(button9), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderMOTD), 0);
  gtk_signal_connect(GTK_OBJECT(dialogGameFinder), "delete_event", GTK_SIGNAL_FUNC(dialogGameFinderCancel), 0);
  gtk_signal_connect(GTK_OBJECT(idc_gamefindrejoin), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderReJoin), 0);
  gtk_signal_connect(GTK_OBJECT(idc_gamefindjoin), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderJoin), 0);
  gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderJoinByAddress), 0);
  gtk_signal_connect(GTK_OBJECT(button6), "clicked", GTK_SIGNAL_FUNC(dialogGameFinderNew), 0);
  /* My Stuff */
  cg = currentGamesCreate();
  if (useTracker == TRUE) {
    strcpy(motd, langGetText(STR_DLGGAMEFINDER_REFRESHFIRST));
  } else {
    gtk_widget_set_sensitive (button1, FALSE);
    gtk_widget_set_sensitive (button9, FALSE);
  }

  dialogGameFindUs = dialogGameFinder;
  gtk_misc_set_alignment (GTK_MISC (idc_address), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindport), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindversion), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindnumplayers), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindtype), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindbases), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindmines), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindmapname), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindpills), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindpass), 0, 0.5);
  gtk_misc_set_alignment (GTK_MISC (idc_gamefindbrains), 0, 0.5);

  return dialogGameFinder;
}
开发者ID:1taplay,项目名称:winbolo,代码行数:101,代码来源:dialoggamefinder.c


示例13: l_klient_imp

int l_klient_imp(const char *imaf,
GtkWidget *wpredok)
{
char strsql[500];
iceb_u_spisok repl_s;
class l_klient_imp_data data;

data.imafz.new_plus(imaf);

data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_default_size (GTK_WINDOW  (data.window),400,-1);
sprintf(strsql,"%s %s",name_system,gettext("Импорт карточек из файла"));

gtk_window_set_title(GTK_WINDOW(data.window),strsql);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_klient_imp_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *vbox=gtk_vbox_new(FALSE, 2);

gtk_container_add(GTK_CONTAINER(data.window), vbox);

data.label=gtk_label_new(gettext("Ждите !!!"));

gtk_box_pack_start(GTK_BOX(vbox),data.label,FALSE,FALSE,0);

GtkWidget *label=NULL;

label=gtk_label_new(gettext("Импорт карточек из файла"));
gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);

data.view=gtk_text_view_new();
gtk_widget_set_usize(GTK_WIDGET(data.view),450,300);

gtk_text_view_set_editable(GTK_TEXT_VIEW(data.view),FALSE); //Запрет на редактирование текста
//PangoFontDescription *font_pango=pango_font_description_from_string("Nimbus Mono L, Bold 12");
PangoFontDescription *font_pango=pango_font_description_from_string(shrift_ravnohir.ravno());
gtk_widget_modify_font(GTK_WIDGET(data.view),font_pango);
pango_font_description_free(font_pango);

data.buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(data.view));

GtkWidget *sw=gtk_scrolled_window_new(NULL,NULL);
//gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),GTK_POLICY_ALWAYS,GTK_POLICY_ALWAYS);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_container_add(GTK_CONTAINER(sw),data.view);

data.bar=gtk_progress_bar_new();

gtk_progress_bar_set_bar_style(GTK_PROGRESS_BAR(data.bar),GTK_PROGRESS_CONTINUOUS);

gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(data.bar),GTK_PROGRESS_LEFT_TO_RIGHT);

gtk_box_pack_start (GTK_BOX (vbox), data.bar, FALSE, FALSE, 2);



sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka=gtk_button_new_with_label(strsql);
GtkTooltips *tooltops=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltops,data.knopka,gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data. 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_SOCKET函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_SCROLLED_WINDOW函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap