summaryrefslogtreecommitdiff
path: root/libgtk_kylix/GTKForms.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-11-17 16:18:15 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-11-17 16:18:15 +0100
commitd884d5168984d36a5c08f4814e81b070d7c964d3 (patch)
tree9743d99642487bececce0093866e71196a0731ba /libgtk_kylix/GTKForms.pas
parentcb5cb517c068a470662bd1d08bef61265376c802 (diff)
downloadtuxcmd-0.6.71.tar.xz
Use getters instead of direct access to structuresv0.6.71
This will hopefully fix remaining GUI issues on PPC64. Needs further testing! Also, libgtk_kylix sources have been altered for use with gtk2forpascal-1.0.7 for Kylix compilation.
Diffstat (limited to 'libgtk_kylix/GTKForms.pas')
-rw-r--r--libgtk_kylix/GTKForms.pas28
1 files changed, 19 insertions, 9 deletions
diff --git a/libgtk_kylix/GTKForms.pas b/libgtk_kylix/GTKForms.pas
index f1f5440..ad623b3 100644
--- a/libgtk_kylix/GTKForms.pas
+++ b/libgtk_kylix/GTKForms.pas
@@ -178,7 +178,7 @@ type // Some basic types
FTerminated: Boolean;
FOnException: TExceptionEvent;
FMainForm: TCustomGTKForm;
- FMainFormSet, FGTK205Up, FGTK220Up, FGTK240Up, FGTK260Up, FGTK280Up: Boolean;
+ FMainFormSet, FGTK205Up, FGTK220Up, FGTK240Up, FGTK260Up, FGTK280Up, FGTK212Up: Boolean;
FThreadID: __pthread_t;
procedure Quit;
protected
@@ -210,6 +210,7 @@ type // Some basic types
property GTKVersion_2_4_0_Up: boolean read FGTK240Up;
property GTKVersion_2_6_0_Up: boolean read FGTK260Up;
property GTKVersion_2_8_0_Up: boolean read FGTK280Up;
+ property GTKVersion_2_12_0_Up: boolean read FGTK212Up;
property ThreadID: __pthread_t read FThreadID;
end;
@@ -269,12 +270,12 @@ end;
function TGDKScreen.GetHeight: Integer;
begin
- Result := gdk_screen_height;
+ Result := gdk_screen_height();
end;
function TGDKScreen.GetWidth: Integer;
begin
- Result := gdk_screen_width;
+ Result := gdk_screen_width();
end;
@@ -372,8 +373,11 @@ begin
end;
function TCustomGTKForm.GetWindowPosition: TWindowPosition;
+var pos: TGtkWindowPosition;
begin
- Result := TWindowPosition(position(PGtkWindow(FWidget)^));
+ pos := GTK_WIN_POS_NONE;
+ g_object_get(FWidget, 'window-position', @pos, nil);
+ Result := TWindowPosition(pos);
end;
procedure TCustomGTKForm.SetWindowPosition(Value: TWindowPosition);
@@ -462,6 +466,7 @@ end;
function TCustomGTKForm.GetLeft: integer;
var PosLeft, PosTop: integer;
begin
+ PosLeft := 0;
gtk_window_get_position(PGtkWindow(FWidget), @PosLeft, @PosTop);
Result := PosLeft;
end;
@@ -469,21 +474,24 @@ end;
function TCustomGTKForm.GetTop: integer;
var PosLeft, PosTop: integer;
begin
+ PosTop := 0;
gtk_window_get_position(PGtkWindow(FWidget), @PosLeft, @PosTop);
Result := PosTop;
end;
function TCustomGTKForm.GetWidth: integer;
-var AWidth, AHeight: integer;
+var AWidth: integer;
begin
- gtk_window_get_size(PGtkWindow(FWidget), @AWidth, @AHeight);
+ AWidth := 100;
+ gtk_window_get_size(PGtkWindow(FWidget), @AWidth, nil);
Result := AWidth;
end;
function TCustomGTKForm.GetHeight: integer;
-var AWidth, AHeight: integer;
+var AHeight: integer;
begin
- gtk_window_get_size(PGtkWindow(FWidget), @AWidth, @AHeight);
+ AHeight := 100;
+ gtk_window_get_size(PGtkWindow(FWidget), nil, @AHeight);
Result := AHeight;
end;
@@ -556,7 +564,9 @@ begin
{$R+}
// Check for correct version of GTK+ library
- Ver := gtk_check_version(2, 8, 0);
+ Ver := gtk_check_version(2, 12, 0);
+ FGTK212Up := Ver = nil;
+ if not FGTK212Up then Ver := gtk_check_version(2, 8, 0);
FGTK280Up := Ver = nil;
if not FGTK280Up then Ver := gtk_check_version(2, 6, 0);
FGTK260Up := Ver = nil;