OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
analyse_GUI.c
Go to the documentation of this file.
1//Copyright> OpenRadioss
2//Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3//Copyright>
4//Copyright> This program is free software: you can redistribute it and/or modify
5//Copyright> it under the terms of the GNU Affero General Public License as published by
6//Copyright> the Free Software Foundation, either version 3 of the License, or
7//Copyright> (at your option) any later version.
8//Copyright>
9//Copyright> This program is distributed in the hope that it will be useful,
10//Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11//Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12//Copyright> GNU Affero General Public License for more details.
13//Copyright>
14//Copyright> You should have received a copy of the GNU Affero General Public License
15//Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16//Copyright>
17//Copyright>
18//Copyright> Commercial Alternative: Altair Radioss Software
19//Copyright>
20//Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21//Copyright> software under a commercial license. Contact Altair to discuss further if the
22//Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23#include <stdlib.h>
24#include "analyse.h" /* analyse_quit */
25#include "analyse_name.inc"
26
27#ifdef WITH_GTK
28#include <gtk/gtk.h>
29#include "tree_gtk.h"
30#include "error_gtk.h"
31#endif
32
33#include "analyse_GUI.h"
34
35static void *analyse_window=NULL;
36
37#ifdef WITH_GTK
38static int gtk_no_quit(GtkWidget *window )
39{
40 return TRUE; /* stop event */
41}
42#endif
43
44static void analyse_GUI_exit_loop(void)
45{
46#ifdef WITH_GTK
47 gtk_main_quit();
48#endif
49}
50
51
53{
54#ifdef WITH_GTK
55 gtk_widget_show_all(analyse_window);
56 gtk_main ();
57#endif
58}
59
60
62{
63#ifdef WITH_GTK
64 tree_gtk_rebuild();
65#endif
66}
67
68void analyse_GUI_add_error_message(char *error_message)
69{
70#ifdef WITH_GTK
71 error_gtk_add_message(error_message);
72#endif
73}
74
76{
77#ifdef WITH_GTK
78
79 int argc=0;
80
81 GtkWidget *window = NULL;
82 GtkWidget *vbox;
83 GtkWidget *widget_tmp;
84
85 gtk_init(&argc, NULL);
86
87 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
88 gtk_widget_realize(window);
89
90 gtk_signal_connect_object (GTK_OBJECT (window), "delete_event",
91 (GtkSignalFunc)gtk_no_quit, GTK_OBJECT(window));
92
93 gtk_window_set_title (GTK_WINDOW (window), "Starter Analyser");
94 gtk_container_set_border_width (GTK_CONTAINER (window), 0);
95
96 vbox = gtk_vbox_new (FALSE, 0);
97 gtk_container_add (GTK_CONTAINER (window), vbox);
98
99 widget_tmp = gtk_button_new_with_label ("Close");
100 gtk_box_pack_end (GTK_BOX (vbox), widget_tmp, TRUE, TRUE, 0);
101
102 gtk_signal_connect_object (GTK_OBJECT (widget_tmp), "clicked",
103 (GtkSignalFunc)analyse_GUI_exit_loop, GTK_OBJECT(window));
104
105 widget_tmp = tree_gtk_window_create(window);
106 gtk_box_pack_start (GTK_BOX (vbox), widget_tmp, TRUE, TRUE, 0);
107
108 widget_tmp = error_gtk_window_create();
109 gtk_box_pack_start (GTK_BOX (vbox), widget_tmp, TRUE, TRUE, 0);
110
111 if (mode == AN_LIVE)
112 gtk_widget_show_all (window);
113
114 analyse_window=window;
115
116#endif
117
118}
void analyse_GUI_window_create(int mode)
Definition analyse_GUI.c:75
void analyse_GUI_add_error_message(char *error_message)
Definition analyse_GUI.c:68
static void analyse_GUI_exit_loop(void)
Definition analyse_GUI.c:44
void analyse_GUI_tree_rebuild(void)
Definition analyse_GUI.c:61
static void * analyse_window
Definition analyse_GUI.c:35
void analyse_GUI_start_loop(void)
Definition analyse_GUI.c:52
#define TRUE
Definition cblas_test.h:10
#define FALSE
Definition cblas_test.h:14