Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LablTk: type mismatch in Grid.column_configure and Grid.row_configure #8052

Closed
vicuna opened this issue Mar 9, 2003 · 1 comment
Closed
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 9, 2003

Original bug ID: 1581
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Matt Gushee
Version: 3.06
OS: Linux (Debian 3.0)
Submission from: 216.241.35.41 (216.241.35.41)

LablTk specifies a type of float for the 'weight' argument to
Grid.column_configure
and Grid.row_configure, but Tk expects an integer. Therefore,

Grid.column_configure ... ~weight: 1.;

results in the following error:

Exception: Protocol.TkError "expected integer but got "1."".

Sample code is included at the bottom of this message.

This bug can be fixed by editing $OCAML_SRC/otherlibs/labltk/Widgets.src as
follows:

subtype option(rowcolumnconfigure) {
Minsize ["-minsize"; Units/int]
Weight ["-weight"; float] -> Weight ["-weight"; int] (* line 847 *)
Pad ["-pad"; Units/int]
}

(* ==================================================== )
(
Sample code *)
open Tk;;

let win = openTk () in
let f = Frame.create win in
let main = Text.create f in
let v = Scrollbar.create f ~orient: Vertical ~command: (Text.yview main) and h = Scrollbar.create f ~orient: Horizontal ~command: (Text.xview main)
in
Text.configure main ~yscrollcommand: (Scrollbar.set v)
~xscrollcommand: (Scrollbar.set h);
pack [ f ] ~expand: true ~fill: `Both;
grid [ main ] ~row: 0 ~column: 0 ~sticky: "nsew";
grid [ v ] ~row: 0 ~column: 1 ~sticky: "ns";
grid [ h ] ~row: 1 ~column: 0 ~sticky: "ew";

(* ================================================== )
(
== Exception raised here ========================= )
Grid.column_configure f 0 ~weight: 1.;
Grid.row_configure f 0 ~weight: 1.;
(
================================================== *)

mainLoop ()

@vicuna
Copy link
Author

vicuna commented Mar 13, 2003

Comment author: administrator

Fixed 2003-03-12 by JG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant