void set_widget_width(GtkWidget *w, guint16 width) { set_widget_size(w, width, widget_height(w)); }
static void startup_funcs(void) { static int auto_open_ctr = 0; #ifndef SND_AS_WIDGET /* trap outer-level Close for cleanup check */ SG_SIGNAL_CONNECT(MAIN_SHELL(ss), "delete_event", window_close, NULL); /* when iconified, we need to hide any dialogs as well */ SG_SIGNAL_CONNECT(MAIN_SHELL(ss), "window_state_event", window_iconify, NULL); #endif ss->graph_cursor = gdk_cursor_new((GdkCursorType)in_graph_cursor(ss)); ss->wait_cursor = gdk_cursor_new(GDK_WATCH); ss->bounds_cursor = gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW); ss->yaxis_cursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW); ss->play_cursor = gdk_cursor_new(GDK_SB_RIGHT_ARROW); ss->loop_play_cursor = gdk_cursor_new(GDK_SB_LEFT_ARROW); ss->arrow_cursor = gdk_cursor_new(GDK_LEFT_PTR); #if HAVE_EXTENSION_LANGUAGE snd_load_init_file(noglob, noinit); #endif #if HAVE_SIGNAL && HAVE_EXTENSION_LANGUAGE && !__MINGW32__ if (!nostdin) { GIOChannel *channel; signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); /* these signals are sent by a shell if we start Snd as a background process, * but try to read stdin (needed to support the emacs subjob connection). If * we don't do this, the background job is suspended when the shell sends SIGTTIN. */ channel = g_io_channel_unix_new(STDIN_FILENO); stdin_id = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, (GIOCondition)(G_IO_IN | G_IO_HUP | G_IO_ERR), io_invoke, NULL, NULL); g_io_channel_unref(channel); } #endif while (auto_open_ctr < auto_open_files) auto_open_ctr = handle_next_startup_arg(auto_open_ctr, auto_open_file_names, true, auto_open_files); #ifndef SND_AS_WIDGET if ((ss->init_window_width > 0) && (ss->init_window_height > 0)) set_widget_size(GTK_WIDGET(MAIN_SHELL(ss)), ss->init_window_width, ss->init_window_height); if ((ss->init_window_x != DEFAULT_INIT_WINDOW_X) && (ss->init_window_y != DEFAULT_INIT_WINDOW_Y)) set_widget_position(GTK_WIDGET(MAIN_SHELL(ss)), ss->init_window_x, ss->init_window_y); #endif #if (!HAVE_FAM) if (auto_update_interval(ss) > 0.0) g_timeout_add_full(0, (guint32)(auto_update_interval(ss) * 1000), auto_update_check, NULL, NULL); #endif #if MUS_TRAP_SEGFAULT if (trap_segfault(ss)) signal(SIGSEGV, segv); #endif if ((ss->sounds) && (ss->selected_sound == NO_SELECTION)) { snd_info *sp; sp = ss->sounds[0]; if ((sp) && (sp->inuse == SOUND_NORMAL) && (sp->selected_channel == NO_SELECTION)) /* don't clobber possible select-channel in loaded startup files */ select_channel(sp, 0); } }
void set_widget_height(GtkWidget *w, guint16 height) { set_widget_size(w, widget_width(w), height); }