# How to change the text size in the toc\_folder using XPCE?

**URL:** <https://swi-prolog.discourse.group/t/how-to-change-the-text-size-in-the-toc-folder-using-xpce/6688>\
**Category:** General\
**Created:** [July 5, 2023, 1:36am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-text-size-in-the-toc-folder-using-xpce/6688 "2023-07-05T01:36:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denzel](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/denzel/32/6149_2.png) [@Denzel](https://swi-prolog.discourse.group/u/Denzel)\
**Post date:** [July 5, 2023, 1:36am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-text-size-in-the-toc-folder-using-xpce/6688/1 "2023-07-05T01:36:54Z")

</div>

Hi, everybody.  
I’m working with the pce\_toc library, however when creating a directory-hierarchy the font size that is shown on the window is very small, How can I increase the font size in both files and directories?.  
I have tried to change these lines of code but I get no results.

```prolog
        get(SubDirsNames, map, ?(D, directory, @arg1), SubDirs),
        send(SubDirs, for_all, message(FB, son, D, create(toc_folder, @arg1?name, @arg1))),
        get(FileNames, map, ?(D, file, @arg1), SubFiles),
        send(SubFiles, for_all, message(FB, son, D, create(toc_file, @arg1?base_name, @arg1)))

```

This is the complete code:

```prolog
:- use_module(library(pce)).
:- pce_autoload(toc_window, library(pce_toc)).
:- pce_autoload(report_dialog, library(pce_report)).
:- pce_begin_class(explorer, frame, "Explore the filesystem").

initialise(E, Dir:directory) :->
        "Explore from directory"::
        send_super(E, initialise, 'Explorador de Archivos'),
        send(E, append, new(DH, directory_hierarchy(Dir))),
        send(DH, size, size(800, 600)),
        send(new(report_dialog), below, DH).

open_node_final(_,Node:file) :->
        "Show file content of opened node"::  
        retractall(selected_file(_)),
        write(Node),
        new(I,image(Node)),
        new(Bitmap,bitmap(I)),
        % Prueba de dialogo
        new(G,dialog('Nombre del Dialogo')),
        % Dos botones
        new(Desplegable,menu(segmentacion,cycle)),
        new(Button1,button('Realizar operación',
        					message(@prolog,guardar_imagen,Node,Desplegable?selection))),

        new(@boton_aux, button('Cerrar Dialogo',
				and(
					message(G,destroy),
					message(G,free),
					message(@boton_aux, free)))),
        send_list(Desplegable,append,[bordes,umbral,regiones]),
        send(G,display,Bitmap),
        send(G,append(Desplegable)),
        send(G,append(Button1)),
        send(G,append(@boton_aux)),
        send(G,open).
        
guardar_imagen(Node,Menus) :- assertz(selected_file(Node)),
                                write(Menus).

:- pce_end_class.
% -------------------------------------------------
% Clase de la jerarquía de directorios
% -------------------------------------------------
:- pce_begin_class(directory_hierarchy, toc_window,
                   "Browser for a directory-hierarchy").

initialise(FB, Root:directory) :->
        send(FB, send_super, initialise),
        get(Root, name, Name),
        send(FB, root, toc_folder(Name, Root)).

expand_node(FB, D:directory) :->
        "Called if a node is to be expanded"::
        new(SubDirsNames, chain),
        new(FileNames, chain),
        send(D, scan, FileNames, SubDirsNames),
        get(SubDirsNames, map, ?(D, directory, @arg1), SubDirs),
        send(SubDirs, for_all, message(FB, son, D, create(toc_folder, @arg1?name, @arg1))),
        get(FileNames, map, ?(D, file, @arg1), SubFiles),
        send(SubFiles, for_all, message(FB, son, D, create(toc_file, @arg1?base_name, @arg1))).
	
open_node(FB, Node:file) :->
        "Called if a file is double-clicked"::
        send(FB?frame, open_node_final, Node).

:- pce_end_class.

```

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [July 5, 2023, 6:20am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-text-size-in-the-toc-folder-using-xpce/6688/2 "2023-07-05T06:20:56Z")

</div>

from the [guide](https://www.swi-prolog.org/download/xpce/doc/userguide/userguide.pdf#page=145&zoom=100,108,436), seems that you could try to send font changing messages to the objects toc\_file and toc\_folder… before delving into this, please wait for hints from more knowledgeable people… I’m unsure it’s the proper way.  
What I would do, instead, is first try to change the global XPCE font size: open ‘Settings \ GUI preferences…’ from the (windows) console menu, and uncomment the last line, changing the default to 1.5.

---

<div class="post-metadata">

**Author:** ![PasiK](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/pasik/32/84_2.png) [@PasiK](https://swi-prolog.discourse.group/u/PasiK)\
**Post date:** [July 8, 2023, 7:45pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-text-size-in-the-toc-folder-using-xpce/6688/3 "2023-07-08T19:45:21Z")

</div>

My Windows 10 works fine, no font problems, from you source:

```prolog
?- new(D,directory_hierarchy(.)).
D = @342833116757/directory_hierarchy.

?- in_pce_thread(send( $D,show,true)).
D = @342833116757/directory_hierarchy.

```

---

<div class="post-metadata">

**Author:** ![anon419083](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anon419083](https://swi-prolog.discourse.group/u/anon419083)\
**Post date:** [July 8, 2023, 9:18pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-text-size-in-the-toc-folder-using-xpce/6688/4 "2023-07-08T21:18:53Z")

</div>

PasiK is definitey the XPCE expert of this group 😅
