1. Tree structure (Linux GUI)

I want to create program, that operates some objects in manner, similar to files in file manager. I want to see tree, add new "leafs" or "branches", rename/remove any of them etc. It will be some kind of database, but organized in tree-like view, not in two-dimensional tables. I think, Euphoria is extremely useful for such things. Unfortunately, I never code any GUI applications in Linux or in Windows, in Euphoria or in any other language. From where you advise me to start?

new topic     » topic index » view message » categorize

2. Re: Tree structure (Linux GUI)

SocIoDim said...

I want to create program, that operates some objects in manner, similar to files in file manager. I want to see tree, add new "leafs" or "branches", rename/remove any of them etc. It will be some kind of database, but organized in tree-like view, not in two-dimensional tables. I think, Euphoria is extremely useful for such things. Unfortunately, I never code any GUI applications in Linux or in Windows, in Euphoria or in any other language. From where you advise me to start?

I've been doing something like this for wxIDE. Opened files are displayed in a tree form using directories. As files are opened or closed, the tree is updated accordingly. The implementation is in:

http://sourceforge.net/p/wxeuphoria/ide/code/ci/default/tree/files.e

Some of the work is done by wxWidgets and the wxTreeCtrl. Some of the important routines in that file regarding the tree manipulation:

  • create_tree_path
  • get_children
  • reparent
  • add_file
  • remove_file_from_tree

You can, of course, see it in action if you download it. smile Although you might need to build wxEuphoria / wxWidgets yourself on Linux.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: Tree structure (Linux GUI)

mattlewis said...

Some of the work is done by wxWidgets and the wxTreeCtrl.

Apparently, this is what I need. After examining my system (CrunchBang Linux 11), I found pre-installed packages "libwxgtk2.8-0" and "libwxbase2.8-0". That will be enough for installing wxEuphoria binaries? I read the files "readme.txt" and "install.txt", but they explains how to install from source. BTW, I do not have $EUINC, though the Euphoria was installed as deb-package.

To install wxEuphoria on Linux or FreeBSD: 
---------------------------------------------- 
  * Put: 
         wxEuphoria/include/wxeud.e  
    ...into a directory on your $EUINC path. If you're not sure which  
    those directories are, from the command line: 
     
    $ echo $EUINC 

new topic     » goto parent     » topic index » view message » categorize

4. Re: Tree structure (Linux GUI)

SocIoDim said...
mattlewis said...

Some of the work is done by wxWidgets and the wxTreeCtrl.

Apparently, this is what I need. After examining my system (CrunchBang Linux 11), I found pre-installed packages "libwxgtk2.8-0" and "libwxbase2.8-0". That will be enough for installing wxEuphoria binaries? I read the files "readme.txt" and "install.txt", but they explains how to install from source. BTW, I do not have $EUINC, though the Euphoria was installed as deb-package.

The version I'm using with wxIDE is a bit more bleeding edge. It actually uses wxWidgets 2.9. They have basically the same dependencies, but differences in gcc and other library versions could mean that the uploaded binaries won't work for you. It was build on Kubuntu 12.04. I upgraded recently to 13.04, and those binaries still work for me, but I'm not familiar with CrunchBang.

SocIoDim said...

To install wxEuphoria on Linux or FreeBSD: 

Those are old instructions. You should be configuring your include paths using eu.cfg with 4.0+. If you need to build wxEuphoria yourself, download this tarball of wxEuphoria code.

There are instructions in the readme (and please ask if you need help):

To build wxEuphoria on Linux: 
 
* Download the latest wxWidgets 2.9 source from www.wxWidgets.org, or 
  install wxWidgets 2.9.x using your package manager (in which case, 
  you can skip the next two steps of building the wxWidgets binaries) 
   
   
* Dependencies:  You must have the following packages installed in order 
  to build wxEuphoria from source: 
      * libwxgtk2.9-dev 
      * gtk+-2.0-dev 
      * libpango1.0-dev 
* On a Debian based system you can do: 
  # agt-get build-dep libwxgtk2.8-0 
  (or whatever version of wxWidgets is in your package manager) 
 
* From the base directory where you decompressed wxWidgets, type: 
 
   $ ./configure --enable-monolithic --enable-mediactrl --enable-unicode --enable-shared \ 
    --disable-stc --disable-debug VENDOR=eu 
   $ make 
   $ make install 
 
* The binaries will be moved to a system directory.  You may need to 
  run ldconfig (or /sbin/ldconfig) on the directory where the binaries 
  were installed. 
 
* From the wxEuphoria source directory, type: 
  $ ./configure path/to/wxWidgets 
  $ make 
  $ make install 
 
* The shared library will be moved to a system directory.  You may need to 
  run ldconfig (or /sbin/ldconfig) on the directory where the binaries 
  were installed (should be /usr/local/lib). 

Matt

new topic     » goto parent     » topic index » view message » categorize

5. Re: Tree structure (Linux GUI)

CrunchBang 11 uses Debian Wheezy repos. I'm not mature Linux-user yet, so I want to use wxWidgets from official repos. For the same reasons I do not want to install from source.

So, I just ran file manager Thunar as root and moved "libwx.e" to directory "/usr/share/euphoria/include/", and "libwxeu.so.16" to "/usr/local/lib". Tomorrow I'll check it out.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Tree structure (Linux GUI)

SocIoDim said...

CrunchBang 11 uses Debian Wheezy repos. I'm not mature Linux-user yet, so I want to use wxWidgets from official repos. For the same reasons I do not want to install from source.

So, I just ran file manager Thunar as root and moved "libwx.e" to directory "/usr/share/euphoria/include/", and "libwxeu.so.16" to "/usr/local/lib". Tomorrow I'll check it out.

If you have issues running wxEuphoria ("library not found", etc.) make sure you run ldconfig on the library:

sudo ldconfig /usr/local/lib/libwxeu.so.16 

Also, mind your bitness. If you're running a 64-bit distro, you should probably move to Euphoria 4.1 (still in development) and Matt's bleeding-edge 64-bit wxEuphoria binaries.

-Greg

new topic     » goto parent     » topic index » view message » categorize

7. Re: Tree structure (Linux GUI)

SocIoDim said...

CrunchBang 11 uses Debian Wheezy repos. I'm not mature Linux-user yet, so I want to use wxWidgets from official repos. For the same reasons I do not want to install from source.

I can understand your hesitancy, but I think the instructions are pretty good, and are probably a good way to dip your toes in.

SocIoDim said...

So, I just ran file manager Thunar as root and moved "libwx.e" to directory "/usr/share/euphoria/include/", and "libwxeu.so.16" to "/usr/local/lib". Tomorrow I'll check it out.

You should be able to run the demos and older versions of wxIDE though those won't have the tree code you're interested in. You may need to build the wxEuphoria library. C++ has a notoriously unstable ABI.

Matt

new topic     » goto parent     » topic index » view message » categorize

8. Re: Tree structure (Linux GUI)

mattlewis said...
SocIoDim said...

CrunchBang 11 uses Debian Wheezy repos. I'm not mature Linux-user yet, so I want to use wxWidgets from official repos. For the same reasons I do not want to install from source.

I can understand your hesitancy, but I think the instructions are pretty good, and are probably a good way to dip your toes in.

Also, because it's not clear from your messages, did you try downloading and running wxIDE v0.8.2? It comes with precompiled versions of wxWidgets and wxEuphoria, so it may all work for you. It also comes with a bleeding edge euphoria and translator (from the code branch with the experimental memstruct support).

Alternatively, you could try the Windows versions, if only to play around with. The 32 and 64-bit versions both run under WINE.

Matt

new topic     » goto parent     » topic index » view message » categorize

9. Re: Tree structure (Linux GUI)

mattlewis said...

Also, because it's not clear from your messages, did you try downloading and running wxIDE v0.8.2?

No.

said...

Alternatively, you could try the Windows versions, if only to play around with. The 32 and 64-bit versions both run under WINE.

I do not want to play, I want to work. :) I remember the communist slogan:

We needn't the sun - Party shines on us!
We needn't the bread - give us a job!

I want to create something similar to this, but for Linux - http://ipic.su/img/img7/fs/header-bg2.1369285799.jpg Which way is the easiest?

new topic     » goto parent     » topic index » view message » categorize

10. Re: Tree structure (Linux GUI)

SocIoDim said...

I want to create something similar to this, but for Linux - http://ipic.su/img/img7/fs/header-bg2.1369285799.jpg Which way is the easiest?

Um, well... I wrapped wxHtmlListBox into wxEuphoria last year, so if you are using Matt's bleeding-edge build (from wxIDE), it should be included. That would allow you to create a list of that style. You just have to use add_item() with simple HTML content.

I've also worked separately on wrapping wxFlatNoteBook which would allow you to create those colored tabs. I'll see if I can dig it out and get it posted. It's a separate library build I've been working on called wxEuphoria-Contrib.

-Greg

new topic     » goto parent     » topic index » view message » categorize

11. Re: Tree structure (Linux GUI)

If your distro has GTK version 3.xx, you can avoid all the compiling and such by downloading EuGTK. I've just posted the latest version here: https://sites.google.com/site/euphoriagtk/

It will certainly do what you want, with probably less of a learning curve than wxWidgets.

If you'd like a working demo, I'll put one together when I get home tonight.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Tree structure (Linux GUI)

As promised, here's a picture of a todo-list in EuGTK, along with source code. https://sites.google.com/site/euphoriagtk/

It's pretty easy to do, the complete interface is only < 150 lines of code (I didn't write the functions to connect and manage a database).

Which brings up a point: people keep asking for a GUI 'designer', but considering that a designer isn't going to automagically write the Euphoria code to manage the data, reading files, etc... that means that a designer is only going to do a small portion of the work required for building a real app. Which is why I haven't put much effort into writing one.

new topic     » goto parent     » topic index » view message » categorize

13. Re: Tree structure (Linux GUI)

As promised, here's a picture of a todo-list in EuGTK, along with source code. https://sites.google.com/site/euphoriagtk/

I think it looks very much like the example you provided.

It's pretty easy to do, the complete interface is only < 150 lines of code (I didn't write the functions to connect and manage a database).

Which brings up a point: people keep asking for a GUI 'designer', but considering that a designer isn't going to automagically write the Euphoria code to manage the data, reading files, etc... that means that a designer is only going to do a small portion of the work required for building a real app. Which is why I haven't put much effort into writing one.

new topic     » goto parent     » topic index » view message » categorize

14. Re: Tree structure (Linux GUI)

irv said...

As promised, here's a picture of a todo-list in EuGTK, along with source code. https://sites.google.com/site/euphoriagtk/

hahaha! That's a great to-do list! :D

new topic     » goto parent     » topic index » view message » categorize

15. Re: Tree structure (Linux GUI)

Wonderful! Can you create Win-version too? I wanted to do a similar program, but with the tab "Focus". On this tab automatically gets the most urgent and high priority task.

I wanted to rename other tabs to "Critical Now", "Opportunity Now" and "Over the Horizon". http://www.dextronet.com/blog/one-minute-to-do-list/

Also, I wanted to implement the sub-tasks and partially completed tasks. For example, the project "The Game" has a sub-tasks: "AI", "3D-engine", "Textures" and "Sounds". If the AI ​​is made by 100%, 3D-engine by 0%, Textures by 60% and Sounds by 40%, then the whole project made by (100+0+60+40)/4=50%. http://ipic.su/img/img7/fs/avatar_68910.1370076603.png

I think, this is very nice and unique to-do list. Most of all based on GTD principle, but it is not useful for creative and unorganized people, such as freelancers and artists.

Why not to publish it on SourceForge.net?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu