As an alternative to the X11 version of wxWidgets, I noticed there was a GTK version, and thought Raspberry Pi might support it. Its not there either and apt-get is not finding it either. Does anyone know how to get any graphics programming which is supported by wxWidgets to install on the RasPi? This is getting quite frustrating.
Regards,
Colin Begg
GTK+ Toolkit?
22 posts
- Posts: 15
- Joined: Sat Jun 16, 2012 10:32 pm
I'm using the Arch image from the download page, and wxgtk and wxpython in its repo.
Mark
Mark
- Posts: 1
- Joined: Mon Jul 09, 2012 11:11 pm
Hi Mark,
I was disappointed with the Debian distro when using it for serious C++ development so tried the ArchLinux one. After getting X up, first using Enlightenment (not impressed) then switching to good old LXDE and adding Midori (and NTP to stop confusing Make!), I got wxWidgets built (the package which needed GTK+).
Part way through that, I filled the 1.8Gb partition ArchLinux installs into and had to run up Ubuntu on an old Netbook to expand the partition to fill the 16Gb SDHC I'd put it onto. Then the build completed OK.
I'm now onto building the RocRail software to control my model railway using the Raspberry Pi with DCC and Loconet. That's my purpose for the Raspberry Pi!
So, with perseverance, the ArchLinux distro can do more serious development.
Regards,
Colin Begg
I was disappointed with the Debian distro when using it for serious C++ development so tried the ArchLinux one. After getting X up, first using Enlightenment (not impressed) then switching to good old LXDE and adding Midori (and NTP to stop confusing Make!), I got wxWidgets built (the package which needed GTK+).
Part way through that, I filled the 1.8Gb partition ArchLinux installs into and had to run up Ubuntu on an old Netbook to expand the partition to fill the 16Gb SDHC I'd put it onto. Then the build completed OK.
I'm now onto building the RocRail software to control my model railway using the Raspberry Pi with DCC and Loconet. That's my purpose for the Raspberry Pi!
So, with perseverance, the ArchLinux distro can do more serious development.
Regards,
Colin Begg
- Posts: 15
- Joined: Sat Jun 16, 2012 10:32 pm
control model railroad, you say?
Pictures!
Please!
-r
-=-
Pictures!
Please!
-r
-=-
-=-
- Posts: 1
- Joined: Mon Aug 06, 2012 12:16 am
Screen photo of my Raspberry Pi running Rocrail, as requested! Not sure how long it'll last, its from a Pinterest cache.

Alternatively: http://pinterest.com/pin/38773246762670497/
Just gotta get the wireless network going for iPhone / iPad throttles.
All the best
Colin

Alternatively: http://pinterest.com/pin/38773246762670497/
Just gotta get the wireless network going for iPhone / iPad throttles.
All the best
Colin
- Posts: 15
- Joined: Sat Jun 16, 2012 10:32 pm
I can only recommend to use GTK (with the excellent PyGTK bindings) directly instead. wx is badly designed, badly documented, buggy and a lot of bloat. The Python bindings are a mess, too.
I've used a lot of UI toolkits, and wx is about the worst I've seen yet.
I've used a lot of UI toolkits, and wx is about the worst I've seen yet.
- Posts: 190
- Joined: Sat Jan 28, 2012 8:07 pm
@cbegg50: I have `python-wxgtk2.8` and the necessary dependencies installed from the repositories in Raspbian.
- Code: Select all
while not self.asleep():
sheep += 1
- Posts: 288
- Joined: Sat Aug 04, 2012 8:28 am
My Raspian distro didn't include wxGTK, is 'python-wxgtk2.8' the package I need to install?
Thanks,
Colin Begg
Thanks,
Colin Begg
- Posts: 15
- Joined: Sat Jun 16, 2012 10:32 pm
If you want to program in Python then yes. If you want to program in C++ it is `libwxgtk2.8` and `libwxgtk2.8-dev`.
- Code: Select all
while not self.asleep():
sheep += 1
- Posts: 288
- Joined: Sat Aug 04, 2012 8:28 am
Yes, its C++. Together with libwxbase2.8 and libwxbase2.8-dev (I think) which pulled in the includes and libs I needed to build Rocrail on Raspbian, as you can see:


- Posts: 15
- Joined: Sat Jun 16, 2012 10:32 pm
lb wrote:I can only recommend to use GTK (with the excellent PyGTK bindings) directly instead. wx is badly designed, badly documented, buggy and a lot of bloat. The Python bindings are a mess, too.
I've used a lot of UI toolkits, and wx is about the worst I've seen yet.
I would also suggest avoiding wx. I've been using it and have just found it to be convoluted and counter-intuitive, and while it is cross-platform I've found some annoying discrepancies which appeared when porting from windows.
- Posts: 1
- Joined: Sun Jul 08, 2012 9:16 pm
If I want to run RocRail model train control software, I have no choice. WxWidgets is what it uses for cross-platform graphics. RocRail runs on PC, MAC and various flavours of Linux (Raspberry Pi varieties now included). I don't doubt there are better graphics toolkits, but I don't fancy writing my own DCC software from scratch, when RocRail works so well.
Best Regards,
Colin Begg
Best Regards,
Colin Begg
- Posts: 15
- Joined: Sat Jun 16, 2012 10:32 pm
Aquaticpenguin wrote:I would also suggest avoiding wx. I've been using it and have just found it to be convoluted and counter-intuitive, and while it is cross-platform I've found some annoying discrepancies which appeared when porting from windows.
I disagree strongly with this observation. I am the original author of wxLua (wxlua.sourceforge.net) - which runs fine on the Pi BTW, and I had very few problems with wx. There were are very few incompatibilities between the platforms. Wx and wxPython is used by many shipping applications.
- Posts: 42
- Joined: Mon Jul 02, 2012 2:21 am
- Location: Oxford, England
I heard there was a GTK+ which skipped using X, and worked on the direct framebuffer. Also Qt works without X, (the right version). If X's only reasons for being are to open a graphics surface... done... provide a toolkit abstraction few use any more... make a compatibility layer to GTK+ or Qt... Even Tcl/Tk seems to be going down the native widget look... Open a xsession on another device over a network using a much maligned protocol ... when the vertex group of the display is what should be sent....
X11 should be replaced by G12, or whatever it gets called, and it should provide a hook so Qt windows can open too.
Cheers Jacko
X11 should be replaced by G12, or whatever it gets called, and it should provide a hook so Qt windows can open too.
Cheers Jacko
Pi=B256R0USB CL4SD8GB Raspbian Stock. 13D https://dl.dropbox.com/u/1615413/Own%20Work/Dimensions.pdf ... Looking for an interesting project to hold my attention.
Colin,
Please (pretty please!!) can you make your compiled version of Rocrail available to the community, or failing that just me
I'll take it warts and all, the current version is stable enough for my limited usage of the software.
My purpose in acquiring a Raspberry Pi was exactly the same as yours - in order to run Rocrail.
Failing that, then an idiots guide on how to port the code would be appreciated.
Good Job!
Please (pretty please!!) can you make your compiled version of Rocrail available to the community, or failing that just me
My purpose in acquiring a Raspberry Pi was exactly the same as yours - in order to run Rocrail.
Failing that, then an idiots guide on how to port the code would be appreciated.
Good Job!
- Posts: 6
- Joined: Wed Aug 22, 2012 12:29 am
Rocrail/Rocview cross compiled and running successfully (albeit slowly) on a Pi version 2, using the instructions given on Rocrail wiki - no issues.
Build time was approx. 4 hours, reminds me of the bad old days!
Build time was approx. 4 hours, reminds me of the bad old days!
- Posts: 6
- Joined: Wed Aug 22, 2012 12:29 am
cbegg50 wrote:If I want to run RocRail model train control software, I have no choice. WxWidgets is what it uses for cross-platform graphics. RocRail runs on PC, MAC and various flavours of Linux (Raspberry Pi varieties now included). I don't doubt there are better graphics toolkits, but I don't fancy writing my own DCC software from scratch, when RocRail works so well.
Best Regards,
Colin Begg
Hi
Does RocRail support the Lenz system or is it just the Roco one?
Cheers
Paul
Procrastination - The Thief of Time.
- Posts: 343
- Joined: Tue May 29, 2012 2:51 pm
- Location: Lincolnshire UK
Hi Paul,
Rocrail has no relationship to Roco. It supports a whole host of DCC systems including Lenz. It also has been transferred to many different operating systems.
You will find further information at http://wiki.rocrail.net/doku.php There is an install package for Raspberry.
Rocrail has no relationship to Roco. It supports a whole host of DCC systems including Lenz. It also has been transferred to many different operating systems.
You will find further information at http://wiki.rocrail.net/doku.php There is an install package for Raspberry.
Last edited by zenod on Sat Dec 15, 2012 11:17 pm, edited 1 time in total.
- Posts: 6
- Joined: Wed Aug 22, 2012 12:29 am
Hi,
I resurrected my Raspberry this weekend and the o/s performance is markedly improved, more stable and faster, than the original release.
I am currently rebuilding Rocrail/Rocview from the current source. I hope that Rocrail (the server) will now be usable on the Raspberry. I am not holding out any hopes for Rocview at the moment.
Will post again later.
Regards
Zenod
I resurrected my Raspberry this weekend and the o/s performance is markedly improved, more stable and faster, than the original release.
I am currently rebuilding Rocrail/Rocview from the current source. I hope that Rocrail (the server) will now be usable on the Raspberry. I am not holding out any hopes for Rocview at the moment.
Will post again later.
Regards
Zenod
- Posts: 6
- Joined: Wed Aug 22, 2012 12:29 am
Hi,
I am pleased to report that I have had good success with the Rocrail model railway control system on the Rpi.
Several months ago, the Raspberry pi was unstable in several area. It was so bad that I put mine away for a while.
There is a marked improvement now with USB drivers, wireless dongles, serial dongles, networking and performance. My RPI is a version "B" 256m.
The USB issues I encountered earlier have been resolved. I have installed a wireless lan adaptor and a serial to DCC convertor, Locobuffer 2 for Digitrax hardware. Incidentally I have also successfully tested an earlier RS232 version of locobuffer (from Hans de Loof) with a serial dongle.
My setup now includes a full Webmin installation for administration (!).
Here is the RR-Cirkits interface being recognised on my system.
Dec 17 23:45:47 raspberrypi kernel: [ 953.838477] usb 1-1.3: New USB device found, idVendor=0403, idProduct=c7d0
Dec 17 23:45:47 raspberrypi kernel: [ 953.838505] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 17 23:45:47 raspberrypi kernel: [ 953.838523] usb 1-1.3: Product: LocoBuffer-USB
Dec 17 23:45:47 raspberrypi kernel: [ 953.838536] usb 1-1.3: Manufacturer: RR-CirKits
I successfully rebuilt Rocrail from source using a recent nightly release using a nfs connected network drive. The instructions for rebuilding are on the Rocrail website(Incidentally there is a pre-compiled download available for the RPI of an earlier version of Rocrail for download).
Rocrail consists of a server (Rocrail) plus a viewer (Rocview). I was really only interested in the server part but found that Rocview did run, slowly, on my setup. That is not surprising as I am connecting remotely through a wireless link.
Here are a few lines from the Rocrail logs as it started up on my machine.
TM and Copyright 2002-2012 Rob Versluis.
All Rights Reserved.
r.j.versluis@rocrail.net
http://www.rocrail.net
License: GNU GPL 2
http://www.gnu.org/licenses/gpl.txt
Without an official permission commercial use is not permitted.
--------------------------------------------------
Rocrail 2.0 "Sunrise"
Revision: 4423
Build: Dec 16 2012 16:24:23
librocs 2.0-0 build Dec 16 2012 16:20:01
processid = 2792
....
20121217.235046.206 r9999I clocktic OLocoNet 1668 Got fast clock slot
20121217.235046.209 r9999I clocktic OLocoNet 1680 set clock
20121217.235046.273 r9999c clocktic lnmon 1060 Write Fast Clock: (Data is Valid)
I have no performance issue with Rocrail server so far being able to connect to the wireless Rocrail server and control the trains and layout, manually or automatically, remotely from any computer that can run Rocview. This includes Windows, Linux and Mac computers. There is also an app for Android devices which turns a smart device into a throttle.
Regards and Happy Christmas.
I am pleased to report that I have had good success with the Rocrail model railway control system on the Rpi.
Several months ago, the Raspberry pi was unstable in several area. It was so bad that I put mine away for a while.
There is a marked improvement now with USB drivers, wireless dongles, serial dongles, networking and performance. My RPI is a version "B" 256m.
The USB issues I encountered earlier have been resolved. I have installed a wireless lan adaptor and a serial to DCC convertor, Locobuffer 2 for Digitrax hardware. Incidentally I have also successfully tested an earlier RS232 version of locobuffer (from Hans de Loof) with a serial dongle.
My setup now includes a full Webmin installation for administration (!).
Here is the RR-Cirkits interface being recognised on my system.
Dec 17 23:45:47 raspberrypi kernel: [ 953.838477] usb 1-1.3: New USB device found, idVendor=0403, idProduct=c7d0
Dec 17 23:45:47 raspberrypi kernel: [ 953.838505] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 17 23:45:47 raspberrypi kernel: [ 953.838523] usb 1-1.3: Product: LocoBuffer-USB
Dec 17 23:45:47 raspberrypi kernel: [ 953.838536] usb 1-1.3: Manufacturer: RR-CirKits
I successfully rebuilt Rocrail from source using a recent nightly release using a nfs connected network drive. The instructions for rebuilding are on the Rocrail website(Incidentally there is a pre-compiled download available for the RPI of an earlier version of Rocrail for download).
Rocrail consists of a server (Rocrail) plus a viewer (Rocview). I was really only interested in the server part but found that Rocview did run, slowly, on my setup. That is not surprising as I am connecting remotely through a wireless link.
Here are a few lines from the Rocrail logs as it started up on my machine.
TM and Copyright 2002-2012 Rob Versluis.
All Rights Reserved.
r.j.versluis@rocrail.net
http://www.rocrail.net
License: GNU GPL 2
http://www.gnu.org/licenses/gpl.txt
Without an official permission commercial use is not permitted.
--------------------------------------------------
Rocrail 2.0 "Sunrise"
Revision: 4423
Build: Dec 16 2012 16:24:23
librocs 2.0-0 build Dec 16 2012 16:20:01
processid = 2792
....
20121217.235046.206 r9999I clocktic OLocoNet 1668 Got fast clock slot
20121217.235046.209 r9999I clocktic OLocoNet 1680 set clock
20121217.235046.273 r9999c clocktic lnmon 1060 Write Fast Clock: (Data is Valid)
I have no performance issue with Rocrail server so far being able to connect to the wireless Rocrail server and control the trains and layout, manually or automatically, remotely from any computer that can run Rocview. This includes Windows, Linux and Mac computers. There is also an app for Android devices which turns a smart device into a throttle.
Regards and Happy Christmas.
- Posts: 6
- Joined: Wed Aug 22, 2012 12:29 am
Hi
I would like connect library GTK+ and wiringPi. I use this code:
#include <gtk/gtk.h>
int main (int argc, char *argv[]) {
GtkWidget *okno;
gtk_init (&argc, &argv);
okno = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (okno);
gtk_main ();
return 0;
}
and I would like add:
#include <stdio.h>
#include <wiringPi.h>
int main (void)
{
printf (“Raspberry Pi blink\n”) ;
if (wiringPiSetup () == -1)
return 1 ;
pinMode (0, OUTPUT) ; // aka BCM_GPIO pin 17
for (;;)
{
digitalWrite (0, 1) ; // On LED podlaczona do GPIO
delay (500) ; // mS
digitalWrite (0, 0) ; // Off LED podlaczona do GPIO
delay (500) ;
}
return 0 ;
}
I added this code
digitalWrite (0, 1) ; // On LED podlaczona do GPIO
delay (500) ; // mS
digitalWrite (0, 0) ; // Off LED podlaczona do GPIO
delay (500) ;
in function of gtk_main (), but when you add the braces is
I get an error that missing semicolons.
Could you tell me, which function I must add this code?
I would like connect library GTK+ and wiringPi. I use this code:
#include <gtk/gtk.h>
int main (int argc, char *argv[]) {
GtkWidget *okno;
gtk_init (&argc, &argv);
okno = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (okno);
gtk_main ();
return 0;
}
and I would like add:
#include <stdio.h>
#include <wiringPi.h>
int main (void)
{
printf (“Raspberry Pi blink\n”) ;
if (wiringPiSetup () == -1)
return 1 ;
pinMode (0, OUTPUT) ; // aka BCM_GPIO pin 17
for (;;)
{
digitalWrite (0, 1) ; // On LED podlaczona do GPIO
delay (500) ; // mS
digitalWrite (0, 0) ; // Off LED podlaczona do GPIO
delay (500) ;
}
return 0 ;
}
I added this code
digitalWrite (0, 1) ; // On LED podlaczona do GPIO
delay (500) ; // mS
digitalWrite (0, 0) ; // Off LED podlaczona do GPIO
delay (500) ;
in function of gtk_main (), but when you add the braces is
I get an error that missing semicolons.
Could you tell me, which function I must add this code?
- Posts: 12
- Joined: Wed Jan 30, 2013 8:40 am
That is a call to "gtk_main" not the definition of the function. Once you've called gtk_main() you loose direct control and gtk_main only returns when the gui exits.
To get things to happen asynchronously once gtk is in control you will need to add a timer and a callback handler.
Have a look at the timer example on this web page : http://zetcode.com/tutorials/gtktutorial/gtkevents/
HTH
PeterO
To get things to happen asynchronously once gtk is in control you will need to add a timer and a callback handler.
Have a look at the timer example on this web page : http://zetcode.com/tutorials/gtktutorial/gtkevents/
HTH
PeterO