View Issue Details

IDProjectCategoryView StatusLast Update
0008684LazarusWidgetsetpublic2008-07-10 01:00
ReporterJay Binks Assigned ToFelipe Monteiro de Carvalho  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.23 (SVN) 
Fixed in Version0.9.25 (SVN) 
Summary0008684: GTK2 TEdit color Strange behaviour
DescriptionTEdit ( and others ?? ) on
GTK2 ( linux ) dosnt respond to clWindow, clBtnface etc
but does to clRed, clGreen
or Hex format colors $00BBGGRR

kinda strange hey .....
Tagsgtk2
Fixed in Revision14834
LazTarget1.2
WidgetsetGTK 2
Attached Files

Relationships

related to 0008708 closedFelipe Monteiro de Carvalho GTK2 - TEdit - Cant change font color 
related to 0008942 closedJesus Reyes Panel not undestand color clBtnFace 

Activities

Jay Binks

2007-04-18 01:12

reporter   ~0012257

when I change the color of the TEdit control, the SELECTION Color
is changed also... to be the same as the edit.color
meaning if I set edit.color := clwhite then the selection is drawn as clwhite also.

after modifying the edit.color there is no way to make it paint properly again.

so effectivly the only way to make sure a TEdit draws correctly is to not edit the edit.color property.

Jay Binks

2007-12-18 05:30

reporter   ~0016783

Interesting to note is that if I use this code to change the color
( instead of TEdit.color := clBlue )
the color change then works as expected.


function myAllocGDKColor(const AColor: LongInt): TGDKColor;
begin
  with Result do
  begin
    Red := ((AColor shl 8) and $00FF00) or ((AColor ) and $0000FF);
    Green := ((AColor ) and $00FF00) or ((AColor shr 8 ) and $0000FF);
    Blue := ((AColor shr 8) and $00FF00) or ((AColor shr 16) and $0000FF);
  end;

  gdk_colormap_alloc_color(gdk_colormap_get_system, @Result, False, True);
end;


procedure set_TextViewColor( aTextView : TCustomEdit; aColor : Tcolor );
var
  lTextView : PGtkTextView;
  lGdkColor : TGDKColor;
begin
  lTextView := GTK_TEXT_VIEW( GetWidgetInfo( PGtkWidget( TCustomEdit( aTextView ).Handle ), false )^.CoreWidget );
  lGdkColor := myAllocGDKColor( aColor );

  gtk_widget_modify_base ( pGtkWidget( lTextView ), GTK_STATE_NORMAL, @lGdkColor);
end;

Felipe Monteiro de Carvalho

2008-04-15 19:22

developer   ~0018824

Fixed. Documented here:

http://wiki.lazarus.freepascal.org/GTK2_Interface#Done:_System_Colors

Issue History

Date Modified Username Field Change
2007-04-13 06:06 Jay Binks New Issue
2007-04-13 06:06 Jay Binks Widgetset => GTK 2
2007-04-13 14:39 Vincent Snijders LazTarget => 1.2
2007-04-13 14:39 Vincent Snijders Status new => acknowledged
2007-04-18 01:12 Jay Binks Note Added: 0012257
2007-12-18 05:31 Jay Binks Note Added: 0016783
2007-12-18 06:12 Jesus Reyes Relationship added related to 0008942
2008-04-12 12:42 Felipe Monteiro de Carvalho Tag Attached: gtk2
2008-04-15 17:17 Felipe Monteiro de Carvalho Relationship added related to 0008708
2008-04-15 17:18 Felipe Monteiro de Carvalho Status acknowledged => confirmed
2008-04-15 17:18 Felipe Monteiro de Carvalho Status confirmed => assigned
2008-04-15 17:18 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2008-04-15 19:22 Felipe Monteiro de Carvalho Fixed in Revision => 14834
2008-04-15 19:22 Felipe Monteiro de Carvalho Status assigned => resolved
2008-04-15 19:22 Felipe Monteiro de Carvalho Fixed in Version => 0.9.25 (SVN)
2008-04-15 19:22 Felipe Monteiro de Carvalho Resolution open => fixed
2008-04-15 19:22 Felipe Monteiro de Carvalho Note Added: 0018824
2008-07-10 01:00 Marc Weustink Status resolved => closed