- let is_whelp txt = Pcre.pmatch ~rex:whelp_RE txt in
- if is_whelp txt then
- begin
- let q = Pcre.extract ~rex:whelp_query_RE txt in
- let query, arg =
- try
- q.(1), q.(2)
- with Invalid_argument _ -> failwith "Malformed Whelp query"
- in
- activate_combo_query arg query;
- (MatitaScript.instance ())#advance ~statement:(txt^".") ()
- end
- else
- begin
- let entry =
- if is_uri txt then
- (`Uri txt)
- else
- (`Dir (add_terminating_slash txt))
- in
- self#_load entry;
- self#_historyAdd entry
- end
-
-
+ if is_whelp txt then begin
+ set_whelp_query txt;
+ (MatitaScript.instance ())#advance ~statement:(txt ^ ".") ()
+ end else begin
+ let entry =
+ match txt with
+ | txt when is_uri txt -> `Uri (UriManager.uri_of_string (fix_uri txt))
+ | txt when is_dir txt -> `Dir (add_trailing_slash txt)
+ | txt ->
+ (try
+ entry_of_string txt
+ with Invalid_argument _ ->
+ raise (Browser_failure (sprintf "unsupported uri: %s" txt)))
+ in
+ self#_load entry;
+ self#_historyAdd entry
+ end
+
+ (** {2 methods accessing underlying GtkMathView} *)
+
+ method updateFontSize = mathView#set_font_size !current_font_size
+