* [Caml-list] lablgtk with OCamlMakefile @ 2014-07-22 23:45 Oliver Bandel 2014-07-23 0:01 ` Markus Mottl 0 siblings, 1 reply; 8+ messages in thread From: Oliver Bandel @ 2014-07-22 23:45 UTC (permalink / raw) To: caml-list Hello, how can I convince OCamlMakefile to add the needed gtkInit-file to my program? I tried around alot of things, looked up old answers on this list and at other places too, also asked on irc. No solution found. Is it possible to solve this problem? If so: how? Ciao, Oliver ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-22 23:45 [Caml-list] lablgtk with OCamlMakefile Oliver Bandel @ 2014-07-23 0:01 ` Markus Mottl 2014-07-23 0:47 ` Oliver Bandel 2014-07-23 11:10 ` Adrien Nader 0 siblings, 2 replies; 8+ messages in thread From: Markus Mottl @ 2014-07-23 0:01 UTC (permalink / raw) To: Oliver Bandel; +Cc: caml-list You may want to try the following: PACKS = lablgtk2.auto-init Regards, Markus On Tue, Jul 22, 2014 at 7:45 PM, Oliver Bandel <oliver@first.in-berlin.de> wrote: > Hello, > > how can I convince OCamlMakefile to add the needed gtkInit-file to my > program? > > I tried around alot of things, looked up old answers on this list and at > other places too, > also asked on irc. > > No solution found. > > Is it possible to solve this problem? > If so: how? > > > Ciao, > Oliver > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-23 0:01 ` Markus Mottl @ 2014-07-23 0:47 ` Oliver Bandel 2014-07-23 11:10 ` Adrien Nader 1 sibling, 0 replies; 8+ messages in thread From: Oliver Bandel @ 2014-07-23 0:47 UTC (permalink / raw) To: caml-list Hi Markus, thanks so much! This works :) You made my day... ..well the _next day_ also ;-) I can now start to do my stuff :-) ( "now": after getting some sleep => _next day_ yields results ) Best Regards, Oliver Zitat von Markus Mottl <markus.mottl@gmail.com> (Tue, 22 Jul 2014 20:01:28 -0400) > You may want to try the following: > > PACKS = lablgtk2.auto-init > > Regards, > Markus > > On Tue, Jul 22, 2014 at 7:45 PM, Oliver Bandel > <oliver@first.in-berlin.de> wrote: >> Hello, >> >> how can I convince OCamlMakefile to add the needed gtkInit-file to my >> program? >> >> I tried around alot of things, looked up old answers on this list and at >> other places too, >> also asked on irc. >> >> No solution found. >> >> Is it possible to solve this problem? >> If so: how? >> >> >> Ciao, >> Oliver >> >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > -- > Markus Mottl http://www.ocaml.info markus.mottl@gmail.com > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-23 0:01 ` Markus Mottl 2014-07-23 0:47 ` Oliver Bandel @ 2014-07-23 11:10 ` Adrien Nader 2014-07-23 11:42 ` Oliver Bandel 1 sibling, 1 reply; 8+ messages in thread From: Adrien Nader @ 2014-07-23 11:10 UTC (permalink / raw) To: Markus Mottl; +Cc: Oliver Bandel, caml-list Hi, On Tue, Jul 22, 2014, Markus Mottl wrote: > You may want to try the following: > > PACKS = lablgtk2.auto-init Please, do not use the auto-init subpackage. It only exists for the toplevel. Godi had it in its default META and it prevented building the "conf" packages without X available because running anything always tried to initialize GTK+. The README explains what to call to do the GTK+ initialization at the right moment. -- Adrien Nader ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-23 11:10 ` Adrien Nader @ 2014-07-23 11:42 ` Oliver Bandel 2014-07-23 12:34 ` Markus Mottl 2014-07-31 8:48 ` Adrien Nader 0 siblings, 2 replies; 8+ messages in thread From: Oliver Bandel @ 2014-07-23 11:42 UTC (permalink / raw) To: caml-list Hello Adrien, thank you for adding this correction. Using Markus' hint did work. But I now changed my setup in the following way: I again use "lablgtk2" (instead of "lablgtk2.auto-init") in the "PACKS"-section of my Makefile. And I added the line let locale = GtkMain.Main.init () in as first line in my GUI-code. Doing it this way, it also works; I get a GUI instead of a crash. I hope this is the correct and recommended way now. Remark on the README-file: The line with "GtkMain.Main.init ()" I found in the README of lablgtk, which you seemed to refer to. Normally this README is not seen, because when installing the lablgtk-package, it will just be the working code become installed, and the README does not show up. Possibly it makes sense to have doc-packages, which install the documentation also. (It's on Arch-linux, and no docs are installed by default.) Thanks a lot, Oliver Zitat von Adrien Nader <adrien@notk.org> (Wed, 23 Jul 2014 13:10:34 +0200) > Hi, > > On Tue, Jul 22, 2014, Markus Mottl wrote: >> You may want to try the following: >> >> PACKS = lablgtk2.auto-init > > Please, do not use the auto-init subpackage. It only exists for the > toplevel. > > Godi had it in its default META and it prevented building the "conf" > packages without X available because running anything always tried to > initialize GTK+. > > The README explains what to call to do the GTK+ initialization at the > right moment. > > -- > Adrien Nader > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-23 11:42 ` Oliver Bandel @ 2014-07-23 12:34 ` Markus Mottl 2014-07-31 8:43 ` Adrien Nader 2014-07-31 8:48 ` Adrien Nader 1 sibling, 1 reply; 8+ messages in thread From: Markus Mottl @ 2014-07-23 12:34 UTC (permalink / raw) To: Oliver Bandel; +Cc: caml-list I don't use GTK so I'm not sure what the recommended way of initializing it is these days. A long time ago it did require linking with an extra initialization module for applications. Using the init-function above seems to work, too, and may be the best approach. Regards, Markus On Wed, Jul 23, 2014 at 7:42 AM, Oliver Bandel <oliver@first.in-berlin.de> wrote: > Hello Adrien, > > > thank you for adding this correction. > > Using Markus' hint did work. > > But I now changed my setup in the following way: > > > I again use "lablgtk2" (instead of "lablgtk2.auto-init") > in the "PACKS"-section of my Makefile. > > And I added the line > > let locale = GtkMain.Main.init () in > > as first line in my GUI-code. > > > Doing it this way, it also works; I get a GUI instead of a crash. > > I hope this is the correct and recommended way now. > > Remark on the README-file: > > The line with "GtkMain.Main.init ()" I found in the > README of lablgtk, which you seemed to refer to. > > Normally this README is not seen, because when installing > the lablgtk-package, it will just be the working code become installed, > and the README does not show up. > > Possibly it makes sense to have doc-packages, which install > the documentation also. > (It's on Arch-linux, and no docs are installed by default.) > > > Thanks a lot, > Oliver > > > > > > > > > > > Zitat von Adrien Nader <adrien@notk.org> (Wed, 23 Jul 2014 13:10:34 +0200) > >> Hi, >> >> On Tue, Jul 22, 2014, Markus Mottl wrote: >>> >>> You may want to try the following: >>> >>> PACKS = lablgtk2.auto-init >> >> >> Please, do not use the auto-init subpackage. It only exists for the >> toplevel. >> >> Godi had it in its default META and it prevented building the "conf" >> packages without X available because running anything always tried to >> initialize GTK+. >> >> The README explains what to call to do the GTK+ initialization at the >> right moment. >> >> -- >> Adrien Nader >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-23 12:34 ` Markus Mottl @ 2014-07-31 8:43 ` Adrien Nader 0 siblings, 0 replies; 8+ messages in thread From: Adrien Nader @ 2014-07-31 8:43 UTC (permalink / raw) To: Markus Mottl; +Cc: Oliver Bandel, caml-list On Wed, Jul 23, 2014, Markus Mottl wrote: > I don't use GTK so I'm not sure what the recommended way of > initializing it is these days. A long time ago it did require linking > with an extra initialization module for applications. Using the > init-function above seems to work, too, and may be the best approach. I'm not sure it ever required it but some distributions definitely did that. And by the way, the best example against this is with "--help": if the program is linked against gtkInit.cmo, it won't be possible to use its "--help" outside of X (just in case some people were still thinking of doing it :) ). -- Adrien Nader ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] lablgtk with OCamlMakefile 2014-07-23 11:42 ` Oliver Bandel 2014-07-23 12:34 ` Markus Mottl @ 2014-07-31 8:48 ` Adrien Nader 1 sibling, 0 replies; 8+ messages in thread From: Adrien Nader @ 2014-07-31 8:48 UTC (permalink / raw) To: Oliver Bandel; +Cc: caml-list On Wed, Jul 23, 2014, Oliver Bandel wrote: > I again use "lablgtk2" (instead of "lablgtk2.auto-init") > in the "PACKS"-section of my Makefile. > > And I added the line > > let locale = GtkMain.Main.init () in > > as first line in my GUI-code. > > > Doing it this way, it also works; I get a GUI instead of a crash. > > I hope this is the correct and recommended way now. Yes, it's perfect. Just for completeness for archives: this changes very slightly when multi-threading is required (and also remember that graphics-related operations can only happen in the main thread on most platforms but X11 (Wayland too?) and that even in that case, the GDK lock must be taken before issuing them. (more details are easily found on the internet) > Remark on the README-file: > > The line with "GtkMain.Main.init ()" I found in the > README of lablgtk, which you seemed to refer to. > > Normally this README is not seen, because when installing > the lablgtk-package, it will just be the working code become installed, > and the README does not show up. > > Possibly it makes sense to have doc-packages, which install > the documentation also. > (It's on Arch-linux, and no docs are installed by default.) Yes, right. There's http://lablgtk.forge.ocamlcore.org/README.html#_how_to_compile_and_link which should be more visible but still not as well as it should. I've been unable to keep up with my TODO list in the recent months but I'll soon have 2 * 4 hours of plane so I'll try to use that to commit improvements to the documentation and beginner material. Unfortunately, until then I won't have time to make such changes. -- Adrien Nader ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-07-31 8:48 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-07-22 23:45 [Caml-list] lablgtk with OCamlMakefile Oliver Bandel 2014-07-23 0:01 ` Markus Mottl 2014-07-23 0:47 ` Oliver Bandel 2014-07-23 11:10 ` Adrien Nader 2014-07-23 11:42 ` Oliver Bandel 2014-07-23 12:34 ` Markus Mottl 2014-07-31 8:43 ` Adrien Nader 2014-07-31 8:48 ` Adrien Nader
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox