summaryrefslogtreecommitdiff
path: root/libgtk_kylix/GTKMenus.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/GTKMenus.pas
parentcb5cb517c068a470662bd1d08bef61265376c802 (diff)
downloadtuxcmd-d884d5168984d36a5c08f4814e81b070d7c964d3.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/GTKMenus.pas')
-rw-r--r--libgtk_kylix/GTKMenus.pas19
1 files changed, 13 insertions, 6 deletions
diff --git a/libgtk_kylix/GTKMenus.pas b/libgtk_kylix/GTKMenus.pas
index b01b6b3..7b1b9a8 100644
--- a/libgtk_kylix/GTKMenus.pas
+++ b/libgtk_kylix/GTKMenus.pas
@@ -149,7 +149,7 @@ uses GTKForms, GTKExtCtrls;
constructor TGTKMenuBar.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FWidget := gtk_menu_bar_new;
+ FWidget := gtk_menu_bar_new();
Show;
FItems := TGTKMenuItem.Create(Self);
FItems.FParentMenu := Self;
@@ -359,10 +359,17 @@ begin
end;
function TGTKMenuItem.GetTornOff: boolean;
-begin
- if FItemType = itTearOff then Result := Boolean(torn_off(PGTKTearOffMenuItem(FWidget)^)) else
- if Assigned(FMenu) and (Count > 0) then Result := Boolean(torn_off(PGTKMenu(FMenu)^))
- else Result := False;
+var b: gboolean;
+begin
+ b := False;
+ if Application.GTKVersion_2_6_0_Up then begin
+ if FItemType = itTearOff then g_object_get(FWidget, 'tearoff-state', @b, nil) else
+ if Assigned(FMenu) and (Count > 0) then g_object_get(FMenu, 'tearoff-state', @b, nil);
+ end else begin
+ if FItemType = itTearOff then Result := Boolean(torn_off(PGTKTearOffMenuItem(FWidget)^)) else
+ if Assigned(FMenu) and (Count > 0) then Result := Boolean(torn_off(PGTKMenu(FMenu)^));
+ end;
+ Result := b;
end;
procedure TGTKMenuItem.SetTornOff(Value: boolean);
@@ -387,7 +394,7 @@ function TGTKMenuItem.GetChecked: boolean;
begin
Result := False;
if (FItemType = itCheck) or (FItemType = itRadio) then
- Result := Boolean(active(PGtkCheckMenuItem(FWidget)^));
+ Result := gtk_check_menu_item_get_active(PGtkCheckMenuItem(FWidget));
end;
procedure TGTKMenuItem.SetChecked(Value: boolean);