3 static void destroy_cb( GtkWidget
*widget
,
11 int main(int argc
, char **argv
)
16 GtkWidget
*HScroll_VC
;
17 ControlFlowData
*Control_Flow_Data
;
19 /* Horizontal scrollbar and it's adjustment */
20 GtkWidget
*VScroll_VC
;
21 GtkAdjustment
*VAdjust_C
;
23 /* Initialize i18n support */
26 /* Initialize the widget set */
27 gtk_init (&argc
, &argv
);
31 Window
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
32 gtk_window_set_title (GTK_WINDOW (Window
), ("Test Window"));
34 g_signal_connect (G_OBJECT (Window
), "destroy",
35 G_CALLBACK (destroy_cb
), NULL
);
38 VBox_V
= gtk_vbox_new(0, 0);
39 gtk_container_add (GTK_CONTAINER (Window
), VBox_V
);
41 //ListViewer = hGuiEvents(Window);
42 //gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, TRUE, TRUE, 0);
44 //ListViewer = hGuiEvents(Window);
45 //gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, FALSE, TRUE, 0);
47 Control_Flow_Data
= GuiControlFlow();
48 CF_Viewer
= Control_Flow_Data
->Scrolled_Window_VC
;
49 gtk_box_pack_start(GTK_BOX(VBox_V
), CF_Viewer
, TRUE
, TRUE
, 0);
51 /* Create horizontal scrollbar and pack it */
52 HScroll_VC
= gtk_hscrollbar_new(NULL
);
53 gtk_box_pack_start(GTK_BOX(VBox_V
), HScroll_VC
, FALSE
, TRUE
, 0);
56 gtk_widget_show (HScroll_VC
);
57 gtk_widget_show (VBox_V
);
58 gtk_widget_show (Window
);
60 //Event_Selected_Hook(Control_Flow_Data, &ev_sel);
64 g_critical("main loop finished");
66 //hGuiEvents_Destructor(ListViewer);
68 //g_critical("GuiEvents Destructor finished");
76 void add_test_process(ControlFlowData
*Control_Flow_Data
)
80 gchar
*process
[] = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" };
82 for(i
=0; i
<Control_Flow_Data
->Number_Of_Process
; i
++)
84 /* Add a new row to the model */
85 gtk_list_store_append (Control_Flow_Data
->Store_M
, &iter
);
86 gtk_list_store_set (Control_Flow_Data
->Store_M
, &iter
,
87 PROCESS_COLUMN
, process
[i
],
98 void test_draw(ControlFlowData
*Control_Flow_Data
)
100 /* Draw event states using available height, Number of process, cell height
101 * (don't forget to remove two pixels at beginning and end).
102 * For horizontal : use width, Time_Begin, Time_End.
103 * This function calls the reading library to get the draw_hook called
104 * for the desired period of time. */
106 DrawingAreaInfo
*Drawing_Area_Info
= &Control_Flow_Data
->Drawing_Area_Info
;
113 gint cell_height
= get_cell_height(GTK_TREE_VIEW(Control_Flow_Data
->Process_List_VC
));
114 GdkGC
*GC
= gdk_gc_new(widget
->window
);
115 GdkColor color
= CF_Colors
[GREEN
];
117 gdk_color_alloc (gdk_colormap_get_system () , &color
);
119 g_critical("expose");
121 /* When redrawing, use widget->allocation.width to get the width of
123 Control_Flow_Data
->Drawing_Area_Info
.width
= widget
->allocation
.width
;
125 test_draw(Control_Flow_Data
);
127 gdk_gc_copy(GC
,widget
->style
->white_gc
);
128 gdk_gc_set_foreground(GC
,&color
);
130 //gdk_draw_arc (widget->window,
131 // widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
133 // //0, 0, widget->allocation.width, widget->allocation.height,
134 // 0, 0, widget->allocation.width,
135 // Control_Flow_Data->Drawing_Area_Info.height,
139 //Drawing_Area_Init(Control_Flow_Data);
141 // 2 pixels for the box around the drawing area, 1 pixel for off-by-one
143 //gdk_gc_copy (&GC, widget->style->fg_gc[GTK_WIDGET_STATE (widget)]);
145 gdk_gc_set_line_attributes(GC
,12, GDK_LINE_SOLID
, GDK_CAP_NOT_LAST
,GDK_JOIN_MITER
);
147 gdk_draw_line (widget
->window
,
149 0, (cell_height
-1)/2,
150 widget
->allocation
.width
, (cell_height
-1)/2);
152 color
= CF_Colors
[BLUE
];
154 gdk_color_alloc (gdk_colormap_get_system () , &color
);
156 gdk_gc_set_foreground(GC
,&color
);
159 gdk_gc_set_line_attributes(GC
,3, GDK_LINE_SOLID
, GDK_CAP_NOT_LAST
,GDK_JOIN_MITER
);
161 gdk_draw_line (widget
->window
,
163 0, (cell_height
-1)/2,
164 widget
->allocation
.width
,(cell_height
-1)/2);
173 //gdk_colormap_alloc_colors(gdk_colormap_get_system(), TRUE,
175 //gdk_gc_set_line_attributes(GC,5, GDK_LINE_SOLID, GDK_CAP_NOT_LAST,GDK_JOIN_MITER);
176 //gdk_gc_set_foreground(GC,
178 //gdk_draw_line (widget->window,
180 // 0, (2*cell_height)-2-1,
181 // 50, (2*cell_height)-2-1);
This page took 0.03343 seconds and 4 git commands to generate.