I am going to create a simple user interface that has a button which controls a value, and when user click on it, a vscale appear in new window or dialog or box and so on to set value with scale.
is there any example of such program?
I am googled and find some examples but they set color and the dialog have functions for font selection and... .
Win 7_64 bit, gtk3.4.2, Visual c++
regards
Here is the code :
#include <gtk/gtk.h>
void value_changed(GtkRange *range, gpointer win) {
gdouble val = gtk_range_get_value(range);
gchar *str = g_strdup_printf("%.f", val);
gtk_label_set_text(GTK_LABEL(win), str);
g_free(str);
}
void value(GtkRange *range, gpointer win)
{
GtkWidget *halign;
GtkWidget *hbox;
GtkWidget *hscale;
GtkWidget *label;
GtkWidget *content_area, *label1;
GtkWidget * dia = gtk_dialog_new();
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dia));
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,FALSE);
hscale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0, 100, 1);
gtk_scale_set_draw_value(GTK_SCALE(hscale), FALSE);
gtk_widget_set_size_request(hscale, 150, -1);
label = gtk_label_new("...");
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 1);
gtk_box_pack_start(GTK_BOX(hbox), hscale, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
halign = gtk_alignment_new(0, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(halign), hbox);
gtk_container_add(GTK_CONTAINER(content_area), halign);
g_signal_connect(hscale, "value-changed",
G_CALLBACK(value_changed), label);
label1 = gtk_label_new ("YA ali");
gtk_container_add (GTK_CONTAINER (content_area), label1);
gtk_widget_show_all (dia);
}
int main(int argc, char *argv[]) {
GtkWidget *window;
GtkWidget *halign;
GtkWidget *hbox;
GtkWidget *hscale;
GtkWidget *label;
GtkWidget *table;
GtkWidget *btn;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), 300, 250);
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
gtk_window_set_title(GTK_WINDOW(window), "GtkHScale");
btn = gtk_button_new();
table = gtk_table_new(10,10,TRUE);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
gtk_table_set_col_spacings(GTK_TABLE(table), 10);
gtk_table_attach_defaults(GTK_TABLE(table),btn,2,4,4,6);
gtk_container_add(GTK_CONTAINER(window), table);
g_signal_connect(G_OBJECT(btn), "clicked",
G_CALLBACK(value), G_OBJECT(window));
g_signal_connect(window, "destroy",
G_CALLBACK(gtk_main_quit), NULL);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
Related
This is my code. I hope it can draw a circle when users press button. The circel is centered around the point where the mouse key pressed. But the program doesn't run as expected. It clears the pre-circles and draws a new circle. Are there some functions to solve this problem?
My codes:
#include <gtk/gtk.h>
static void do_drawing(cairo_t *);
struct {
int count;
double coordx[100];
double coordy[100];
} glob;
static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
gpointer user_data)
{
do_drawing(cr);
return FALSE;
}
static void do_drawing(cairo_t *cr)
{
cairo_set_source_rgb(cr, 0, 0, 0);
cairo_set_line_width(cr, 0.5);
if(glob.count)
{
cairo_set_font_size(cr, 20);
cairo_new_sub_path(cr);
cairo_arc(cr, glob.coordx[glob.count-1], glob.coordy[glob.count-1], 20, 0, 2*G_PI);
cairo_move_to(cr, glob.coordx[glob.count-1]-3, glob.coordy[glob.count-1] + 7);
cairo_show_text(cr, "i");
cairo_stroke(cr);
}
}
static gboolean clicked(GtkWidget *widget, GdkEventButton *event,
gpointer user_data)
{
if (event->button == 1) {
glob.coordx[glob.count] = event->x;
glob.coordy[glob.count++] = event->y;
gtk_widget_queue_draw(widget);
}
return TRUE;
}
int main(int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *darea;
glob.count = 0;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
darea = gtk_drawing_area_new();
gtk_container_add(GTK_CONTAINER(window), darea);
gtk_widget_add_events(darea, GDK_BUTTON_PRESS_MASK);
g_signal_connect(G_OBJECT(darea), "draw",
G_CALLBACK(on_draw_event), NULL);
g_signal_connect(window, "destroy",
G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(darea, "button-press-event",
G_CALLBACK(clicked), NULL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), 400, 300);
gtk_window_set_title(GTK_WINDOW(window), "Lines");
gtk_widget_show_all(window);
gtk_main();
return 0;
}
I know the gtk_widget_queue_draw(widget) will redraw the GtkDrawingArea entirely, So which function can replace it? I have another question: If I wan to draw on GtkDrawingArea, should I create cairo_t before drawing? How to create a cairo_t for GtkDrawingArea?
I have written the attached example program that uses GTK2 in conjunction with EGL and OpenGL. On my system this works fine. On the PC of friend it only will produce a black window and I cannot put my finger on why this happens. We event straces which libraries get loaded (Which are the same). My PC has a NVIDIA MX150, he has a GTX 1030, he uses Debian Strech and I use Debian buster.
I cannot put my finger on the problem. Anyways, heres the code:
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <EGL/egl.h>
#include <GL/gl.h>
static EGLDisplay egl_display;
static EGLSurface egl_surface;
static EGLContext egl_context;
static void realize_cb (GtkWidget *widget)
{
printf("REALIZE\n");
EGLConfig egl_config;
EGLint n_config;
EGLint attributes[] = { EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE };
EGLint surf_attrs[] = {
EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
EGL_NONE
};
egl_display = eglGetDisplay ((EGLNativeDisplayType) gdk_x11_display_get_xdisplay (gtk_widget_get_display (widget)));
eglInitialize (egl_display, NULL, NULL);
eglChooseConfig (egl_display, attributes, &egl_config, 1, &n_config);
eglBindAPI (EGL_OPENGL_API);
egl_surface = eglCreateWindowSurface (egl_display, egl_config, GDK_WINDOW_XID (gtk_widget_get_window (widget)), surf_attrs);
egl_context = eglCreateContext (egl_display, egl_config, EGL_NO_CONTEXT, NULL);
}
static gboolean on_configure (GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
gtk_widget_queue_draw(widget);
return FALSE;
}
static gboolean draw_cb (GtkWidget *widget, GdkEventExpose *expose, gpointer userdata)
{
printf("DRAW\n");
eglMakeCurrent (egl_display, egl_surface, egl_surface, egl_context);
GtkAllocation alloc;
gtk_widget_get_allocation(widget, &alloc);
glViewport (0, 0, alloc.width, alloc.height);
glClearColor (0, 0, 0, 1);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (0, 100, 0, 100, 0, 1);
glBegin (GL_TRIANGLES);
glColor3f (1, 0, 0);
glVertex2f (50, 10);
glColor3f (0, 1, 0);
glVertex2f (90, 90);
glColor3f (0, 0, 1);
glVertex2f (10, 90);
glEnd ();
eglSwapBuffers (egl_display, egl_surface);
return TRUE;
}
int main (int argc, char **argv)
{
GtkWidget *w;
gtk_init (&argc, &argv);
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_double_buffered (GTK_WIDGET (w), FALSE);
g_signal_connect (G_OBJECT (w), "realize", G_CALLBACK (realize_cb), NULL);
g_signal_connect (G_OBJECT (w), "expose-event", G_CALLBACK (draw_cb), NULL);
g_signal_connect (G_OBJECT (w), "configure-event", G_CALLBACK (on_configure), NULL);
gtk_widget_show (w);
gtk_main ();
return 0;
}
I use Win7-64bit,gtk2.24.10,MSV C++2012
When I compile this code give me assertion failed. I want add menubar and table to window,but dont know how to link them to window to compile corectly.
sample code:
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
int main(int argc, char *argv[]) {
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *menubar;
GtkWidget *fileMenu;
GtkWidget *fileMi;
GtkWidget *newMi;
GtkWidget *openMi;
GtkWidget *cropMi;
GtkWidget *rotateMi;
GtkWidget *rotateMi1;
GtkWidget *rotateMi2;
GtkWidget *rotateMi3;
GtkWidget *rotateMi4;
GtkWidget *rotateMi5;
GtkWidget *rotateMi6;
GtkWidget *rotateMi7;
GtkWidget *rotateMi8;
GtkWidget *resizeMi,*imprMenu;
GtkWidget *runMi;
GtkWidget *quitMi;
GtkWidget *frame1;
GtkWidget *frame2;
GtkWidget *table;
GtkWidget *sep;
GtkAccelGroup *accel_group = NULL;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), 500, 500);
gtk_window_set_title(GTK_WINDOW(window), "Images");
table = gtk_table_new(18,18,FALSE);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(window), table);
gtk_container_add(GTK_CONTAINER(table), vbox);
menubar = gtk_menu_bar_new();
fileMenu = gtk_menu_new();
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
fileMi = gtk_menu_item_new_with_mnemonic("_File");
newMi = gtk_image_menu_item_new_from_stock(GTK_STOCK_NEW, NULL);
resizeMi = gtk_menu_item_new_with_label("Resize");
cropMi = gtk_menu_item_new_with_label("Crop");
rotateMi = gtk_menu_item_new_with_label("Rotate");
runMi = gtk_menu_item_new_with_label("Run");
rotateMi1 = gtk_menu_item_new_with_label("0 ");
rotateMi2 = gtk_menu_item_new_with_label("30");
rotateMi3 = gtk_menu_item_new_with_label("45");
rotateMi4 = gtk_menu_item_new_with_label("60");
rotateMi5 = gtk_menu_item_new_with_label("75");
rotateMi6 = gtk_menu_item_new_with_label("90");
rotateMi7 = gtk_menu_item_new_with_label("135");
rotateMi8 = gtk_menu_item_new_with_label("180");
openMi = gtk_image_menu_item_new_from_stock(GTK_STOCK_OPEN, NULL);
sep = gtk_separator_menu_item_new();
quitMi = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, accel_group);
gtk_widget_add_accelerator(quitMi, "activate", accel_group,
GDK_q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
imprMenu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(fileMi), fileMenu);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), newMi);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), openMi);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), sep);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), cropMi);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), rotateMi);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), resizeMi);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), runMi);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(rotateMi), imprMenu);
gtk_menu_shell_append(GTK_MENU_SHELL(imprMenu), rotateMi1);
gtk_menu_shell_append(GTK_MENU_SHELL(imprMenu), rotateMi2);
gtk_menu_shell_append(GTK_MENU_SHELL(imprMenu), rotateMi3);
gtk_menu_shell_append(GTK_MENU_SHELL(imprMenu), rotateMi4);
gtk_menu_shell_append(GTK_MENU_SHELL(imprMenu), rotateMi5);
gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu), quitMi);
gtk_menu_shell_append(GTK_MENU_SHELL(menubar), fileMi);
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
//gtk_table_attach_defaults(GTK_TABLE(table),vbox,0,1,0,2);
g_signal_connect(G_OBJECT(window), "destroy",
G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(G_OBJECT(quitMi), "activate",
G_CALLBACK(gtk_main_quit), NULL);
table = gtk_table_new(18,18,FALSE);
frame1 = gtk_frame_new("Input X-ray Image");
frame2 = gtk_frame_new("Input Image");
gtk_frame_set_shadow_type(GTK_FRAME(frame1), GTK_SHADOW_IN);
gtk_box_pack_start(GTK_BOX(vbox), frame1, FALSE, FALSE, 0);
gtk_frame_set_shadow_type(GTK_FRAME(frame2), GTK_SHADOW_IN);
gtk_box_pack_start(GTK_BOX(vbox), frame2, FALSE, FALSE, 0);
gtk_table_attach_defaults(GTK_TABLE(table),frame1,0,1,0,2);
gtk_table_attach_defaults(GTK_TABLE(table),vbox,3,4,3,4);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
thanks for your attention..
How can I change the fontcolor of the statusbar?
I have no Idea.
I found gtk_widget_modify_textbut don't know how to use it!
EDIT:
I tried this, but doesnt worked:
GdkRGBA font_color;
font_color.red = 1;
font_color.green = 0;
font_color.blue = 0;
font_color.alpha = 1;
gtk_widget_override_color(statusbar, GTK_STATE_FLAG_NORMAL, &font_color);
You can use the gtk_widget_override_color and use it with GTK_STATE_FLAG_NORMAL and the corresponding GdkRGBA color you wish to set. See the reference for further details.
Here is an example written in vala:
using Gtk;
public class Application : Gtk.Window {
public Application () {
this.destroy.connect (Gtk.main_quit);
this.set_default_size (100, 50);
Gtk.Statusbar bar = new Gtk.Statusbar ();
this.add(bar);
uint context_id = bar.get_context_id ("example");
bar.push (context_id, "Message ...");
Gdk.RGBA font_color = Gdk.RGBA ();
font_color.red=0.5;
font_color.green=0;
font_color.blue=0;
font_color.alpha=1;
bar.override_color (Gtk.StateFlags.NORMAL, font_color);
}
public static int main (string[] args) {
Gtk.init (ref args);
Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}
Here is a C example. It is a modified version of the statusbar example.
#include <stdlib.h>
#include <gtk/gtk.h>
#include <glib.h>
GtkWidget *status_bar;
static void push_item( GtkWidget *widget,
gpointer data )
{
static int count = 1;
gchar *buff;
buff = g_strdup_printf ("Item %d", count++);
gtk_statusbar_push (GTK_STATUSBAR (status_bar), GPOINTER_TO_INT (data), buff);
g_free (buff);
}
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *button;
gint context_id;
gtk_init (&argc, &argv);
/* create a new window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request (GTK_WIDGET (window), 200, 100);
gtk_window_set_title (GTK_WINDOW (window), "GTK Statusbar Example");
g_signal_connect (window, "delete-event",
G_CALLBACK (exit), NULL);
vbox = gtk_vbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
status_bar = gtk_statusbar_new ();
gtk_box_pack_start (GTK_BOX (vbox), status_bar, TRUE, TRUE, 0);
gtk_widget_show (status_bar);
/* here comes the color change */
GdkRGBA font_color;
font_color.red = 1;
font_color.green = 0;
font_color.blue = 0;
font_color.alpha = 1;
gtk_widget_override_color(status_bar, GTK_STATE_FLAG_NORMAL, &font_color);
context_id = gtk_statusbar_get_context_id(
GTK_STATUSBAR (status_bar), "Statusbar example");
button = gtk_button_new_with_label ("push item");
g_signal_connect (button, "clicked",
G_CALLBACK (push_item), GINT_TO_POINTER (context_id));
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 2);
gtk_widget_show (button);
/* always display the window as the last step so it all splashes on
* the screen at once. */
gtk_widget_show (window);
gtk_main ();
return 0;
}
I think you need to retrieve the "label" widget of the status bar to change its attributes. This code changes font and size of the status bar (GTK 2):
PangoFontDescription *pfd = pango_font_description_from_string("Consolas 8");
GtkWidget *w = gtk_statusbar_get_message_area(GTK_STATUSBAR(statusbar));
GList *gl = gtk_container_get_children(GTK_CONTAINER(w));
GtkWidget *ch = GTK_WIDGET(gl->data);
GtkLabel *label = GTK_LABEL(ch);
printf("Number of children: %d Text: %s\n", g_list_length(gl), gtk_label_get_text(label));
//prints 1 and the current message of the statusbar
gtk_widget_modify_font(ch, pfd);
g_list_free(gl);
pango_font_description_free(pfd);
I am just starting out in using both TinyCore Linux and GTK+3 and am reading through and trying a bunch of different tutorials. I am trying the sample code from the GTK website (https://developer.gnome.org/gtk3/stable/ch01s03.html) and it is not working. I am able to compile, with one warning popping up:
warning: 'gdk_window_get_pointer' is deprecated (declared at /usr/local/include/gtk-3.0/gdk/gdkwindow.h:837): Use 'gdk_window_get_device_position' instead [-Wdeprecated-declaration]
When I run the program the window pops up, but there is no drawing area. I took the same code and compiled it on an Ubuntu machine and it worked just fine, it didn't even show the warning about the depreciated function. Any ideas about what may be causing the drawing area to not display would be greatly appreciated. Thanks for taking the time to read this far.
#include <gtk/gtk.h>
/* Surface to store current scribbles */
static cairo_surface_t *surface = NULL;
static void
clear_surface (void)
{
cairo_t *cr;
cr = cairo_create (surface);
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
cairo_destroy (cr);
}
/* Create a new surface of the appropriate size to store our scribbles */
static gboolean
configure_event_cb (GtkWidget *widget,
GdkEventConfigure *event,
gpointer data)
{
if (surface)
cairo_surface_destroy (surface);
surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
CAIRO_CONTENT_COLOR,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
/* Initialize the surface to white */
clear_surface ();
/* We've handled the configure event, no need for further processing. */
return TRUE;
}
/* Redraw the screen from the surface. Note that the ::draw
* signal receives a ready-to-be-used cairo_t that is already
* clipped to only draw the exposed areas of the widget
*/
static gboolean
draw_cb (GtkWidget *widget,
cairo_t *cr,
gpointer data)
{
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
return FALSE;
}
/* Draw a rectangle on the surface at the given position */
static void
draw_brush (GtkWidget *widget,
gdouble x,
gdouble y)
{
cairo_t *cr;
/* Paint to the surface, where we store our state */
cr = cairo_create (surface);
cairo_rectangle (cr, x - 3, y - 3, 6, 6);
cairo_fill (cr);
cairo_destroy (cr);
/* Now invalidate the affected region of the drawing area. */
gtk_widget_queue_draw_area (widget, x - 3, y - 3, 6, 6);
}
/* Handle button press events by either drawing a rectangle
* or clearing the surface, depending on which button was pressed.
* The ::button-press signal handler receives a GdkEventButton
* struct which contains this information.
*/
static gboolean
button_press_event_cb (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
/* paranoia check, in case we haven't gotten a configure event */
if (surface == NULL)
return FALSE;
if (event->button == GDK_BUTTON_PRIMARY)
{
draw_brush (widget, event->x, event->y);
}
else if (event->button == GDK_BUTTON_SECONDARY)
{
clear_surface ();
gtk_widget_queue_draw (widget);
}
/* We've handled the event, stop processing */
return TRUE;
}
/* Handle motion events by continuing to draw if button 1 is
* still held down. The ::motion-notify signal handler receives
* a GdkEventMotion struct which contains this information.
*/
static gboolean
motion_notify_event_cb (GtkWidget *widget,
GdkEventMotion *event,
gpointer data)
{
/* paranoia check, in case we haven't gotten a configure event */
if (surface == NULL)
return FALSE;
if (event->state & GDK_BUTTON1_MASK)
draw_brush (widget, event->x, event->y);
/* We've handled it, stop processing */
return TRUE;
}
static void
close_window (void)
{
if (surface)
cairo_surface_destroy (surface);
gtk_main_quit ();
}
int
main (int argc,
char *argv[])
{
GtkWidget *window;
GtkWidget *frame;
GtkWidget *da;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (window), frame);
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_size_request (da, 100, 100);
gtk_container_add (GTK_CONTAINER (frame), da);
/* Signals used to handle the backing surface */
g_signal_connect (da, "draw",
G_CALLBACK (draw_cb), NULL);
g_signal_connect (da,"configure-event",
G_CALLBACK (configure_event_cb), NULL);
/* Event signals */
g_signal_connect (da, "motion-notify-event",
G_CALLBACK (motion_notify_event_cb), NULL);
g_signal_connect (da, "button-press-event",
G_CALLBACK (button_press_event_cb), NULL);
/* Ask to receive events the drawing area doesn't normally
* subscribe to. In particular, we need to ask for the
* button press and motion notify events that want to handle.
*/
gtk_widget_set_events (da, gtk_widget_get_events (da)
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
I did a fresh install and the warning message disappeared, but the drawing area still refused to show up. I eventually tried changing from the default color depth to 16 bit color depth using the boot code "xvesa=1280x1024x16" and it started showing up. I assume this means it was a driver issue, but I'm not entirely sure.