in reply to Re^2: Can GTK3 be driven externally?
in thread Can GTK3 be driven externally?

My question is: how do I blend the socket server with the GTK3 main loop?

Replies are listed 'Best First'.
Re^4: Can GTK3 be driven externally?
by holandes777 (Scribe) on Feb 04, 2020 at 15:10 UTC
    Thanks for answering
    This almost certainly is what I need
    My application seg faulted, I will research why, but if you have a clue, please tell me!
    use Gtk3; my $window = Gtk3::Window->new ('toplevel'); my $button = Gtk3::Button->new ('Quit'); $button->signal_connect (clicked => sub { Gtk3::main_quit }); $window->add ($button); $window->show_all; my $id = Gtk3->timeout_add(1000, \&handler, $data); Gtk3::main; sub handler { my ($data) = @_; print "timed out ... \n"; # return 1 if you want the handler to be called again later # return 0 to stop the handler from being called again return 1; } result: perl Segmentation fault (core dumped)
        It runs properly when changing Gtk2 to Gtk3, thank you!
        Summary of my perl5 (revision 5 version 26 subversion 1) configuration +: Platform: osname=linux osvers=4.9.0 archname=x86_64-linux-gnu-thread-multi uname='linux localhost 4.9.0 #1 smp debian 4.9.0 x86_64 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dcc=x86_64-linux-gnu-gc +c -Dcpp=x86_64-linux-gnu-cpp -Dld=x86_64-linux-gnu-gcc -Dccflags=-DDE +BIAN -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build +/perl-hx1dVS/perl-5.26.1=. -fstack-protector-strong -Wformat -Werror= +format-security -Dldflags= -Wl,-Bsymbolic-functions -Wl,-z,relro -Dld +dlflags=-shared -Wl,-Bsymbolic-functions -Wl,-z,relro -Dcccdlflags=-f +PIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/pe +rl/5.26 -Darchlib=/usr/lib/x86_64-linux-gnu/perl/5.26 -Dvendorprefix= +/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/x86_64-linux- +gnu/perl5/5.26 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/per +l/5.26.1 -Dsitearch=/usr/local/lib/x86_64-linux-gnu/perl/5.26.1 -Dman +1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir= +/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint - +Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_ +csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -Ui_xlocale -Uversiononl +y -DDEBUGGING=-g -Doptimize=-O2 -dEs -Duseshrplib -Dlibperl=libperl.s +o.5.26.1' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='x86_64-linux-gnu-gcc' ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict- +aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSE +T_BITS=64' optimize='-O2 -g' cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict- +aliasing -pipe -I/usr/local/include' ccversion='' gccversion='7.3.0' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='x86_64-linux-gnu-gcc' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixe +d /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/. +./lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt so=so useshrplib=true gnulibc_version='2.27' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -L/usr/local/lib -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Locally applied patches: DEBPKG:debian/cpan_definstalldirs - Provide a sensible INSTALLDIRS + default for modules installed from CPAN. DEBPKG:debian/db_file_ver - Remove +overly restrictive DB_File version check. DEBPKG:debian/doc_info - Replace generic man(1) instructions with +Debian-specific information. DEBPKG:debian/enc2xs_inc - Tweak en +c2xs to follow symlinks and ignore missing @INC directories. DEBPKG:debian/errno_ver - Remove Er +rno version check due to upgrade problems with long-running processes +. DEBPKG:debian/libperl_embed_doc - N +ote that libperl-dev package is required for embedded linking DEBPKG:fixes/respect_umask - Respect umask during installation DEBPKG:debian/writable_site_dirs - Set umask approproately for sit +e install directories DEBPKG:debian/extutils_set_libperl_path - EU:MM: set location of l +ibperl.a under /usr/lib DEBPKG:debian/no_packlist_perllocal - Don't install .packlist or p +erllocal.pod for perl or vendor DEBPKG:debian/fakeroot - Postpone LD_LIBRARY_PATH evaluation to th +e binary targets. DEBPKG:debian/instmodsh_doc - Debian policy doesn't install .packl +ist files for core or vendor. DEBPKG:debian/ld_run_path - Remove standard libs from LD_RUN_PATH +as per Debian policy. DEBPKG:debian/libnet_config_path - Set location of libnet.cfg to / +etc/perl/Net as /usr may not be writable. DEBPKG:debian/perlivp - Make perliv +p skip include directories in /usr/local DEBPKG:debian/deprecate-with-apt - +Point users to Debian packages of deprecated core modules DEBPKG:debian/squelch-locale-warnings - +8764 Squelch locale warnings in Debian package maintainer scripts DEBPKG:debian/patchlevel - List pac +kaged patches for 5.26.1-6ubuntu0.3 in patchlevel.h DEBPKG:fixes/document_makemaker_ccflags - +628522 [ #68613] Document that CCFLAGS should include $Con +fig{ccflags} DEBPKG:debian/find_html2text - Conf +igure CPAN::Distribution with correct name of html2text DEBPKG:debian/perl5db-x-terminal-emulator.patch - https://bugs.deb Invoke x-terminal-emulator rather than xterm in perl5d DEBPKG:debian/cpan-missing-site-dirs - +842 Fix CPAN::FirstTime defaults with nonexisting site dirs if a pare +nt is writable DEBPKG:fixes/memoize_storable_nstore - [ #77790] https: +// Memoize::Storable: respect 'nstore' option n +ot respected DEBPKG:debian/makemaker-pasthru - P +ass LD settings through to subdirectories DEBPKG:debian/makemaker-manext - Ma +ke EU::MakeMaker honour MANnEXT settings in generated manpage headers DEBPKG:debian/kfreebsd-softupdates - +8 Work around Debian Bug#796798 DEBPKG:fixes/autodie-scope - Fix a +scoping issue with "no autodie" and the "system" sub DEBPKG:fixes/memoize-pod - [ #89441] Fix POD errors in +Memoize DEBPKG:debian/hurd-softupdates - Fi +x t/op/stat.t failures on hurd DEBPKG:fixes/math_complex_doc_great_circle - https://bugs.debian.o +rg/697567 [ #114104] Math::Trig: clarify definition of gre +at_circle_midpoint DEBPKG:fixes/math_complex_doc_see_also - +97568 [ #114105] Math::Trig: add missing SEE ALSO DEBPKG:fixes/math_complex_doc_angle_units - https://bugs.debian.or +g/731505 [ #114106] Math::Trig: document angle units DEBPKG:fixes/cpan_web_link - CPAN: +Add link to main CPAN web site DEBPKG:fixes/time_piece_doc - Time: +:Piece: Improve documentation for add_months and add_years DEBPKG:fixes/extutils_makemaker_reproducible - https://bugs.debian Make perllocal.pod files r +eproducible DEBPKG:fixes/file_path_hurd_errno - File-Path: Fix test failure in + Hurd due to hard-coded ENOENT DEBPKG:debian/hppa_op_optimize_workaround - https://bugs.debian.or +g/838613 Temporarily lower the optimization of op.c on hppa due to gc +c-6 problems DEBPKG:debian/installman-utf8 - Gen +erate man pages with UTF-8 characters DEBPKG:fixes/file_path_chmod_race - + [ #121951] Prevent directory chmod race attack. DEBPKG:fixes/extutils_file_path_compat - Correct the order of test +s of chmod(). (#294) DEBPKG:fixes/getopt-long-2 - [ #120300] Withdraw part o +f commit 5d9947fb445327c7299d8beb009d609bc70066c0, which tries to imp +lement more GNU getopt_long campatibility. GNU DEBPKG:fixes/getopt-long-3 - provide a default value for optional +arguments DEBPKG:fixes/getopt-long-4 - [rt.cp #122068] Fix issue #122068. DEBPKG:fixes/test-builder-reset - R +eset inside subtest maintains parent DEBPKG:debian/hppa_opmini_optimize_workaround - https://bugs.debia Lower the optimization level of opmini.c on hppa DEBPKG:debian/sh4_op_optimize_workaround - +/869373 Also lower the optimization level of op.c and opmini.c on sh4 DEBPKG:fixes/json-pp-example - [ #92793] https://bugs.d fix RT-92793: bug in SYNOPSIS DEBPKG:debian/perldoc-pager - [rt.c #120229] Fix perldoc terminal escapes when sensible-pager is +less DEBPKG:debian/prune_libs - Prune th +e list of libraries wanted to what we actually need. DEBPKG:debian/configure-regen - Reg +enerate Configure et al. after probe unit changes DEBPKG:fixes/rename-filexp.U-phase1 - regen-configure: rename file +xp.U to filexp_path.U, phase 1 DEBPKG:fixes/rename-filexp.U-phase2 - regen-configure: rename file +xp.U to filexp_path.U, phase 2 DEBPKG:fixes/packaging_test_skips - Skip various tests if PERL_BUI +LD_PACKAGING is set DEBPKG:debian/mod_paths - Tweak @INC ordering for Debian DEBPKG:fixes/encode-alias-regexp - +fix DEBPKG:fixes/regex-memory-leak - [910a6a8] +/891196 [perl #132892] perl #132892: avoid leak by mortalizing tempor +ary copy of pattern DEBPKG:fixes/CVE-2018-6797 - [perl #132227] (perl #132227) restart + a node if we change to uni rules within the node and encounter a sha +rp S DEBPKG:fixes/CVE-2018-6798/pt1 - [perl #132063] Heap buffer overfl +ow DEBPKG:fixes/CVE-2018-6798/pt2 - [perl #132063] 5.26.1: fix TRIE_R +EAD_CHAR and DECL_TRIE_TYPE to account for non-utf8 target DEBPKG:fixes/CVE-2018-6798/pt3 - [perl #132063] (perl #132063) we +should no longer warn for this code DEBPKG:fixes/CVE-2018-6798/pt4 - [perl #132063] utf8.c: Don't dump + malformation past first NUL DEBPKG:fixes/CVE-2018-6913 - [perl #131844] (perl #131844) fix var +ious space calculation issues in pp_pack.c DEBPKG:fixes/CVE-2018-12015.patch - [PATCH] [PATCH] Remove existin +g files before overwriting them DEBPKG:fixes/CVE-2018-18311.patch - [PATCH] Perl_my_setenv(); hand +le integer wrap DEBPKG:fixes/CVE-2018-18312.patch - [PATCH 242/242] PATCH: [perl # +133423] for 5.26 maint DEBPKG:fixes/CVE-2018-18313.patch - [PATCH] regcomp.c: Convert som +e strchr to memchr DEBPKG:fixes/CVE-2018-18314.patch - [PATCH] fix #131649 - extended + charclass can trigger assert Built under linux Compiled at Nov 19 2018 15:54:44 @INC: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base
Re^4: Can GTK3 be driven externally?
by holandes777 (Scribe) on Feb 04, 2020 at 14:44 UTC
    Thank you, I will check it out