projects
/
emu8051.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Gtk windows diagram
[emu8051.git]
/
src
/
memwin.c
diff --git
a/src/memwin.c
b/src/memwin.c
index
3c2b73d
..
6583ed7
100644
(file)
--- a/
src/memwin.c
+++ b/
src/memwin.c
@@
-29,53
+29,45
@@
#include "memory.h"
#include "hexfile.h"
#include "cpu8051.h"
#include "memory.h"
#include "hexfile.h"
#include "cpu8051.h"
-#include "gtksizes.h"
#include "memwin.h"
static GtkWidget *memclist;
GtkWidget *
#include "memwin.h"
static GtkWidget *memclist;
GtkWidget *
-memwin_init(
int width, int height
)
+memwin_init(
void
)
{
int i;
{
int i;
- GtkWidget *
fixed_frame
;
+ GtkWidget *
scrollwin
;
PangoFontDescription *pango_font;
char *memdummy[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
PangoFontDescription *pango_font;
char *memdummy[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
- fixed_frame = gtk_frame_new(0);
- gtk_frame_set_shadow_type(GTK_FRAME(fixed_frame),
- GTK_SHADOW_ETCHED_OUT);
- gtk_widget_set_size_request(GTK_WIDGET(fixed_frame), width, height);
+ scrollwin = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin),
+ GTK_SHADOW_ETCHED_OUT);
+
+ /* Automatically add scrollbars when necessary. */
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
memclist = gtk_clist_new(18);
gtk_clist_set_selection_mode(GTK_CLIST(memclist), GTK_SELECTION_SINGLE);
memclist = gtk_clist_new(18);
gtk_clist_set_selection_mode(GTK_CLIST(memclist), GTK_SELECTION_SINGLE);
- gtk_widget_set_size_request(GTK_WIDGET(memclist), 620, 250);
for (i = 0; i < 18; i++) {
gtk_clist_set_column_justification(
GTK_CLIST(memclist), i, GTK_JUSTIFY_LEFT);
}
for (i = 0; i < 18; i++) {
gtk_clist_set_column_justification(
GTK_CLIST(memclist), i, GTK_JUSTIFY_LEFT);
}
- gtk_clist_set_column_width(GTK_CLIST(memclist), 0,
- 5 * FIXED_FONT_SYMBOL_WIDTH);
-
- for (i = 1; i < 17; i++)
- gtk_clist_set_column_width(GTK_CLIST(memclist), i,
- 2 * FIXED_FONT_SYMBOL_WIDTH);
-
- gtk_clist_set_column_width(GTK_CLIST(memclist), 17,
- 16 * FIXED_FONT_SYMBOL_WIDTH);
-
pango_font = pango_font_description_from_string(FIXED_FONT);
gtk_widget_modify_font(memclist, pango_font);
for (i = 0; i < 16; i++)
gtk_clist_append(GTK_CLIST(memclist), memdummy);
pango_font = pango_font_description_from_string(FIXED_FONT);
gtk_widget_modify_font(memclist, pango_font);
for (i = 0; i < 16; i++)
gtk_clist_append(GTK_CLIST(memclist), memdummy);
- gtk_container_add(GTK_CONTAINER(
fixed_frame
), memclist);
+ gtk_container_add(GTK_CONTAINER(
scrollwin
), memclist);
- return
fixed_frame
;
+ return
scrollwin
;
}
/* Dump 16 rows of 16 bytes from Address in Memory (direct addressing) */
}
/* Dump 16 rows of 16 bytes from Address in Memory (direct addressing) */