Exemplo n.º 1
0
void open_file_dlg(NKEdit *doc)
{

  if (doc->changed) {
    confir_save_dlg(doc, FROM_OPEN_FILE_DLG);
    return;
  }

  file_dlg = gtk_file_selection_new(_("Numakiti: Open..."));
  gtk_window_set_modal(GTK_WINDOW(file_dlg), TRUE);
  GTK_WINDOW(file_dlg)->type = GTK_WINDOW_DIALOG;
  gtk_signal_connect_object(GTK_OBJECT(file_dlg), "destroy",
		            GTK_SIGNAL_FUNC(gtk_widget_destroy),
			    GTK_OBJECT(file_dlg));
  gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(file_dlg)->ok_button),
			    "clicked", GTK_SIGNAL_FUNC(open_dlg_ok),
			    doc);
  gtk_signal_connect_object(GTK_OBJECT(
                            GTK_FILE_SELECTION(file_dlg)->cancel_button),
			    "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
			    GTK_OBJECT(file_dlg));
  gtk_widget_show(file_dlg);

  return;
}
Exemplo n.º 2
0
/* Create actual buttons */
GtkWidget *
create_discard_buttons (void)
{
GtkWidget *table;
GtkWidget *table2;
GtkWidget *frame;
GtkWidget *main_vbox;
GtkWidget *b1;
GtkWidget *b2;
GtkWidget *pixmapwid1, *pixmapwid2;

GtkTooltips *tooltips;

tooltips=gtk_tooltips_new_2();
gtk_tooltips_set_delay_2(tooltips,1500);

pixmapwid1=gtk_pixmap_new(larrow_pixmap, larrow_mask);
gtk_widget_show(pixmapwid1);
pixmapwid2=gtk_pixmap_new(rarrow_pixmap, rarrow_mask);
gtk_widget_show(pixmapwid2);
   
/* Create a table to hold the text widget and scrollbars */
table = gtk_table_new (1, 1, FALSE);

main_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (main_vbox), 1);
gtk_container_add (GTK_CONTAINER (table), main_vbox);

frame = gtk_frame_new ("Disc ");
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0);

gtk_widget_show (frame);
gtk_widget_show (main_vbox);

table2 = gtk_table_new (2, 1, FALSE);

b1 = gtk_button_new();
gtk_container_add(GTK_CONTAINER(b1), pixmapwid1);
gtk_table_attach (GTK_TABLE (table2), b1, 0, 1, 0, 1,
			GTK_FILL | GTK_EXPAND,
		      	GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1);
gtk_signal_connect_object (GTK_OBJECT (b1), "clicked",
              		GTK_SIGNAL_FUNC(discard_left), GTK_OBJECT (table2));
gtk_tooltips_set_tip_2(tooltips, b1, "Increase 'From' Time", NULL);
gtk_widget_show(b1);

b2 = gtk_button_new();
gtk_container_add(GTK_CONTAINER(b2), pixmapwid2);
gtk_table_attach (GTK_TABLE (table2), b2, 0, 1, 1, 2,
		      	GTK_FILL | GTK_EXPAND,
		      	GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1);
gtk_signal_connect_object (GTK_OBJECT (b2), "clicked",
               		GTK_SIGNAL_FUNC(discard_right), GTK_OBJECT (table2));
gtk_tooltips_set_tip_2(tooltips, b2, "Decrease 'To' Time", NULL);
gtk_widget_show(b2);

gtk_container_add (GTK_CONTAINER (frame), table2);
gtk_widget_show(table2);
return(table);
}
Exemplo n.º 3
0
void make_menus(GtkWidget *box)
{
	GtkWidget *menu, *menu_bar, *root_menu, *menu_items;

	/* FILE menu */
	menu = gtk_menu_new ();
	menu_items = gtk_menu_item_new_with_label ("Open");
	gtk_menu_append (GTK_MENU (menu), menu_items);
	gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate",
		GTK_SIGNAL_FUNC(open_func), NULL);
	gtk_widget_show(menu_items);
	menu_items = gtk_menu_item_new_with_label ("Exit");
	gtk_menu_append (GTK_MENU (menu), menu_items);
	gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate",
		GTK_SIGNAL_FUNC(exit_func), NULL);
	gtk_widget_show(menu_items);
	root_menu = gtk_menu_item_new_with_label ("File");
	gtk_widget_show (root_menu);
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);

	menu_bar = gtk_menu_bar_new ();
	gtk_box_pack_start (GTK_BOX (box), menu_bar, FALSE, FALSE, 0);
	gtk_widget_show (menu_bar);
	gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), root_menu);

	/* OPTIONS menu */
	menu = gtk_menu_new ();
	menu_items = gtk_menu_item_new_with_label ("Options");
	gtk_menu_append (GTK_MENU (menu), menu_items);
	gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate",
		GTK_SIGNAL_FUNC(open_options_window), NULL);
	gtk_widget_show(menu_items);
//	root_menu = gtk_menu_item_new_with_label ("Options");
//	gtk_widget_show (root_menu);

	root_menu = gtk_menu_item_new_with_label ("Options");
	gtk_widget_show (root_menu);

	gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);
	gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), root_menu);

	/* HELP menu */
	menu = gtk_menu_new ();
	menu_items = gtk_menu_item_new_with_label ("About");
	gtk_menu_append (GTK_MENU (menu), menu_items);
	gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate",
		GTK_SIGNAL_FUNC(open_about_menu), NULL);
	gtk_widget_show(menu_items);
	menu_items = gtk_menu_item_new_with_label ("Help");
	gtk_menu_append (GTK_MENU (menu), menu_items);
	gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate",
		GTK_SIGNAL_FUNC(open_help_menu), NULL);
	gtk_widget_show(menu_items);

	root_menu = gtk_menu_item_new_with_label ("Help");
	gtk_widget_show (root_menu);
	//gtk_menu_item_right_justify(GTK_MENU_ITEM(root_menu)); //(for later)
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);
	gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), root_menu);
}
Exemplo n.º 4
0
/*----------------------------------------------------------------------------------------------------------------------*/
void SaveAsS(GtkWidget *W,gpointer Unused)
{
GtkWidget *Label,*But,*Win;
char Str[MAX_FNAME_LENGTH+20];

if (strlen(FileX->Path)+strlen(FileX->TargetFile)+1>MAX_FNAME_LENGTH) 
   { Attention(0,"ERROR: MAX_FNAME_LENGTH exceeded"); return; }
sprintf(Setup.FName,"%s/%s",FileX->Path,FileX->TargetFile);
strcpy(SetupDir,FileX->Path); SavePrefs();                                                                   //Store path
g_free(FileX);

if (access(Setup.FName,0)==0) 
   {
   Win=gtk_dialog_new(); gtk_grab_add(Win);
   gtk_signal_connect_object(GTK_OBJECT(Win),"destroy",GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(Win));
   gtk_window_set_title(GTK_WINDOW(Win),"Overwrite?"); gtk_container_border_width(GTK_CONTAINER(Win),5);
   sprintf(Str,"Overwrite %s?",Setup.FName);
   Label=gtk_label_new(Str); gtk_misc_set_padding(GTK_MISC(Label),10,10);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->vbox),Label,TRUE,TRUE,0);
   But=gtk_button_new_with_label("Yes");
   gtk_signal_connect(GTK_OBJECT(But),"clicked",GTK_SIGNAL_FUNC(YesOverwrite),Win);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->action_area),But,TRUE,TRUE,0);
   But=gtk_button_new_with_label("No");
   gtk_signal_connect_object(GTK_OBJECT(But),"clicked",GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(Win));
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->action_area),But,TRUE,TRUE,0);
   gtk_widget_show_all(Win);
   }
else Save(0);
}
Exemplo n.º 5
0
Arquivo: dialogs.c Projeto: aufau/xqf
GtkWidget* file_dialog(const char *title, GtkSignalFunc ok_callback, gpointer data) {
	GtkFileSelection* file_selector;

	file_selector = GTK_FILE_SELECTION(gtk_file_selection_new (title));

	if (!file_selector)
		return NULL;

	gtk_window_set_modal (GTK_WINDOW(file_selector),TRUE);

	// gtk_signal_connect (GTK_OBJECT (file_selector), "destroy", (GtkSignalFunc) file_dialog_destroy_callback, &file_selector);

	gtk_signal_connect (GTK_OBJECT (file_selector->ok_button),
			"clicked", ok_callback, data );

	gtk_signal_connect_object (GTK_OBJECT (file_selector->ok_button),
			"clicked", (GtkSignalFunc) gtk_widget_destroy,
			GTK_OBJECT (file_selector));

	/* Connect the cancel_button to destroy the widget */
	gtk_signal_connect_object (GTK_OBJECT (file_selector->cancel_button),
			"clicked", (GtkSignalFunc) gtk_widget_destroy,
			GTK_OBJECT (file_selector));

	gtk_widget_show(GTK_WIDGET(file_selector));

	return GTK_WIDGET(file_selector);
}
Exemplo n.º 6
0
static void
dnj_koj_frame_terragen_terrainfile_search (GtkWidget *button, struct drqmj_koji_terragen *info) {
    GtkWidget *dialog;
    char dir[BUFFERLEN];

    // fix compiler warning
    (void)button;

    dialog = gtk_file_selection_new ("Please select the Terragen Terrain File");
    info->fsterrainfile = dialog;

    if (strlen(gtk_entry_get_text(GTK_ENTRY(info->eterrainfile)))) {
        strncpy (dir,gtk_entry_get_text(GTK_ENTRY(info->eterrainfile)),BUFFERLEN-1);
        gtk_file_selection_set_filename (GTK_FILE_SELECTION(dialog),strcat(dir,"/"));
    }

    gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(dialog)->ok_button),
                        "clicked", GTK_SIGNAL_FUNC (dnj_koj_frame_terragen_terrainfile_set), info);
    gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(dialog)->ok_button),
                               "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
                               (gpointer) dialog);
    gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(dialog)->cancel_button),
                               "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
                               (gpointer) dialog);
    gtk_widget_show (dialog);
    gtk_window_set_modal (GTK_WINDOW(dialog),TRUE);
}
Exemplo n.º 7
0
static void
dnj_koj_frame_terragen_script_search (GtkWidget *button, struct drqmj_koji_terragen *info) {
    GtkWidget *dialog;

    // fix compiler warning
    (void)button;

    dialog = gtk_file_selection_new ("Please select a script directory");
    info->fsscript = dialog;

    if (strlen(gtk_entry_get_text(GTK_ENTRY(info->escript)))) {
        gtk_file_selection_set_filename (GTK_FILE_SELECTION(dialog),gtk_entry_get_text(GTK_ENTRY(info->escript)));
    }

    gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(dialog)->ok_button),
                        "clicked", GTK_SIGNAL_FUNC (dnj_koj_frame_terragen_script_set), info);
    gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(dialog)->ok_button),
                               "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
                               (gpointer) dialog);
    gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(dialog)->cancel_button),
                               "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
                               (gpointer) dialog);
    gtk_widget_show (dialog);
    gtk_window_set_modal (GTK_WINDOW(dialog),TRUE);
}
Exemplo n.º 8
0
static char *save_filename(const char **extensions) {
	GtkWidget *fs;
	int was_fullscreen;
	(void)extensions;  /* unused */

	was_fullscreen = video_module->is_fullscreen;
	if (video_module->set_fullscreen && was_fullscreen)
		video_module->set_fullscreen(0);
	if (filename)
		free(filename);
	filename = NULL;
	fs = gtk_file_selection_new("Save file");
	gtk_signal_connect(GTK_OBJECT(fs), "destroy",
			GTK_SIGNAL_FUNC(cancel), NULL);
	gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
			"clicked",GTK_SIGNAL_FUNC(file_selected),
			GTK_OBJECT (fs));
	gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(fs)->cancel_button),
			"clicked",GTK_SIGNAL_FUNC(gtk_widget_destroy),
			GTK_OBJECT (fs));
	gtk_widget_show(fs);
	gtk_main();
	if (video_module->set_fullscreen && was_fullscreen)
		video_module->set_fullscreen(1);
	return filename;
}
Exemplo n.º 9
0
void build_menus( GtkWidget* window )
{
  GtkWidget* menu_bar;
  GtkWidget* file_menu;
  GtkWidget* file_item;
  GtkWidget* file_open;
  GtkWidget* file_quit;

  menu_bar = gtk_menu_bar_new( );

  file_menu = gtk_menu_new( );

  file_open = gtk_menu_item_new_with_label( "Open" );
  gtk_signal_connect_object( GTK_OBJECT( file_open ), "activate",
			     GTK_SIGNAL_FUNC( show_open_dialog ), NULL );
  gtk_menu_append( GTK_MENU( file_menu ), file_open );
  gtk_widget_show( file_open );

  file_quit = gtk_menu_item_new_with_label( "Quit" );
  gtk_signal_connect_object( GTK_OBJECT( file_quit ), "activate",
			     GTK_SIGNAL_FUNC( query_quit ), NULL );
  gtk_menu_append( GTK_MENU( file_menu ), file_quit );
  gtk_widget_show( file_quit );

  file_item = gtk_menu_item_new_with_label( "File" );
  gtk_menu_item_set_submenu( GTK_MENU_ITEM( file_item ), file_menu );
  gtk_widget_show( file_item );

  gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), file_item );
  gtk_container_add( GTK_CONTAINER( window ), menu_bar );
  gtk_widget_show( menu_bar );
}
Exemplo n.º 10
0
static void
CreateEnterText(int index, GtkSignalFunc func) {
	GtkWidget *dialog, *label, *entry;

	dialog = gtk_dialog_new();
	gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);

	label = gtk_label_new(UI_dialog_string(index));
	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
	gtk_widget_show(label);

	entry = gtk_entry_new_with_max_length(20);
	gtk_signal_connect_object(GTK_OBJECT(entry), "activate",
				  func, GTK_OBJECT(entry));
	gtk_signal_connect_object(GTK_OBJECT(entry), "activate",
				  GTK_SIGNAL_FUNC(gtk_widget_hide),
				  GTK_OBJECT(dialog));
	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), entry);
	gtk_widget_show(entry);

	new_button(dialog, "OK", func, GTK_OBJECT(entry));

	gtk_widget_realize(dialog); 
	dialogs[index] = dialog;
}
Exemplo n.º 11
0
/*-----------------------------------------------------------------------------------------------------------------------*/
void StartCallBack(GtkWidget *W,GtkWidget *StartWin)
{
GtkWidget *Win,*But,*Label;
gchar Str[MAX_FNAME_LENGTH+25];

gtk_widget_destroy(GTK_WIDGET(StartWin));

if (!access(RunName,F_OK)) 
   {
   Win=gtk_dialog_new(); gtk_grab_add(Win);
   gtk_signal_connect_object(GTK_OBJECT(Win),"destroy",GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(Win));
   gtk_window_set_title(GTK_WINDOW(Win),"Overwrite?"); gtk_container_border_width(GTK_CONTAINER(Win),5);
   gtk_widget_set_uposition(GTK_WIDGET(Win),400,400);
   sprintf(Str,"Overwrite %s?",RunName);
   Label=gtk_label_new(Str); gtk_misc_set_padding(GTK_MISC(Label),10,10);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->vbox),Label,TRUE,TRUE,0);
   But=gtk_button_new_with_label("Yes");
   gtk_signal_connect(GTK_OBJECT(But),"clicked",GTK_SIGNAL_FUNC(OverwriteStart),Win);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->action_area),But,TRUE,TRUE,0);
   But=gtk_button_new_with_label("Cancel");
   gtk_signal_connect_object(GTK_OBJECT(But),"clicked",GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(Win));
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->action_area),But,TRUE,TRUE,0);
   gtk_widget_show_all(Win);
   return;
   } 
AcqOn=TRUE; StopSignal=FALSE;
pthread_create(&Acq,NULL,AcquireData,NULL);
}
Exemplo n.º 12
0
Arquivo: tools.c Projeto: dimkr/beaver
void color_picker (void)
{
  GtkColorSelectionDialog *ColorWindow;

  if (ColorIsVisible) return;
  ColorWindow = (GtkColorSelectionDialog *)gtk_color_selection_dialog_new
    ("Color Picker");
  gtk_signal_connect (GTK_OBJECT(ColorWindow), "delete_event",
		      (GtkSignalFunc) color_picker_not_visible, NULL);
  gtk_signal_connect_object (GTK_OBJECT(ColorWindow), "delete_event",
			     (GtkSignalFunc) gtk_widget_destroy,
			     GTK_OBJECT(ColorWindow));
  gtk_signal_connect (GTK_OBJECT (ColorWindow), "destroy",
		      (GtkSignalFunc) color_picker_not_visible, NULL);
  gtk_signal_connect_object (GTK_OBJECT(ColorWindow), "destroy",
			     (GtkSignalFunc) gtk_widget_destroy,
			     GTK_OBJECT(ColorWindow));
  gtk_label_set_text (GTK_LABEL(GTK_BIN(ColorWindow -> ok_button) -> child),
		      "Insert");
  gtk_signal_connect_object (GTK_OBJECT(ColorWindow -> ok_button), "clicked",
			     (GtkSignalFunc)insert_color,
			     GTK_OBJECT(ColorWindow -> colorsel));
  gtk_signal_connect (GTK_OBJECT(ColorWindow -> cancel_button), "clicked",
		      (GtkSignalFunc)color_picker_not_visible, NULL);
  gtk_signal_connect_object (GTK_OBJECT(ColorWindow -> cancel_button),
			     "clicked",
			     (GtkSignalFunc)gtk_widget_destroy,
			     GTK_OBJECT(ColorWindow));
  gtk_widget_hide (ColorWindow -> help_button);
  ColorIsVisible = TRUE;
  gtk_widget_show (GTK_WIDGET(ColorWindow));
  ColorIsVisible = TRUE;
  print_msg ("Display Color Picker...");
}
Exemplo n.º 13
0
void
on_pick_dir_but_clicked (GtkButton       *button,
						 gpointer         user_data)
{
	file_selector = gtk_file_selection_new(_("Please select a directory"));
	
	gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
						"clicked", GTK_SIGNAL_FUNC (store_filename), NULL);
	
	/* Ensure that the dialog box is destroyed when the user clicks a button. */
	
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
							   "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
							   (gpointer) file_selector);
	
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->cancel_button),
							   "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
							   (gpointer) file_selector);

	gtk_window_set_transient_for(GTK_WINDOW(file_selector), 
								 GTK_WINDOW(glade_xml_get_widget(rescue_glade, 
																 "media_select")));
	
	/* Display that dialog */
	
	gtk_widget_show (file_selector);
}
Exemplo n.º 14
0
/* main ルーチン
 */
int main( int argc, char *argv[] ) {
    GtkWidget *window, *table, *area, *hrule, *vrule;

    /* gtk を初期化、メインウィンドウを作成する */
    gtk_init( &argc, &argv );

    window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
    gtk_signal_connect (GTK_OBJECT (window), "delete_event",
            GTK_SIGNAL_FUNC( close_application ), NULL);
    gtk_container_border_width (GTK_CONTAINER (window), 10);

    /* ルーラとドローイングエリアを配置するテーブルを作成 */
    table = gtk_table_new( 3, 2, FALSE );
    gtk_container_add( GTK_CONTAINER(window), table );

    area = gtk_drawing_area_new();
    gtk_drawing_area_size( (GtkDrawingArea *)area, XSIZE, YSIZE );
    gtk_table_attach( GTK_TABLE(table), area, 1, 2, 1, 2,
                      GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0 );
    gtk_widget_set_events( area, GDK_POINTER_MOTION_MASK |
                                  GDK_POINTER_MOTION_HINT_MASK );

    /* 水平ルーラは上に置かれる。マウスがドローイングエリアを横切って
     * 移動すると、motion_notify_event がこのルーラの対応するイベント
     * ハンドラに渡される。*/
    hrule = gtk_hruler_new();
    gtk_ruler_set_metric( GTK_RULER(hrule), GTK_PIXELS );
    gtk_ruler_set_range( GTK_RULER(hrule), 7, 13, 0, 20 );
    gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event",
                               (GtkSignalFunc)EVENT_METHOD(hrule, motion_notify_event),
                               GTK_OBJECT(hrule) );
    /*  GTK_WIDGET_CLASS(GTK_OBJECT(hrule)->klass)->motion_notify_event, */
    gtk_table_attach( GTK_TABLE(table), hrule, 1, 2, 0, 1,
                      GTK_EXPAND|GTK_SHRINK|GTK_FILL, GTK_FILL, 0, 0 );
    
    /* 垂直ルーラは左に置かれる。マウスがドローイングエリアを横切って
     * 移動すると、motion_notify_event がこのルーラの対応するイベント
     * ハンドラに渡される。*/
    vrule = gtk_vruler_new();
    gtk_ruler_set_metric( GTK_RULER(vrule), GTK_PIXELS );
    gtk_ruler_set_range( GTK_RULER(vrule), 0, YSIZE, 10, YSIZE );
    gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event",
                               (GtkSignalFunc)
                                  GTK_WIDGET_CLASS(GTK_OBJECT(vrule)->klass)->motion_notify_event,
                               GTK_OBJECT(vrule) );
    gtk_table_attach( GTK_TABLE(table), vrule, 0, 1, 1, 2,
                      GTK_FILL, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0 );

    /* では全てを表示しよう */
    gtk_widget_show( area );
    gtk_widget_show( hrule );
    gtk_widget_show( vrule );
    gtk_widget_show( table );
    gtk_widget_show( window );
    gtk_main();

    return 0;
}
Exemplo n.º 15
0
/* Create shift buttons */
GtkWidget *
create_edge_buttons (void)
{
GtkWidget *table;
GtkWidget *table2;
GtkWidget *frame;
GtkWidget *main_vbox;
GtkWidget *b1;
GtkWidget *b2;
GtkWidget *pixmapwid1, *pixmapwid2;

GtkTooltips *tooltips;

tooltips=gtk_tooltips_new_2();
gtk_tooltips_set_delay_2(tooltips,1500);

pixmapwid1=gtk_pixmap_new(GLOBALS->larrow_pixmap, GLOBALS->larrow_mask);
gtk_widget_show(pixmapwid1);
pixmapwid2=gtk_pixmap_new(GLOBALS->rarrow_pixmap, GLOBALS->rarrow_mask);
gtk_widget_show(pixmapwid2);

/* Create a table to hold the text widget and scrollbars */
table = gtk_table_new (1, 1, FALSE);

main_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (main_vbox), 1);
gtk_container_add (GTK_CONTAINER (table), main_vbox);

frame = gtk_frame_new ("Edge ");
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0);

gtk_widget_show (frame);
gtk_widget_show (main_vbox);

table2 = gtk_table_new (2, 1, FALSE);

b1 = gtk_button_new();
gtk_container_add(GTK_CONTAINER(b1), pixmapwid1);
gtk_table_attach (GTK_TABLE (table2), b1, 0, 1, 0, 1,
			GTK_FILL | GTK_EXPAND,
		      	GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1);
gtk_signal_connect_object (GTK_OBJECT (b1), "clicked", GTK_SIGNAL_FUNC(service_left_edge), GTK_OBJECT (table2));
gtk_tooltips_set_tip_2(tooltips, b1, "Find next transition of highlighted trace scanning left", NULL);
gtk_widget_show(b1);

b2 = gtk_button_new();
gtk_container_add(GTK_CONTAINER(b2), pixmapwid2);
gtk_table_attach (GTK_TABLE (table2), b2, 0, 1, 1, 2,
		      	GTK_FILL | GTK_EXPAND,
		      	GTK_FILL | GTK_EXPAND | GTK_SHRINK, 1, 1);
gtk_signal_connect_object (GTK_OBJECT (b2), "clicked", GTK_SIGNAL_FUNC(service_right_edge), GTK_OBJECT (table2));
gtk_tooltips_set_tip_2(tooltips, b2, "Find next transition of highlighted trace scanning right", NULL);
gtk_widget_show(b2);

gtk_container_add (GTK_CONTAINER (frame), table2);
gtk_widget_show(table2);
return(table);
}
Exemplo n.º 16
0
static void oss_preferences(void)
{
     GtkWidget *a,*b,*c,*d;
     struct oss_prefdlg *pd;
     gchar *q;
     pd = g_malloc(sizeof(struct oss_prefdlg));
     a = gtk_window_new(GTK_WINDOW_DIALOG);     
     gtk_window_set_modal(GTK_WINDOW(a),TRUE);
     gtk_window_set_title(GTK_WINDOW(a),_("OSS preferences"));
     gtk_window_set_position(GTK_WINDOW(a),GTK_WIN_POS_CENTER);
     gtk_container_set_border_width(GTK_CONTAINER(a),5);
     gtk_signal_connect_object(GTK_OBJECT(a),"destroy",GTK_SIGNAL_FUNC(g_free),
			       (GtkObject *)pd);
     pd->wnd = GTK_WINDOW(a);
     b = gtk_vbox_new(FALSE,5);
     gtk_container_add(GTK_CONTAINER(a),b);
     c = gtk_hbox_new(FALSE,3);
     gtk_container_add(GTK_CONTAINER(b),c);
     d = gtk_label_new(_("Playback device file:"));
     gtk_container_add(GTK_CONTAINER(c),d);
     d = gtk_entry_new();
     q = inifile_get(OSS_PCMFILE_PLAYBACK,OSS_PCMFILE_DEFAULT);
     gtk_entry_set_text(GTK_ENTRY(d),q);
     gtk_container_add(GTK_CONTAINER(c),d);
     pd->pcmdev_playback = GTK_ENTRY(d);
     c = gtk_hbox_new(FALSE,3);
     gtk_container_add(GTK_CONTAINER(b),c);
     d = gtk_label_new(_("Recording device file:"));
     gtk_container_add(GTK_CONTAINER(c),d);
     d = gtk_entry_new();
     gtk_entry_set_text(GTK_ENTRY(d),inifile_get(OSS_PCMFILE_RECORD,q));
     gtk_container_add(GTK_CONTAINER(c),d);
     pd->pcmdev_record = GTK_ENTRY(d);
     c = gtk_check_button_new_with_label(_("Avoid select calls (try this if "
					 "recording locks up)"));
     gtk_container_add(GTK_CONTAINER(b),c);
     oss_noselect = inifile_get_gboolean(OSS_NOSELECT,OSS_NOSELECT_DEFAULT);
     pd->noselect = GTK_TOGGLE_BUTTON(c);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(c),oss_noselect);
     c = gtk_hseparator_new();
     gtk_container_add(GTK_CONTAINER(b),c);
     c = gtk_hbutton_box_new();
     gtk_container_add(GTK_CONTAINER(b),c);
     d = gtk_button_new_with_label(_("OK"));
     gtk_signal_connect(GTK_OBJECT(d),"clicked",
			GTK_SIGNAL_FUNC(oss_preferences_ok),pd);
     gtk_container_add(GTK_CONTAINER(c),d);
     d = gtk_button_new_with_label(_("Close"));
     gtk_signal_connect_object(GTK_OBJECT(d),"clicked",
			       GTK_SIGNAL_FUNC(gtk_widget_destroy),
			       GTK_OBJECT(a));
     gtk_container_add(GTK_CONTAINER(c),d);     
     gtk_widget_show_all(a);
}
Exemplo n.º 17
0
static void
show_server_data_sources_dialog (GtkWidget * check, gpointer widget)
{
  TPCATableProps *tbl = TPCA_TABLE_PROPS (widget);
  gtk_signal_connect_object (GTK_OBJECT (tbl->pDSN), "do_the_work",
      GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (tbl->pDSN));
  gtk_signal_connect_object (GTK_OBJECT (tbl->pDSN), "do_the_work",
      GTK_SIGNAL_FUNC (gtk_main_quit), GTK_OBJECT (tbl->pDSN));

  gtk_widget_show_all (GTK_WIDGET (tbl->pDSN));
  gtk_main ();
}
Exemplo n.º 18
0
static void
show_server_data_sources_dialog (GtkWidget * widget)
{
  TPCCTableProps *dlg = TPCC_TABLE_PROPS (widget);
  gtk_signal_connect_object (GTK_OBJECT (dlg->dsn), "do_the_work",
      GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (dlg->dsn));
  gtk_signal_connect_object (GTK_OBJECT (dlg->dsn), "do_the_work",
      GTK_SIGNAL_FUNC (gtk_main_quit), GTK_OBJECT (dlg->dsn));

  gtk_widget_show_all (GTK_WIDGET (dlg->dsn));
  gtk_main ();
}
Exemplo n.º 19
0
void InputDialog(char *prompt,char *default_str,int len,char *doit,
		 GtkSignalFunc doitfunc,
		 char *cancel,GtkSignalFunc cancelfunc)
{
  GtkWidget *dialog;
  GtkWidget *label;
  GtkWidget *doitbutton;
  GtkWidget *cancelbutton;
  GtkWidget *entry;

  dialog=gtk_dialog_new();

  gtk_container_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),5);

  label=gtk_label_new(prompt);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),label,TRUE,TRUE,0);
  gtk_widget_show(label);

  entry=gtk_entry_new_with_max_length(len);
  if(default_str) gtk_entry_set_text(GTK_ENTRY(entry),default_str);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),entry,TRUE,TRUE,0);
  gtk_widget_show(entry);

  doitbutton=gtk_button_new_with_label(doit);
  if(doitfunc)
    gtk_signal_connect(GTK_OBJECT(doitbutton),"clicked",
		       doitfunc,(gpointer)entry);
  gtk_signal_connect_object(GTK_OBJECT(doitbutton),"clicked",
			    GTK_SIGNAL_FUNC(gtk_widget_destroy),
			    GTK_OBJECT(dialog));
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),doitbutton,
		     TRUE,TRUE,0);
  gtk_widget_show(doitbutton);

  if(cancel) {
    cancelbutton=gtk_button_new_with_label(cancel);
    if(cancelfunc)
      gtk_signal_connect(GTK_OBJECT(cancelbutton),"clicked",
			 cancelfunc,NULL);
    gtk_signal_connect_object(GTK_OBJECT(cancelbutton),"clicked",
			      GTK_SIGNAL_FUNC(gtk_widget_destroy),
			      GTK_OBJECT(dialog));
    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),cancelbutton,
		       TRUE,TRUE,0);
    gtk_widget_show(cancelbutton);
  }

  gtk_widget_show(dialog);

  gtk_grab_add(dialog);
}
Exemplo n.º 20
0
void create_filesel1(GtkWidget *widget, gpointer data)
{
	GtkWidget *filew;
	
	filew = gtk_file_selection_new ("Linux Video Studio - Select Location");
	gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
		"clicked", (GtkSignalFunc) file_ok_sel1, filew);
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(filew)->ok_button),
		"clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (filew));
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(filew)->cancel_button),
		"clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (filew));
	gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew), gtk_entry_get_text(GTK_ENTRY(textfield)));
	gtk_widget_show(filew);
}
Exemplo n.º 21
0
void about (void)
{
  GtkWidget *AboutWindow;
  GtkWidget *PixmapWidget;
  GtkWidget *HSeparator;
  GdkPixmap *Pixmap;
  GdkBitmap *Mask;
  GtkStyle  *Style;
  GtkWidget *Button;
  GtkWidget *AboutLabel;  
  
  AboutWindow = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW(AboutWindow), "About " APP_NAME); 
  gtk_window_set_policy (GTK_WINDOW(AboutWindow), FALSE, FALSE, FALSE);
  gtk_window_set_position (GTK_WINDOW(AboutWindow), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW(AboutWindow), TRUE);
  gtk_window_set_transient_for (GTK_WINDOW(AboutWindow),
				GTK_WINDOW(MainWindow));
  gtk_signal_connect_object (GTK_OBJECT(AboutWindow), "delete_event",
			     (GtkSignalFunc) gtk_widget_destroy,
			     GTK_OBJECT(AboutWindow));
  gtk_signal_connect_object (GTK_OBJECT (AboutWindow), "destroy",
			     (GtkSignalFunc) gtk_widget_destroy,
			     GTK_OBJECT(AboutWindow));
  gtk_widget_realize (AboutWindow);
  Style = gtk_widget_get_style (AboutWindow);
  Pixmap = gdk_pixmap_create_from_xpm_d (AboutWindow->window, &Mask,
					 &Style->bg[GTK_STATE_NORMAL],
					 about_xpm);
  PixmapWidget = gtk_pixmap_new (Pixmap, Mask);
  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(AboutWindow) -> vbox),
		      PixmapWidget, FALSE, FALSE, 0);
  HSeparator = gtk_hseparator_new ();
  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(AboutWindow) -> vbox),
		      HSeparator, FALSE, FALSE, 0);
  AboutLabel = gtk_label_new (APP_NAME " " VERSION_NUMBER "\n"
			      APP_MOTTO "\n\n" APP_URL);
  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(AboutWindow) -> vbox),
		      AboutLabel, FALSE, FALSE, 10);
  Button = gtk_button_new_with_label (" Resume ");
  gtk_signal_connect_object (GTK_OBJECT(Button), "clicked",
			     (GtkSignalFunc) gtk_widget_destroy,
			     GTK_OBJECT(AboutWindow));
  GTK_WIDGET_SET_FLAGS (Button, GTK_CAN_DEFAULT);
  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(AboutWindow) -> action_area),
		      Button, TRUE, TRUE, 0);
  gtk_widget_grab_default (Button);
  gtk_widget_show_all (AboutWindow);
  print_msg ("Display About window...");
}
Exemplo n.º 22
0
void preference_dlg(void) {
  GtkWidget *button;
  GtkWidget *bbox;
  GtkWidget *frame;

  prefer_dialog = gtk_dialog_new();
  gtk_window_set_modal(GTK_WINDOW(prefer_dialog), TRUE);
  GTK_WINDOW(prefer_dialog)->type = GTK_WINDOW_DIALOG;
  gtk_window_set_title(GTK_WINDOW(prefer_dialog), _("Preference"));
  gtk_window_set_policy(GTK_WINDOW(prefer_dialog), FALSE, FALSE, TRUE);
  gtk_container_set_border_width(GTK_CONTAINER(prefer_dialog), 10);
  gtk_window_position(GTK_WINDOW(prefer_dialog), GTK_WIN_POS_MOUSE);
  gtk_widget_show(prefer_dialog);
  
  frame = gtk_frame_new(_("Not implemented!!"));
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(prefer_dialog)->vbox), frame , TRUE, TRUE, 2);
  gtk_widget_show(frame);

  bbox = gtk_hbutton_box_new();
  gtk_container_set_border_width(GTK_CONTAINER(bbox), 0);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(prefer_dialog)->action_area), bbox, TRUE, TRUE, 2);
  gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
  gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 10);
  gtk_button_box_set_child_size(GTK_BUTTON_BOX(bbox), 85, 20);
  gtk_widget_show(bbox);
  button = gtk_button_new_with_label(_("OK"));
  gtk_container_add(GTK_CONTAINER(bbox),button);
  gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
		     GTK_SIGNAL_FUNC(gtk_widget_destroy),
		     GTK_OBJECT(prefer_dialog));
  gtk_widget_show(button);
  GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
  gtk_widget_grab_default(button);

  button = gtk_button_new_with_label(_("Apply"));
  gtk_container_add(GTK_CONTAINER(bbox),button);
  gtk_signal_connect(GTK_OBJECT(button), "clicked",
		     GTK_SIGNAL_FUNC(prefer_dlg_apply),
		     NULL);
  gtk_widget_show(button);

  button = gtk_button_new_with_label(_("Close"));
  gtk_container_add(GTK_CONTAINER(bbox),button);
  gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
		     GTK_SIGNAL_FUNC(gtk_widget_destroy),
		     GTK_OBJECT(prefer_dialog));
  gtk_widget_show(button);

  return;
}
Exemplo n.º 23
0
static void create_dialog()
{
  GtkWidget *button;

  dialog = gtk_dialog_new();
  
  gtk_window_set_title(GTK_WINDOW (dialog), _("Object properties"));
  gtk_window_set_wmclass(GTK_WINDOW (dialog),
			  "properties_window", "Dia");
  gtk_window_set_policy(GTK_WINDOW (dialog),
			FALSE, TRUE, TRUE);
  gtk_container_set_border_width(GTK_CONTAINER (dialog), 2);

  dialog_vbox = GTK_DIALOG(dialog)->vbox;

  button = gtk_button_new_with_label( _("OK") );
  GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), 
		     button, TRUE, TRUE, 0);
  gtk_signal_connect_object(GTK_OBJECT (button), "clicked",
			    GTK_SIGNAL_FUNC(properties_okay),
			    GTK_OBJECT(dialog));
  gtk_widget_show (button);

  button = gtk_button_new_with_label(_("Apply"));
  GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
  gtk_box_pack_start(GTK_BOX (GTK_DIALOG (dialog)->action_area), 
		     button, TRUE, TRUE, 0);
  gtk_signal_connect(GTK_OBJECT (button), "clicked",
		     GTK_SIGNAL_FUNC(properties_apply),
		     NULL);
  gtk_widget_grab_default(button);
  gtk_widget_show(button);

  button = gtk_button_new_with_label( _("Close") );
  GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), 
		     button, TRUE, TRUE, 0);
  gtk_signal_connect_object(GTK_OBJECT (button), "clicked",
			    GTK_SIGNAL_FUNC(gtk_widget_hide),
			    GTK_OBJECT(dialog));
  gtk_widget_show (button);

  gtk_signal_connect(GTK_OBJECT (dialog), "delete_event",
		     GTK_SIGNAL_FUNC(gtk_widget_hide), NULL);

  no_properties_dialog = gtk_label_new(_("This object has no properties."));
  gtk_widget_show (no_properties_dialog);
}
Exemplo n.º 24
0
static void warn_user(void)
{
	GtkWidget *warn_win, *warn_vbox, *warn_desc;
	GtkWidget *warn_bbox, *warn_yes, *warn_no;

	warn_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title(GTK_WINDOW(warn_win), _("Warning"));
	gtk_window_set_transient_for(GTK_WINDOW(warn_win),
				     GTK_WINDOW(configure_win));
	gtk_window_set_modal(GTK_WINDOW(warn_win), TRUE);

	gtk_container_set_border_width(GTK_CONTAINER(warn_win), 10);

	warn_vbox = gtk_vbox_new(FALSE, 10);
	gtk_container_add(GTK_CONTAINER(warn_win), warn_vbox);

	warn_desc = gtk_label_new(_(
		"Filename and song title tags should be inside "
		"double quotes (\").  Not doing so might be a "
		"security risk.  Continue anyway?"));
	gtk_label_set_justify(GTK_LABEL(warn_desc), GTK_JUSTIFY_LEFT);
	gtk_misc_set_alignment(GTK_MISC(warn_desc), 0, 0.5);
	gtk_box_pack_start(GTK_BOX(warn_vbox), warn_desc, FALSE, FALSE, 0);
	gtk_label_set_line_wrap(GTK_LABEL(warn_desc), TRUE);

	warn_bbox = gtk_hbutton_box_new();
	gtk_button_box_set_layout(GTK_BUTTON_BOX(warn_bbox), GTK_BUTTONBOX_END);
	gtk_button_box_set_spacing(GTK_BUTTON_BOX(warn_bbox), 5);
	gtk_box_pack_start(GTK_BOX(warn_vbox), warn_bbox, FALSE, FALSE, 0);

	warn_yes = gtk_button_new_with_label(_("Yes"));
	gtk_signal_connect(GTK_OBJECT(warn_yes), "clicked",
			   GTK_SIGNAL_FUNC(save_and_close), NULL);
	gtk_signal_connect_object(GTK_OBJECT(warn_yes), "clicked",
				  GTK_SIGNAL_FUNC(gtk_widget_destroy),
				  GTK_OBJECT(warn_win));
	GTK_WIDGET_SET_FLAGS(warn_yes, GTK_CAN_DEFAULT);
	gtk_box_pack_start(GTK_BOX(warn_bbox), warn_yes, TRUE, TRUE, 0);
	gtk_widget_grab_default(warn_yes);

	warn_no = gtk_button_new_with_label(_("No"));
	gtk_signal_connect_object(GTK_OBJECT(warn_no), "clicked",
				  GTK_SIGNAL_FUNC(gtk_widget_destroy),
				  GTK_OBJECT(warn_win));
	GTK_WIDGET_SET_FLAGS(warn_no, GTK_CAN_DEFAULT);
	gtk_box_pack_start(GTK_BOX(warn_bbox), warn_no, TRUE, TRUE, 0);

	gtk_widget_show_all(warn_win);
}
Exemplo n.º 25
0
void open_func(GtkWidget *widget, gpointer data)
{
	/* file selection box to try and open a file */
	GtkWidget *filew;

	filew = gtk_file_selection_new ("Linux Video Studio - Select Location");
	gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
		"clicked", (GtkSignalFunc) file_ok_open_global, filew);
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(filew)->ok_button),
		"clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (filew));
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(filew)->cancel_button),
		"clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (filew));
	gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew), "editlist.eli");
	gtk_widget_show(filew);
}
Exemplo n.º 26
0
/*----------------------------------------------------------------------------------------------------------------------*/
void AtWin(gint X,gint Y,gint XSiz,gint YSiz,gchar *Messg)                          //A more flexible verison of Attention
{
GtkWidget *Win,*Label,*But;

Win=gtk_dialog_new(); gtk_window_set_title(GTK_WINDOW(Win),"Attention");
gtk_container_set_border_width(GTK_CONTAINER(Win),10);
gtk_widget_set_uposition(GTK_WIDGET(Win),X,Y); 
gtk_signal_connect_object(GTK_OBJECT(Win),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(Win));
But=gtk_button_new_from_stock(GTK_STOCK_DIALOG_INFO); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->vbox),But,TRUE,FALSE,5);
Label=gtk_label_new(Messg); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->vbox),Label,TRUE,FALSE,5);
But=gtk_button_new_with_label("Dismiss");
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(Win)->action_area),But,TRUE,FALSE,0);
gtk_signal_connect_object(GTK_OBJECT(But),"clicked",GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(Win));
gtk_widget_show_all(Win); 
}
Exemplo n.º 27
0
void show_fileselection()
{
	fileselection = create_fileselection();
	gtk_signal_connect_object(
		GTK_OBJECT(GTK_FILE_SELECTION(fileselection)->ok_button),
		"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
		(GtkObject *) fileselection);
	
	gtk_signal_connect_object (GTK_OBJECT
		(GTK_FILE_SELECTION(fileselection)->cancel_button),
		"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
		(GtkObject *) fileselection);

	gtk_widget_show(fileselection);
}
Exemplo n.º 28
0
Arquivo: filesel.c Projeto: dimkr/gtk
int main( int   argc,
          char *argv[] )
{
    GtkWidget *filew;
    
    gtk_init (&argc, &argv);
    
    /* Create a new file selection widget */
    filew = gtk_file_selection_new ("File selection");
    
    gtk_signal_connect (GTK_OBJECT (filew), "destroy",
			(GtkSignalFunc) destroy, &filew);
    /* Connect the ok_button to file_ok_sel function */
    gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
			"clicked", (GtkSignalFunc) file_ok_sel, filew );
    
    /* Connect the cancel_button to destroy the widget */
    gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION
                                            (filew)->cancel_button),
			       "clicked", (GtkSignalFunc) gtk_widget_destroy,
			       GTK_OBJECT (filew));
    
    /* Lets set the filename, as if this were a save dialog, and we are giving
     a default filename */
    gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew), 
				     "penguin.png");
    
    gtk_widget_show(filew);
    gtk_main ();
    return 0;
}
Exemplo n.º 29
0
Arquivo: main.c Projeto: GPDP2/mupen64
__declspec(dllexport) void DllAbout ( HWND hParent )
{
#ifdef __WIN32__
    MessageBox(NULL, "Mupen64 HLE RSP plugin v0.2 with Azimers code by Hacktarux", "RSP HLE", MB_OK);
#else
#ifdef USE_GTK
    char tMsg[256];
    GtkWidget *dialog, *label, *okay_button;

    dialog = gtk_dialog_new();
    sprintf(tMsg,"Mupen64 HLE RSP plugin v0.2 with Azimers code by Hacktarux");
    label = gtk_label_new(tMsg);
    okay_button = gtk_button_new_with_label("OK");

    gtk_signal_connect_object(GTK_OBJECT(okay_button), "clicked",
                              GTK_SIGNAL_FUNC(gtk_widget_destroy),
                              GTK_OBJECT(dialog));
    gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
                      okay_button);

    gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),
                      label);
    gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
    gtk_widget_show_all(dialog);
#else
    char tMsg[256];
    sprintf(tMsg,"Mupen64 HLE RSP plugin v0.2 with Azimers code by Hacktarux");
    fprintf(stderr, "About\n%s\n", tMsg);
#endif
#endif
}
Exemplo n.º 30
0
static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number)
{
    GtkWidget * Label = NULL;
    GtkWidget * Pixmap = NULL;
    GtkWidget * hbox = NULL;
    GtkWidget * Item = NULL;

    GdkPixmap *PixmapIcon = NULL;
    GdkColor transparent;
    GdkBitmap *MaskIcon = NULL;

    PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm );
    Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon);
    gdk_pixmap_unref (PixmapIcon);

    Item=gtk_check_menu_item_new();
    Label = gtk_label_new (label);

    hbox = gtk_hbox_new (FALSE, 8);
    gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0);
    gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0);
    gtk_container_add (GTK_CONTAINER (Item), hbox);

    gtk_menu_append( GTK_MENU( Menu ),Item );

    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state);
    gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
                               GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
    gtk_menu_item_right_justify (GTK_MENU_ITEM (Item));
    gtk_widget_show_all(Item);

    return Item;
}