XPCE Hide/Show elements

Good day everyone,

I want to control the visibility of certain XPCE elements (like labels, buttons, or whole dialog groups), e.g. I am looking for something like:

send(element, visibility, false),

I would also greatly appreciate a hint on how I can find information like this myself. I am aware that there are several tools provided by XPCE. I tried searching with the search tool and the class browser for key words like “hide” or “visible” to get a direction, however this did not seem expedient. Perhaps I had the wrong idea using them?

I’m using: SWI-Prolog version 8.4.3 and my code with example elements looks like this:

test1:-new(D,dialog('Delete & replace text in Word-2007-file')),
    new(grp, dialog_group('')),

    % Label
    send(grp, append, label(label1_wo2,'Either: Select ''Master''-word-2007-file for delete/replace/expand text'),below),

    % Button
    send(grp, append, button( '->', message( @prolog, wo2_chooseFile))),
    send(D, append, grp, below),
    send(D,open).

Thanks a lot to everyone reading this!

Best regards,
Malo

The method is called displayed, i.e., send(Something, displayed, @off) to hide it.

The library code contains a lot of examples. Otherwise the class browser helps a lot finding methods.

xpce is pretty old though and barely maintained. It is based on old traditions, which also applies for the terminology used. Think SunView and Xt :slight_smile: These days it is more common to implement user interfaces as web applications, using Prolog as web server.

2 Likes

I think xpce is quite useful, especially in embedded environments where you don’t want to run a browser.

1 Like