Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to know if there is a way to write or modify a simple program (I don't really care what language it'll use) that can be launched in GUI mode and will display formated text and URL that will open in a web-browser by a simple clic.

A good example of the program I would like to run is the "About - Information" window that can be found on most programs, example :

disk "About" window

It has everything I look for :

  • Simple windows using same theme as the DE
  • No menu
  • Possibility of displaying images
  • Formated text (bold, italic, font-size)
  • URL links with custom clickable name
  • Buttons (that one is not really important, it could be usefull but I'm afraid it's too hard to configure "actions" for my level in development)

My idea would be going for something like that (where orange is a URL link) :

enter image description here

Note : I just drew that, it isn't an existing program.


I unfortunately don't have time to learn a developer language like C++, Python, QT, but I can examine a file with gedit (or alike) and adapt the content, that shouldn't be really difficult as I have experience on looking at configuration files and modifying them, you know, to see what would happen if I change this or that.

Are there any prebuilt code I could use and/or modify ?

Thanks

PS: HTML would have been great but apparently there's no easy way to achieve this, nor prebuilt "html interpretator non web-browser" I could use.

share|improve this question
1  
Can't you just use an existing browser, like Midori, which has an -a app option, or SeaMonkey, which can have the title bars hidden. –  Wilf Jan 7 at 17:23
3  
I believe you are reinventing the wheel here. If you really need to do that, I think your best bet should be implementing an engine that's already coded (like Gecko, V8, etc). But you should be an experienced programmer for this alternative to have any chance to work. Anyway, the point is: Building a layout engine isn't trivial. M$ itself has had severe troubles doing it appropriately. lol –  GabrielF Jan 7 at 17:28
1  
"PyXPCOM allows for communication between Python and XPCOM, such that a Python application can access XPCOM objects, and XPCOM can access any Python class that implements an XPCOM interface. With PyXPCOM, a developer can talk to XPCOM or embed Gecko from a Python application": developer.mozilla.org/en-US/docs/PyXPCOM –  GabrielF Jan 7 at 17:35
1  
"HulaHop is Gecko 1.9 (Firefox 3.0 core) web browser as a simple embeddable control with Python DOM access. It is a PyGTK Widget that you can use in your application to embed a web browser": wiki.laptop.org/go/HulaHop –  GabrielF Jan 7 at 17:37
1  
Ok thanks for the informations, I'll upgrade my question knowing that html is NOT suitable for offline projects independent of a web-browser, since it requires a layout engine that can't be embedded simply with a commandline, and since lot of web-browser uses different engines. –  MrVaykadji Jan 7 at 17:47
show 4 more comments

1 Answer 1

Why not using QML and the Ubuntu SDK to build such screens? Here's a snippet of code that you could use to embed images, links and controls:

demo.qml

import QtQuick 2.0
import Ubuntu.Components 0.1

MainView {
    id: main
    width: units.gu(100)
    height: units.gu(75)

    Column {
        anchors.centerIn: parent
        spacing: units.gu(5)
        Text{
            text: "Hello"
        }

        Text{
            text: '<a href="http://askubuntu.com">askubuntu</a>'
            onLinkActivated: Qt.openUrlExternally(link)
        }

        Button {
            text: "button"
        }
    }
}

To run it, use qmlscene:

qmlscene ./demo.qml
share|improve this answer
    
Unfortunately, if I had time to learn QML, I would also have time to learn Python :/ –  MrVaykadji Mar 10 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.