Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-07

TCanvas

53 messages · 9 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

Anyone have any detail on how I would go about writing to the canvas or drawing area of a gtkwidget without using the drawingarea widget?

I know I can get a gdkwindow from doing
fWindow := PgdkWindow(pgtkwidget(widget)^.window); but what do I do with that window? I can get it's gdkgc but I don't have ANY idea what to do.

Thanks
Shane

Reply by email

Shane Miller

Looking at it I thought this would work:

Create a pixmap and draw on it. The pixmap I then store using

gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap);

Here's the basic code.

widget : pgtkwidget;
pixmap : pgdkPixMap;
TheStyle : pgtkstyle;
begin
widget := pgtkwidget(gtkwindow);
pixmap := gtk_object_Get_data(pgktobject(widget),'Pixmap');
gdk_window_clear(widget^.window);
TheStyle := pgtkwidget(widget)^.thestyle;
gdk_draw_rectangle(pixmap,TheStyle^.white_gc,1,1,1,30,30);
gdk_window_set_back_pixmap(widget^.window,pixmap,1);
gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap);
end;

Anyone know why it doesn't seem to do anything?

Shane

>> "Shane Miller" 07/20 8:17 AM >>>

Anyone have any detail on how I would go about writing to the canvas or drawing area of a gtkwidget without using the drawingarea widget?

I know I can get a gdkwindow from doing
fWindow := PgdkWindow(pgtkwidget(widget)^.window); but what do I do with that window? I can get it's gdkgc but I don't have ANY idea what to do.

Thanks
Shane

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Anyone look at the TCAnvas source? Any help please!!!!!

Shane

>> "Shane Miller" 07/20 9:42 AM >>>

Looking at it I thought this would work:

Create a pixmap and draw on it. The pixmap I then store using

gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap);

Here's the basic code.

widget : pgtkwidget;
pixmap : pgdkPixMap;
TheStyle : pgtkstyle;
begin
widget := pgtkwidget(gtkwindow);
pixmap := gtk_object_Get_data(pgktobject(widget),'Pixmap');
gdk_window_clear(widget^.window);
TheStyle := pgtkwidget(widget)^.thestyle;
gdk_draw_rectangle(pixmap,TheStyle^.white_gc,1,1,1,30,30);
gdk_window_set_back_pixmap(widget^.window,pixmap,1);
gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap);
end;

Anyone know why it doesn't seem to do anything?

Shane

>> "Shane Miller" 07/20 8:17 AM >>>

Anyone have any detail on how I would go about writing to the canvas or drawing area of a gtkwidget without using the drawingarea widget?

I know I can get a gdkwindow from doing
fWindow := PgdkWindow(pgtkwidget(widget)^.window); but what do I do with that window? I can get it's gdkgc but I don't have ANY idea what to do.

Thanks
Shane

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Curtis White
to Shane Miller: Looking at it I thought this would work: Create a pixmap and draw on it. The pixmap I…

Shane,

You might take a look at the code in the gtk/examples directory for the program called scribble-simple.pp. It has a bunch of drawing code in it. It might provide some insight to what you are trying to do.

Thanks...Curtis

On 20-Jul-99 Shane Miller wrote 50 lines
Looking at it I thought this would work: Create a pixmap and draw on it. The pixmap I then store using gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap); Here's the basic code. widget : pgtkwidget; pixmap : pgdkPixMap; TheStyle : pgtkstyle; begin widget := pgtkwidget(gtkwindow); pixmap := gtk_object_Get_data(pgktobject(widget),'Pixmap'); gdk_window_clear(widget^.window); TheStyle := pgtkwidget(widget)^.thestyle; gdk_draw_rectangle(pixmap,TheStyle^.white_gc,1,1,1,30,30); gdk_window_set_back_pixmap(widget^.window,pixmap,1); gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap); end; Anyone know why it doesn't seem to do anything? Shane >>> "Shane Miller" 07/20 8:17 AM >>> Anyone have any detail on how I would go about writing to the canvas or drawing area of a gtkwidget without using the drawingarea widget? I know I can get a gdkwindow from doing fWindow := PgdkWindow(pgtkwidget(widget)^.window); but what do I do with that window? I can get it's gdkgc but I don't have ANY idea what to do. Thanks Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

----------------------------------
Curtis White
Curtis White
http://www.teleport.com/~osiriz/
----------------------------------

Reply by email

Cliff Baeseman

I am going to try and code some native gtk stuff tonight to get the answer for shane hopefully.

Cliff

Earlier message 81 lines
-----Original Message----- From: Curtis White To: Date: Tuesday, July 20, 1999 8:50 PM Subject: Re: [lazarus] TCanvas >Shane, > >You might take a look at the code in the gtk/examples directory for the program >called scribble-simple.pp. It has a bunch of drawing code in it. It might >provide some insight to what you are trying to do. > > >Thanks...Curtis > >On 20-Jul-99 Shane Miller wrote: >> Looking at it I thought this would work: >> >> Create a pixmap and draw on it. The pixmap I then store using >> >> gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap); >> >> Here's the basic code. >> >> widget : pgtkwidget; >> pixmap : pgdkPixMap; >> TheStyle : pgtkstyle; >> begin >> >> widget := pgtkwidget(gtkwindow); >> pixmap := gtk_object_Get_data(pgktobject(widget),'Pixmap'); >> gdk_window_clear(widget^.window); >> TheStyle := pgtkwidget(widget)^.thestyle; >> gdk_draw_rectangle(pixmap,TheStyle^.white_gc,1,1,1,30,30); >> >> gdk_window_set_back_pixmap(widget^.window,pixmap,1); >> gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap); >> end; >> >> Anyone know why it doesn't seem to do anything? >> >> Shane >> >> >>>>> "Shane Miller" 07/20 8:17 AM >>> >> Anyone have any detail on how I would go about writing to the canvas or >> drawing area of a gtkwidget without using the drawingarea widget? >> >> I know I can get a gdkwindow from doing >> fWindow := PgdkWindow(pgtkwidget(widget)^.window); >> but what do I do with that window? I can get it's gdkgc but I don't have ANY >> idea what to do. >> >> Thanks >> Shane >> >> >> _________________________________________________________________ >> To unsubscribe: mail with >> "unsubscribe" as the Subject >> archives at http://www.miraclec.com/list_archives/lazarus >> >> _________________________________________________________________ >> To unsubscribe: mail with >> "unsubscribe" as the Subject >> archives at http://www.miraclec.com/list_archives/lazarus > >---------------------------------- >Curtis White >Curtis White >http://www.teleport.com/~osiriz/ >---------------------------------- > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Baeseman, Cliff

that is what may be happening with shanes code also. I was running some gdk code against widgets last night. The calls are working not throwing errors from gtk but they are not doing what is expected.

Shane try making that call against something like a frame or a panel. How about running the code against the fixed widget pasted to the form.

Cliff

Earlier message 60 lines
-----Original Message----- From: Payne Thomas E CNIN Sent: Wednesday, July 21, 1999 11:15 AM To: '' Subject: RE: [lazarus] TCanvas I have been sticking with the examples under GTK, and have found some problems with scribble-simple (section 23) that I belive are with the GDK port to FPC. I have placed debugging writes in pascal and printfs in C, and am getting very different numbers. I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function & (PGdkEventMotion)Event^.state in motion_notify_event I need some help beyond this point!!! Tom > -----Original Message----- > From: Shane Miller > Sent: Wednesday, July 21, 1999 9:37 AM > To: > Subject: [lazarus] TCanvas > > OK, I changed my fillrect procedure to do the following, but it still > doesn't show up!.... > > Procedure TgtkObject.DrawFillrect(Child,Data : Pointer); > var > fWindoew : pgdkWindow; > gc: pgdkGC; > R : TRect; > begin > fWindow := pgtkEidget(Child)^.Window; > > gc := gdk_gc_new(pgdkWindow(fWindow)); > gdk_draw_rectangle(fWindow,gc,1,TRect(data^).Left,TRect(data^).Top,TRect(d > ata^).Right,TRect(data^).Bottom); > > gtk_widget_draw(child,data); > end; > > > Any thoughts? > Shane > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

I HATE how GTK handles colors.....
OK, I simply don't understand it, that's why I hate it.

If I use gdk_draw_rectangle() how do I change the color of the rectangle? If you know the answer, please include a little code.

Shane

>> "Shane Miller" 07/21 11:59 AM >>>

Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow.....

I will have further details after I get done celebrating!!!!!!!!!!!!!!!

Shane

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Payne Thomas E CNIN

I have been sticking with the examples under GTK, and have found some problems with scribble-simple (section 23) that I belive are with the GDK port to FPC.

I have placed debugging writes in pascal and printfs in C, and am getting very different numbers.

I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function
& (PGdkEventMotion)Event^.state in motion_notify_event

I need some help beyond this point!!!

Tom

Show quoted text 33 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 9:37 AM To: Subject: [lazarus] TCanvas OK, I changed my fillrect procedure to do the following, but it still doesn't show up!.... Procedure TgtkObject.DrawFillrect(Child,Data : Pointer); var fWindoew : pgdkWindow; gc: pgdkGC; R : TRect; begin fWindow := pgtkEidget(Child)^.Window; gc := gdk_gc_new(pgdkWindow(fWindow)); gdk_draw_rectangle(fWindow,gc,1,TRect(data^).Left,TRect(data^).Top,TRect(d ata^).Right,TRect(data^).Bottom); gtk_widget_draw(child,data); end; Any thoughts? Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

I have a little project that displays the tcanvas draw rectangle problem.

Cliff

Earlier message 49 lines
-----Original Message----- From: Sent: Wednesday, July 21, 1999 11:44 AM To: '' Subject: RE: [lazarus] TCanvas On Wed, 21 Jul 1999, Payne Thomas E CNIN wrote: > I have been sticking with the examples under GTK, and have found some > problems with scribble-simple (section 23) that I belive are with the GDK > port to FPC. > > I have placed debugging writes in pascal and printfs in C, and am getting > very different numbers. > > I was specifically looking at (PGdkEventExpose)Event^.area.height in the > expose_event function > & (PGdkEventMotion)Event^.state in motion_notify_event > > I need some help beyond this point!!! We have noticed this bug, and the problem is a compiler bug; the pascal compiler aligns the sub-records differently than C does; when accessing records generated By C routines, this of course gives a problem; specifically the EventExpose.area suffers from this problem; we are working on it. When it is fixed, we'll let you know. It is possible that this is at the basis of the whole TCanvas problem, but I would have to investigate that. As a workaround you can typecast the whole thing to a array of word; words 6,7,8,9 are then the elements of the 'area' sub-record. Not all records suffer from this problem, just records with sub-records that have elements of size <4 in them before the sub-record. As soon as there is any news about this, I'll let you know. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

ok share?

cliff

Earlier message 19 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 12:01 PM To: Subject: Re: [lazarus] TCanvas Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow..... I will have further details after I get done celebrating!!!!!!!!!!!!!!! Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

I was sent a initial offering by RedHat why I have no idea. It said that I was a important member of the Open Source community. Because of this I was offered a inital investment opportunity. They said that a certain number of shares are held for this purpose and that that money will be the first invested on the offering date. Don't ask me how RedHat singled myself or others out because I have no trades for this offering have to be done under my account which etrade has on record.

Public date I believe should be around moday.

Cliff

Earlier message 48 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 11:04 AM To: Subject: Re: [lazarus] TCanvas How did you get ahold of the stock? It's still in IPO stage. You have an account with the underwriter? Shane >>> "Michael A. Hess" 07/21 9:54 AM >>> "Baeseman, Cliff" wrote: > > Not anymore I fixed that problem. See, I thought I might not know what I was talking about. :-) Good glad you fixed this. > I am going to post a message to the gtk devloper list. Is it actually a gtk problem? > BTW I also placed a grand into RedHat Software for stock prior to > going public in a few days. I now have a vested interest "my money" in > linux development. Wow. You mean you actually have a grand lying around to invest in something? Lucky you. ;-) -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Shane Miller: Ok, it looks like the GTKFixed widget was hiding my drawings. I decided to draw to the…
Shane Miller wrote 7 lines
Ok, it looks like the GTKFixed widget was hiding my drawings. I decided to draw to the gtkfixed widget instead andf that worked. Simple solution but it took forever to figure out. I guess I thought that the gtkfixed widget wasn't a visual one. Hopefully I wiull have something soon to show everyone...

Exciting stuff! Good work.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Unknown author
to Payne Thomas E CNIN: I have been sticking with the examples under GTK, and have found some problems with…
Payne Thomas E CNIN wrote 12 lines
I have been sticking with the examples under GTK, and have found some problems with scribble-simple (section 23) that I belive are with the GDK port to FPC. I have placed debugging writes in pascal and printfs in C, and am getting very different numbers. I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function & (PGdkEventMotion)Event^.state in motion_notify_event I need some help beyond this point!!!

We have noticed this bug, and the problem is a compiler bug; the pascal compiler aligns the sub-records differently than C does; when accessing records generated By C routines, this of course gives a problem;

specifically the EventExpose.area suffers from this problem;
we are working on it. When it is fixed, we'll let you know.

It is possible that this is at the basis of the whole TCanvas problem, but I would have to investigate that.

As a workaround you can typecast the whole thing to a array of word;
words 6,7,8,9 are then the elements of the 'area' sub-record.

Not all records suffer from this problem, just records with sub-records that have elements of size <4 in them before the sub-record.

As soon as there is any news about this, I'll let you know.

Michael.

Reply by email

Peter Vreman
to Baeseman, Cliff: I was sent a initial offering by RedHat why I have no idea. It said that I was a…
Show quoted text 9 lines
I was sent a initial offering by RedHat why I have no idea. It said that I was a important member of the Open Source community. Because of this I was offered a inital investment opportunity. They said that a certain number of shares are held for this purpose and that that money will be the first invested on the offering date. Don't ask me how RedHat singled myself or others out because I have no trades for this offering have to be done under my account which etrade has on record. Public date I believe should be around moday.

There was also something about this on /.

http://slashdot.org/article.pl?sid=99/07/20/2129218&mode=thread

Reply by email

Michael A. Hess
to Baeseman, Cliff: Not anymore I fixed that problem. I am going to post a message to the gtk devloper list.…
Cliff" wrote
Not anymore I fixed that problem.

See, I thought I might not know what I was talking about. :-) Good glad you fixed this.

I am going to post a message to the gtk devloper list.

Is it actually a gtk problem?

BTW I also placed a grand into RedHat Software for stock prior to going public in a few days. I now have a vested interest "my money" in linux development.

Wow. You mean you actually have a grand lying around to invest in something? Lucky you. ;-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Payne Thomas E CNIN: I have been sticking with the examples under GTK, and have found some problems with…
Payne Thomas E CNIN wrote 7 lines
I have placed debugging writes in pascal and printfs in C, and am getting very different numbers. I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function & (PGdkEventMotion)Event^.state in motion_notify_event

I believe this is something that Shane reported a day ago or so. I guess we need to look at the gtk port code.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Baeseman, Cliff

This brings up a important thing also. Last night I was thinking if we get it to work that means we can draw just about anything on any control we wish. That will make stuff like speed button and such easy.

Cliff

Earlier message 51 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 1:06 PM To: Subject: Re: RE: [lazarus] TCanvas Ok, it looks like the GTKFixed widget was hiding my drawings. I decided to draw to the gtkfixed widget instead andf that worked. Simple solution but it took forever to figure out. I guess I thought that the gtkfixed widget wasn't a visual one. Hopefully I wiull have something soon to show everyone... Shane >>> "Baeseman, Cliff" 07/21 12:54 PM >>> ok share? cliff -----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 12:01 PM To: Subject: Re: [lazarus] TCanvas Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow..... I will have further details after I get done celebrating!!!!!!!!!!!!!!! Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

Not anymore I fixed that problem.

I am going to post a message to the gtk devloper list.

BTW I also placed a grand into RedHat Software for stock prior to going public in a few days. I now have a vested interest "my money" in linux development.

Cliff

Earlier message 37 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, July 21, 1999 9:55 AM To: Subject: Re: [lazarus] TCanvas Shane Miller wrote: > > OK, I changed my fillrect procedure to do the following, but it still > doesn't show up!.... Shane I don't know if this is related or not. I haven't had a chance to look at your TCanvas code so if not just ignore me. When I created the hello_world application I noticed something strange. I place the button on the from and just let it us the default sizes that are set when the button is created. The button didn't show. It would be drawn on the form. The only way I could get the button to draw on the form was to CHANGE the top,left,width,height after the button was created. Then an only then would the button be drawn. This needs to be looked at anyway but maybe it is related to your problem of things not showing up. -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Ok, it looks like the GTKFixed widget was hiding my drawings. I decided to draw to the gtkfixed widget instead andf that worked. Simple solution but it took forever to figure out.

I guess I thought that the gtkfixed widget wasn't a visual one. Hopefully I wiull have something soon to show everyone...

Shane

>> "Baeseman, Cliff" 07/21 12:54 PM >>>

ok share?

cliff

Earlier message 24 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 12:01 PM To: Subject: Re: [lazarus] TCanvas Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow..... I will have further details after I get done celebrating!!!!!!!!!!!!!!! Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Payne Thomas E CNIN

the specific examples are provided below: The print statements are included to show the problem.

Tom

Show quoted text 21 lines
-----Original Message----- From: Payne Thomas E CNIN Sent: Wednesday, July 21, 1999 11:15 AM [Payne Thomas E CNIN] To: '' Subject: RE: [lazarus] TCanvas I have been sticking with the examples under GTK, and have found some problems with scribble-simple (section 23) that I belive are with the GDK port to FPC. I have placed debugging writes in pascal and printfs in C, and am getting very different numbers. I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function & (PGdkEventMotion)Event^.state in motion_notify_event I need some help beyond this point!!! Tom

------------------------------------------------------ /* example-start scribble-simple scribble-simple.c */

/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version. *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. *
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
compile under linux using
gcc `gtk-config --cflags` scribble-simple.c -o scribble-simple `gtk-config --libs`
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
*/

	#include <gtk/gtk.h>
	/* Backing pixmap for drawing area */
	static GdkPixmap *pixmap = NULL;
	/* Create a new backing pixmap of the appropriate size */
	static gint
	configure_event (GtkWidget *widget, GdkEventConfigure *event)
	{
	  if (pixmap)
	    gdk_pixmap_unref(pixmap);
	  pixmap = gdk_pixmap_new(widget->window,
				  widget->allocation.width,
				  widget->allocation.height,
				  -1);
	  gdk_draw_rectangle (pixmap,
			      widget->style->white_gc,
			      TRUE,
			      0, 0,
			      widget->allocation.width,
			      widget->allocation.height);
	  return TRUE;
	}
	/* Redraw the screen from the backing pixmap */
	static gint
	expose_event (GtkWidget *widget, GdkEventExpose *event)
	{
	  printf("Expose Event: x= %d   y= %d   W= %d   H= %d \n",
	        (gint)event->area.x,(gint)event->area.y,
	        (gint)event->area.width, (gint)event->area.height);
	  gdk_draw_pixmap(widget->window,
			  widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
			  pixmap,
			  event->area.x, event->area.y,
			  event->area.x, event->area.y,
			  event->area.width, event->area.height);
	  return FALSE;
	}
	/* Draw a rectangle on the screen */
	static void
	draw_brush (GtkWidget *widget, gdouble x, gdouble y)
	{
	  GdkRectangle update_rect;
	  update_rect.x = x - 5;
	  update_rect.y = y - 5;
	  update_rect.width = 10;
	  update_rect.height = 10;
	  gdk_draw_rectangle (pixmap,
			      widget->style->black_gc,
			      TRUE,
			      update_rect.x, update_rect.y,
			      update_rect.width, update_rect.height);
	  gtk_widget_draw (widget, &update_rect);
	}
	static gint
	button_press_event (GtkWidget *widget, GdkEventButton *event)
	{
	  if (event->button == 1 && pixmap != NULL)
	    draw_brush (widget, event->x, event->y);
	  return TRUE;
	}
	static gint
	motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
	{
	  int x, y;
	  GdkModifierType state;
	  if (event->is_hint)
	    gdk_window_get_pointer (event->window, &x, &y, &state);
	  else
	    {
	      x = event->x;
	      y = event->y;
	      state = event->state;
	    }
	  printf ("Motion_notify_event: state= %d   mask=
%d\n",(gint)state,(gint)GDK_BUTTON1_MASK);
	  if (state & GDK_BUTTON1_MASK && pixmap != NULL)
	    draw_brush (widget, x, y);
	  return TRUE;
	}
	void
	quit ()
	{
	  gtk_exit (0);
	}
	int
	main (int argc, char *argv[])
	{
	  GtkWidget *window;
	  GtkWidget *drawing_area;
	  GtkWidget *vbox;
	  GtkWidget *button;
	  gtk_init (&argc, &argv);
	  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	  gtk_widget_set_name (window, "Test Input");
	  vbox = gtk_vbox_new (FALSE, 0);
	  gtk_container_add (GTK_CONTAINER (window), vbox);
	  gtk_widget_show (vbox);
	  gtk_signal_connect (GTK_OBJECT (window), "destroy",
			      GTK_SIGNAL_FUNC (quit), NULL);
	  /* Create the drawing area */
	  drawing_area = gtk_drawing_area_new ();
	  gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
	  gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
	  gtk_widget_show (drawing_area);
	  /* Signals used to handle backing pixmap */
	  gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
			      (GtkSignalFunc) expose_event, NULL);
	  gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
			      (GtkSignalFunc) configure_event, NULL);
	  /* Event signals */

gtk_signal_connect (GTK_OBJECT (drawing_area),
"motion_notify_event",

			      (GtkSignalFunc) motion_notify_event, NULL);
	  gtk_signal_connect (GTK_OBJECT (drawing_area),

"button_press_event",

			      (GtkSignalFunc) button_press_event, NULL);
	  gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
				 | GDK_LEAVE_NOTIFY_MASK
				 | GDK_BUTTON_PRESS_MASK
				 | GDK_POINTER_MOTION_MASK
				 | GDK_POINTER_MOTION_HINT_MASK);
	  /* .. And a quit button */
	  button = gtk_button_new_with_label ("Quit");
	  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
	  gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
				     GTK_SIGNAL_FUNC (gtk_widget_destroy),
				     GTK_OBJECT (window));
	  gtk_widget_show (button);
	  gtk_widget_show (window);
	  gtk_main ();
	  return 0;
	}
	/* example-end */
	---------------------------------------------------------------
	program scribblesimple;
	uses
	  glib,Gdk,Gtk;
	{ Backing pixmap for drawing area }
	const
	  pixmap : PGdkPixmap = NIL;
	{ Create a new backing pixmap of the appropriate size }
	function  configure_event (widget : PGtkWidget; event:
PGdkEventConfigure): gint; cdecl;
	begin
	  if pixmapNIL then
	    gdk_pixmap_unref(pixmap);
	  pixmap := gdk_pixmap_new(widget^.window,
	                           widget^.allocation.width,
	                           widget^.allocation.height,
	                           -1);
	  writeln('Got to configure_event');
	  if pixmap = Nil then writeln('Nil Pixmap');
	  gdk_draw_rectangle (pixmap,
	                      PGtkStyle(widget^.thestyle)^.white_gc,
	                      gint(true),
	                      0, 0,
	                      widget^.allocation.width,
	                      widget^.allocation.height);
	  configure_event := ord(TRUE);
	end;
	{ Redraw the screen from the backing pixmap }
	function  expose_event (widget : PGtkWidget ; event :
PGdkEventExpose ) : gint; cdecl;
	begin
	  writeln('Expose_event: x =',event^.area.x,'  y= ',event^.area.y,
	           '   width= ',event^.area.width,'   height=
',event^.area.height);
	  if pixmap = Nil then writeln('Nil Pixmap');
	  gdk_draw_pixmap(widget^.window,

PGtkStyle(widget^.thestyle)^.fg_gc[gtk_WIDGET_STATE (widget)], pixmap,
event^.area.x, event^.area.y,
event^.area.x, event^.area.y,

	                  event^.area.width, event^.area.height);
	  expose_event:= ord(FALSE);
	end;
	{ Draw a rectangle on the screen }
	procedure draw_brush (widget : PGtkWidget ; x, y: gint16);
	var update_rect : TGdkRectangle;
	begin
	  update_rect.x := x - 5;
	  update_rect.y := y - 5;
	  update_rect.width := 10;
	  update_rect.height := 10;
	    if pixmap  = Nil then
	    writeln('The style
',PGtkStyle(widget^.thestyle)^.white_gc^.dummy_var);
	  gdk_draw_rectangle (pixmap,
	                      PGtkStyle(widget^.thestyle)^.black_gc,
	                      gint(true),
	                      update_rect.x, update_rect.y,
	                      update_rect.width, update_rect.height);
	  gtk_widget_draw (widget, @update_rect);
	end;
	function  button_press_event (widget : PGtkWidget ; event:
PGdkEventButton ) : gint; cdecl;
	begin
	  writeln('Got to button_press_event');
	  if pixmap = Nil then writeln('Nil Pixmap');
	  if (event^.button = 1) and (pixmap  NIL) then begin
	    draw_brush (widget, trunc(event^.x), trunc(event^.y));
	  end;
	  button_press_event := ord(TRUE);
	end;
	function  motion_notify_event (widget : PGtkWidget ; event:
PGdkEventMotion ) : gint; cdecl;
	var x, y : gint ;
	  state  : guint;
	begin
	  if pixmap = Nil then writeln('Nil Pixmap in motion_notify_event');
	  if (event^.is_hint0) then begin
	    gdk_window_get_pointer (event^.window, @x, @y, @state);
	  end else begin
	    x := trunc(event^.x);
	    y := trunc(event^.y);
	    state := event^.state;
	  end;
	  writeln('Motion_notify_event: state = ',state,'  mask=
',gdk_BUTTON1_MASK);
	  //if ((state {and gdk_BUTTON1_MASK)<}>0) and (pixmap  NIL) then
	  if (state >0) and (pixmap  NIL) then
	  begin
	    //writeln('Continue to draw');
	    draw_brush (widget, x, y);
	  end;
	  motion_notify_event := ord(TRUE);
	end;
	procedure quit;
	begin
	  gtk_exit (0);
	end;
	var window, drawing_area, vbox, button : PGtkWidget;
	begin
	  gtk_init (@argc, @argv);
	  //gtk_rc_init;
	  window := gtk_window_new (gtk_WINDOW_TOPLEVEL);
	  gtk_widget_set_name (window, 'Test Input');
	  vbox := gtk_vbox_new (false, 0);
	  gtk_container_add (PGtkCONTAINER (window), vbox);
	  gtk_widget_show (vbox);
	  gtk_signal_connect (PGtkOBJECT (window), 'destroy',
	                      gtk_SIGNAL_FUNC (@quit), NIL);
	  { Create the drawing area }
	  drawing_area := gtk_drawing_area_new ();
	  gtk_drawing_area_size (PGtkDRAWINGAREA (drawing_area), 200, 200);
	  gtk_box_pack_start (PGtkBOX (vbox), drawing_area, true, true, 0);
	  gtk_widget_show (drawing_area);
	  { Signals used to handle backing pixmap }
	  gtk_signal_connect (PGtkOBJECT (drawing_area), 'expose_event',
	                      gtk_SIGNAL_FUNC (@expose_event), NIL);
	  gtk_signal_connect (PGtkOBJECT(drawing_area),'configure_event',
	                      gtk_SIGNAL_FUNC (@configure_event), NIL);
	  { Event signals }

gtk_signal_connect (PGtkOBJECT (drawing_area),
'motion_notify_event',

	                      gtk_SIGNAL_FUNC (@motion_notify_event), NIL);
	  gtk_signal_connect (PGtkOBJECT (drawing_area),

'button_press_event',

	                      gtk_SIGNAL_FUNC (@button_press_event), NIL);
	  gtk_widget_set_events (drawing_area, gdk_EXPOSURE_MASK
	                         or gdk_LEAVE_NOTIFY_MASK
	                         or gdk_BUTTON_PRESS_MASK
	                         or gdk_POINTER_MOTION_MASK
	                         or gdk_POINTER_MOTION_HINT_MASK);
	  { .. And a quit button }
	  button := gtk_button_new_with_label ('Quit');
	  gtk_box_pack_start (PGtkBOX (vbox), button, false, false, 0);
	  gtk_signal_connect_object (PGtkOBJECT (button), 'clicked',
	                             gtk_SIGNAL_FUNC (@gtk_widget_destroy),
	                             PGtkOBJECT (window));
	  gtk_widget_show (button);
	  gtk_widget_show (window);
	  gtk_main ();
	end.

Reply by email

Baeseman, Cliff

gdk_set_foreground(window,gc,color)

something to that effect. the definition id in gdkmain.pp

Cliff

Earlier message 34 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 2:35 PM To: Subject: Re: [lazarus] TCanvas I HATE how GTK handles colors..... OK, I simply don't understand it, that's why I hate it. If I use gdk_draw_rectangle() how do I change the color of the rectangle? If you know the answer, please include a little code. Shane >>> "Shane Miller" 07/21 11:59 AM >>> Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow..... I will have further details after I get done celebrating!!!!!!!!!!!!!!! Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow.....

I will have further details after I get done celebrating!!!!!!!!!!!!!!!

Shane

Reply by email

Shane Miller

I fixed that problem and will update CVS later.

The setbounds was BEFORE the create component call.

Shane

>> "Michael A. Hess" 07/21 9:43 AM >>>
Shane Miller wrote
OK, I changed my fillrect procedure to do the following, but it still doesn't show up!....

Shane I don't know if this is related or not. I haven't had a chance to look at your TCanvas code so if not just ignore me.

When I created the hello_world application I noticed something strange. I place the button on the from and just let it us the default sizes that are set when the button is created.

The button didn't show. It would be drawn on the form.

The only way I could get the button to draw on the form was to CHANGE the top,left,width,height after the button was created. Then an only then would the button be drawn. This needs to be looked at anyway but maybe it is related to your problem of things not showing up.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

OK, I changed my fillrect procedure to do the following, but it still doesn't show up!....

Procedure TgtkObject.DrawFillrect(Child,Data : Pointer);
var
fWindoew : pgdkWindow;
gc: pgdkGC;
R : TRect;
begin
fWindow := pgtkEidget(Child)^.Window;
gc := gdk_gc_new(pgdkWindow(fWindow));
gdk_draw_rectangle(fWindow,gc,1,TRect(data^).Left,TRect(data^).Top,TRect(data^).Right,TRect(data^).Bottom);
gtk_widget_draw(child,data);
end;

Any thoughts?
Shane

Reply by email

Michael A. Hess
to Shane Miller
Shane Miller wrote
OK, I changed my fillrect procedure to do the following, but it still doesn't show up!....

Shane I don't know if this is related or not. I haven't had a chance to look at your TCanvas code so if not just ignore me.

When I created the hello_world application I noticed something strange. I place the button on the from and just let it us the default sizes that are set when the button is created.

The button didn't show. It would be drawn on the form.

The only way I could get the button to draw on the form was to CHANGE the top,left,width,height after the button was created. Then an only then would the button be drawn. This needs to be looked at anyway but maybe it is related to your problem of things not showing up.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

How did you get ahold of the stock? It's still in IPO stage. You have an account with the underwriter?

Shane

>> "Michael A. Hess" 07/21 9:54 AM >>>
Cliff" wrote
Not anymore I fixed that problem.

See, I thought I might not know what I was talking about. :-) Good glad you fixed this.

I am going to post a message to the gtk devloper list.

Is it actually a gtk problem?

BTW I also placed a grand into RedHat Software for stock prior to going public in a few days. I now have a vested interest "my money" in linux development.

Wow. You mean you actually have a grand lying around to invest in something? Lucky you. ;-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Actually, that function doesn't exist. There is a gdk_window_set_background and a gdk_gc_set_foreground.

I've tried both. When I get the GC from a window and change it, do I have to set the gc back to the window? See,when I change the foreground or background, it does nothing......

Shane

>> "Baeseman, Cliff" 07/21 2:43 PM >>>

gdk_set_foreground(window,gc,color)

something to that effect. the definition id in gdkmain.pp

Cliff

Earlier message 39 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 2:35 PM To: Subject: Re: [lazarus] TCanvas I HATE how GTK handles colors..... OK, I simply don't understand it, that's why I hate it. If I use gdk_draw_rectangle() how do I change the color of the rectangle? If you know the answer, please include a little code. Shane >>> "Shane Miller" 07/21 11:59 AM >>> Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow..... I will have further details after I get done celebrating!!!!!!!!!!!!!!! Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Peter Vreman
to Payne Thomas E CNIN: I have been sticking with the examples under GTK, and have found some problems with…
Show quoted text 12 lines
I have been sticking with the examples under GTK, and have found some problems with scribble-simple (section 23) that I belive are with the GDK port to FPC. I have placed debugging writes in pascal and printfs in C, and am getting very different numbers. I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function & (PGdkEventMotion)Event^.state in motion_notify_event I need some help beyond this point!!!

Maybe it has to do with the packing of records which is still not 100% the same as under C as michael wrote in a message to the core developpers

Peter

Reply by email

Sebastian Günther
to Payne Thomas E CNIN: I have been sticking with the examples under GTK, and have found some problems with…
Payne Thomas E CNIN wrote 5 lines
I was specifically looking at (PGdkEventExpose)Event^.area.height in the expose_event function & (PGdkEventMotion)Event^.state in motion_notify_event I need some help beyond this point!!!

This is was KCL is currently doing to work around this compiler bug:

procedure TPaintBox_Expose(GtkWidget: PGtkWidget; event:
PGdkEventExpose;
  PaintBox: TPaintBox); cdecl;
type
  TWordRect = packed record
    x, y, w, h: Word;
  end;
var
  rect: TRect;
  wrect: TWordRect;
  Canvas: TCanvas;
begin
  if (GtkWidget  nil) and Assigned(PaintBox.Draw) and
    (PaintBox.FCreationState = wcsCreationDone) and
    (PaintBox.BlockDrawingCounter = 0) then begin
    {*** The following should work, but it doesn't (y and height get
wrong)
         - bug in GTK unit? /sg
    rect.Left := event^.area.x;
    rect.Top := event^.area.y;
    rect.Right := rect.Left + event^.area.width;
    rect.Bottom := rect.Top + event^.area.height;}
    Move(PByteArray(event)^[10], wrect, 8);
    rect.Left := wrect.x;
    rect.Top := wrect.y;
    rect.Right := rect.Left + wrect.w;
    rect.Bottom := rect.Top + wrect.h;
    Canvas := TGdkExposeCanvas.Create(PaintBox);
    // WriteLn('Clipping to ', rect.Left, '/', rect.Top, ' - ',
rect.Right, '/', rect.Bottom);
    gdk_gc_set_clip_rectangle(Canvas.priv.gc,
PGdkRectangle(@PByteArray(event)^[10]));
    PaintBox.Draw(PaintBox, Canvas, rect);
    Canvas.Free;
  end;
end;

- Sebastian

Reply by email

Baeseman, Cliff

I hope they sell at a dollar and sky rocket to 100 and them I am going to jump off..

Cliff

Earlier message 28 lines
-----Original Message----- From: Peter Vreman Sent: Wednesday, July 21, 1999 11:37 AM To: Subject: RE: [lazarus] TCanvas > I was sent a initial offering by RedHat why I have no idea. It said that I > was a important member of the Open Source community. Because of this I was > offered a inital investment opportunity. They said that a certain number of > shares are held for this purpose and that that money will be the first > invested on the offering date. Don't ask me how RedHat singled myself or > others out because I have no trades for this offering have > to be done under my account which etrade has on record. > > Public date I believe should be around moday. There was also something about this on /. http://slashdot.org/article.pl?sid=99/07/20/2129218&mode=thread _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

I need to see the code that you actually got to work. I think somehow we have to blast the gc back to the window...

Cliff

Earlier message 70 lines
-----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 3:06 PM To: Subject: Re: RE: [lazarus] TCanvas Actually, that function doesn't exist. There is a gdk_window_set_background and a gdk_gc_set_foreground. I've tried both. When I get the GC from a window and change it, do I have to set the gc back to the window? See,when I change the foreground or background, it does nothing...... Shane >>> "Baeseman, Cliff" 07/21 2:43 PM >>> gdk_set_foreground(window,gc,color) something to that effect. the definition id in gdkmain.pp Cliff -----Original Message----- From: Shane Miller Sent: Wednesday, July 21, 1999 2:35 PM To: Subject: Re: [lazarus] TCanvas I HATE how GTK handles colors..... OK, I simply don't understand it, that's why I hate it. If I use gdk_draw_rectangle() how do I change the color of the rectangle? If you know the answer, please include a little code. Shane >>> "Shane Miller" 07/21 11:59 AM >>> Hey, guess what I got the CANVAS to work by writing DIRECTLY to the gdkwindow..... I will have further details after I get done celebrating!!!!!!!!!!!!!!! Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Shane Miller: Actually, that function doesn't exist. There is a gdk_window_set_background and a…
Shane Miller wrote
Actually, that function doesn't exist. There is a gdk_window_set_background and a gdk_gc_set_foreground.

On page 257 of "Developing Linux Applications with GTK+ and GDK" it says," Every widget in GTK+ as a style that determines how it is to be drawn on the screen."

Anyway go to this link. It is all the example from the above book. Take a look at Chapter 12. It deals with drawing and using rectangles and colors.

http://www.bcpl.lib.md.us/~eharlow/book/

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Baeseman, Cliff

Nothing like a little test of the skills... :)

NOw that is some good news...

Cliff

Earlier message 41 lines
-----Original Message----- From: Shane Miller Sent: Thursday, July 22, 1999 3:40 PM To: Subject: Re: [lazarus] TCanvas CVS is updated. Stretch the main for to see the "editor". You can't do anything yet. The FIle OPen doesn't color correctly either because I changed the TCOlor definition but the main thing is the canvas works. The only thing you can draw currently is a fillled rectangle. Procedure Form1Paint in MAin.pp has examples of the code. Shane >>> "Shane Miller" 07/22 10:47 AM >>> Thanks for the info Michael. After a long and difficult trial with this color thing, I believe I have it working. I can draw multiple colored rectangles at the same time now on the form. It works quite well. I will update CVS shortly.. Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Michael, thanks for the link.

Actually, I have that book and have read it. Here's the thing. The style tells the widget how it should be drawn, not how it should be drawn TO. See, if I want to draw a red rectangle to the window and I set the style to all reds, then the entire widget is red. I'll see if I can switch the style back or something and see if that works.....

Shane

>> "Michael A. Hess" 07/21 3:37 PM >>>
Shane Miller wrote
Actually, that function doesn't exist. There is a gdk_window_set_background and a gdk_gc_set_foreground.

On page 257 of "Developing Linux Applications with GTK+ and GDK" it says," Every widget in GTK+ as a style that determines how it is to be drawn on the screen."

Anyway go to this link. It is all the example from the above book. Take a look at Chapter 12. It deals with drawing and using rectangles and colors.

http://www.bcpl.lib.md.us/~eharlow/book/

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Thanks for the info Michael.
After a long and difficult trial with this color thing, I believe I have it working. I can draw multiple colored rectangles at the same time now on the form. It works quite well.

I will update CVS shortly..

Shane

Reply by email

Michael A. Hess
to Shane Miller: Michael, thanks for the link. Actually, I have that book and have read it. Here's the…
Shane Miller wrote 6 lines
Michael, thanks for the link. Actually, I have that book and have read it. Here's the thing. The style tells the widget how it should be drawn, not how it should be drawn TO.

Correct. I was writing that quote to point out the difference.

See, if I want to draw a red rectangle to the window and I set the style to all reds, then the entire widget is red. I'll see if I can switch the style back or something and see if that works.....

This is why I indicated Chapter 12. The example is drawing the molecular stuff onto the screen and it is using rectangles and what not and using different colors for each. I though that might point something out to you as to how they are setting the colors to draw that item.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

CVS is updated. Stretch the main for to see the "editor". You can't do anything yet.

The FIle OPen doesn't color correctly either because I changed the TCOlor definition but the main thing is the canvas works.

The only thing you can draw currently is a fillled rectangle. Procedure Form1Paint in MAin.pp has examples of the code.

Shane

>> "Shane Miller" 07/22 10:47 AM >>>

Thanks for the info Michael.
After a long and difficult trial with this color thing, I believe I have it working. I can draw multiple colored rectangles at the same time now on the form. It works quite well.

I will update CVS shortly..

Shane

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Payne Thomas E CNIN

Re: Makefiles, It was a procedure thing. I thought '.' would get it. I did not take the time to figure it out. I works now that I used SAMPLECFG via your previous instructions.

Re: Scribble. Just remade it all. I added writelines to scribble. First Height s/b=200 is =0, state ??? s/b=0 is =16. ...So nothing is visibly changed here???????

Is it just me?

Tom

Show quoted text 21 lines
-----Original Message----- From: Payne Thomas E CNIN Sent: Friday, July 23, 1999 4:38 PM To: '' Subject: RE: [lazarus] TCanvas Yes you are absolutely correct. I headed down that path and it works...but I am having trouble with scribble... I rebuilt gtk but not the compiler since this afternoon. I will try again and post. Tom > -----Original Message----- > From: Peter Vreman > Sent: Friday, July 23, 1999 4:07 PM > To: '' > Subject: RE: [lazarus] TCanvas > > Why do you all make it so difficult to not use the makefiles :( > > Peter

Reply by email

Payne Thomas E CNIN

1. I updated lazarus from CVS on Win32, I compiled and ran. I opened a file, stretched the window...there was colorized text there, but the resize was temporarily working then the biggest part of the window was overwritten.

2. Since I could not rebuild the compiler on win32 yet, I went to LInux.

I pulled the latest from CVS....Including the base, rtl, compiler, gtk, and fcl (in order to test for the C alignment).

I compiled/installed it all. I had a problem compiling/makeing lazarus. I deleted my /etc/ppc386.cfg.

I went to /usr/lib/fpc/0.99.13 and did a `samplecfg '.'` I made one for me. Still had problems. I kept adding things to the ppc386 call till I ended up with this:

ppc386 -Tlinux -Fu../rtl/linux -Fu../units/linux -Fu../fcl/linux -Fu../rtl/linux -Fu../gtk
-Fl/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -Fl/usr/local/glib-1.2.3 -Fl/usr/X11R6/lib -Fl/usr/lib -Fl/usr/i486-linux-libc5/lib -Fu../gtk/glib -Fu../gtk/gdk -Fu../gtk/gtk -Fi../fcl/inc -Fi../fcl/linux -FE. -di386 lazarus.pp

So I ran Lazarus, opened a File, stretched the window, and...NOTHING!

Shane,
When is the last time you updated your compiler?

Tom

Show quoted text 23 lines
-----Original Message----- From: Shane Miller Sent: Friday, July 23, 1999 11:58 AM To: Subject: Re: [lazarus] TCanvas Pull the latest from CVS, and compile/run it. Go to FILE OPEN. Now, you don't actually open a file YET, but soon. Click on a file and stretch the new form out. COOL HUH? I like...... Thoughts? Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Has anyone tried Lazarus since I made the canvas changes? Have they workewd with the new compiler? I thought Payne said there was a problem with the new cvs update for FPC when you try to run Lazarus.

Reply by email

Curtis White
to Shane Miller

I just updated and rebuilt everything (compiler, gtk, rtl, etc) and then rebuilt Lazarus with all the latest updates from CVS. It works great. The new TCanvas looks great. Great job.

Curtis

On 24-Jul-99 Shane Miller wrote 5 lines
Has anyone tried Lazarus since I made the canvas changes? Have they workewd with the new compiler? I thought Payne said there was a problem with the new cvs update for FPC when you try to run Lazarus.

Reply by email

Shane Miller

I just updated from CVS to another machine to see if the TCanvas works and it does. I haven't updated the compiler though today. Probably a few days old.....

Shane

Reply by email

Payne Thomas E CNIN

Yes you are absolutely correct. I headed down that path and it works...but I am having trouble with scribble... I rebuilt gtk but not the compiler since this afternoon. I will try again and post.
Tom

Show quoted text 35 lines
-----Original Message----- From: Peter Vreman Sent: Friday, July 23, 1999 4:07 PM To: '' Subject: RE: [lazarus] TCanvas > I compiled/installed it all. I had a problem compiling/makeing lazarus. I > deleted my /etc/ppc386.cfg. > > I went to /usr/lib/fpc/0.99.13 and did a `samplecfg '.'` I made one for me. > Still had problems. I kept adding things to the ppc386 call till I ended up > with this: You should run 'samplecfg /usr/lib/fpc/0.99.13' and then for all the units you're making (FCL,gtk,rtl) goto gtk sources: make install goto fcl sources: make install that will automaticly copy all the units to the correct units dirs which are also set in ppc386.cfg Why do you all make it so difficult to not use the makefiles :( Peter _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

If I sound giddy, that's because I AM!

OK, I've updated CVS again.
The TCanvas is NOT perfect yet, but somewhat impressive (at least I think so) TCanvas now has the following done (working):
FillRect
Rectangle
Line
LineTo
TextOut

Pull the latest from CVS, and compile/run it. Go to FILE OPEN. Now, you don't actually open a file YET, but soon. Click on a file and stretch the new form out.

COOL HUH?

I like......

Thoughts?

Shane

Reply by email

Peter Vreman
to Payne Thomas E CNIN: Re: Makefiles, It was a procedure thing. I thought '.' would get it. I did not take the…
Show quoted text 7 lines
Re: Makefiles, It was a procedure thing. I thought '.' would get it. I did not take the time to figure it out. I works now that I used SAMPLECFG via your previous instructions. Re: Scribble. Just remade it all. I added writelines to scribble. First Height s/b=200 is =0, state ??? s/b=0 is =16. ...So nothing is visibly changed here???????

????

Peter

Reply by email

Peter Vreman
to Payne Thomas E CNIN: 1. I updated lazarus from CVS on Win32, I compiled and ran. I opened a file, stretched…
Show quoted text 6 lines
I compiled/installed it all. I had a problem compiling/makeing lazarus. I deleted my /etc/ppc386.cfg. I went to /usr/lib/fpc/0.99.13 and did a `samplecfg '.'` I made one for me. Still had problems. I kept adding things to the ppc386 call till I ended up with this:

You should run 'samplecfg /usr/lib/fpc/0.99.13' and then for all the units you're making (FCL,gtk,rtl)

goto gtk sources:
make install

goto fcl sources:
make install

that will automaticly copy all the units to the correct units dirs which are also set in ppc386.cfg

Why do you all make it so difficult to not use the makefiles :(

Peter

Reply by email

Peter Vreman
to Payne Thomas E CNIN: 1. I updated lazarus from CVS on Win32, I compiled and ran. I opened a file, stretched…
Show quoted text 22 lines
1. I updated lazarus from CVS on Win32, I compiled and ran. I opened a file, stretched the window...there was colorized text there, but the resize was temporarily working then the biggest part of the window was overwritten. 2. Since I could not rebuild the compiler on win32 yet, I went to LInux. I pulled the latest from CVS....Including the base, rtl, compiler, gtk, and fcl (in order to test for the C alignment). I compiled/installed it all. I had a problem compiling/makeing lazarus. I deleted my /etc/ppc386.cfg. I went to /usr/lib/fpc/0.99.13 and did a `samplecfg '.'` I made one for me. Still had problems. I kept adding things to the ppc386 call till I ended up with this: ppc386 -Tlinux -Fu../rtl/linux -Fu../units/linux -Fu../fcl/linux -Fu../rtl/linux -Fu../gtk -Fl/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -Fl/usr/local/glib-1.2.3 -Fl/usr/X11R6/lib -Fl/usr/lib -Fl/usr/i486-linux-libc5/lib -Fu../gtk/glib -Fu../gtk/gdk -Fu../gtk/gtk -Fi../fcl/inc -Fi../fcl/linux -FE. -di386 lazarus.pp

Why do you have ../gtk/glib, ../gtk/gdk etc. with -Fu ? Just run 'make' in ../gtk and it should place all units there.

Peter

Reply by email

Shane Miller

No, but it must be new code because it doesn't compile. It returns a TControlCanvas and it expects a TCanvas so it must be new.

I changed it and updated CVS.

Shane

------------------------------------------------------------ Shane Miller

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.pcpros.net/~vbman
----------------------------------------------------------

Earlier message 33 lines
-----Original Message----- From: Baeseman, Cliff To: Date: Monday, July 26, 1999 3:14 PM Subject: RE: [lazarus] TCanvas >Not I did I merge some old code or something? > >Cliff > >-----Original Message----- >From: Shane Miller >Sent: Monday, July 26, 1999 4:49 PM >To: >Subject: [lazarus] TCanvas > > >Who changed TForm by adding the GetCanvas procedure to it? And why? > >Shane > > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Baeseman, Cliff

Not I did I merge some old code or something?

Cliff

Earlier message 16 lines
-----Original Message----- From: Shane Miller Sent: Monday, July 26, 1999 4:49 PM To: Subject: [lazarus] TCanvas Who changed TForm by adding the GetCanvas procedure to it? And why? Shane _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman

I think I might have done it like last week some time.

Cliff

Earlier message 26 lines
-----Original Message----- From: Michael A. Hess To: Date: Monday, July 26, 1999 7:28 PM Subject: Re: [lazarus] TCanvas >Baeseman, Cliff wrote: >> >> Not I did I merge some old code or something? > >I didn't change anything either. Since I think only you, Cliff and I are >the only ones making commits at the moment it must have been just a >mistake. > >-- >==== Programming my first best destiny! ==== > >Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email