Bah.GTKMaxGui - Dependencies?

BlitzMax Forums/Brucey's Modules/Bah.GTKMaxGui - Dependencies?

Grisu(Posted 2013) [#1]
Hi!

I'd love to try out the GTK MaxGui module, but am missing some components.

Is there a newbie friendly script around that installs all the files needed? I don't want to break my machine while messing around with packages.
/usr/bin/ld: cannot find -lglib-2.0
/usr/bin/ld: cannot find -lgtk-x11-2.0
/usr/bin/ld: cannot find -lgdk-x11-2.0
/usr/bin/ld: cannot find -latk-1.0
/usr/bin/ld: cannot find -lpangox-1.0
/usr/bin/ld: cannot find -lpango-1.0
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lgmodule-2.0

Also, can one use the GTK module and the proxygadgets at the same time?

Grisu

Last edited 2013


Brucey(Posted 2013) [#2]
GTKMaxGUI is a bit out of date and needs some work. It is currently on my list of things to do.

As for your linker issues, I am assuming you are running a 64-bit Linux?

Either way, you will need to install the "dev" packages for gtk which include library files ending in ".so"
As well as these you may find that a 64-bit OS will also need symlinks made for these files as I've noticed they are not usually provided for the 32-bit side of the dev package.


Grisu(Posted 2013) [#3]
Thanks for the reply Brucey.

I downgraded to Ubuntu 32Bit (see sig) in order to avoid potential bmx issues.

Will gladly wait until you're done with your to-do list. :)

The current MaxGui module "breaks" my translation files and is unable to display bold labels (= font related). With your module these and more aspects should be history.


Brucey(Posted 2013) [#4]
I was recently testing that little file-fetch test app against my new MaxGUI module. Helped me to debug some things :-)

If you want me to test it against the whole app, I wouldn't mind having a go. It may show up some things I am missing in the implementation, etc.


Grisu(Posted 2013) [#5]
You've got mail. :)


Brucey(Posted 2013) [#6]
Thanks!


Brucey(Posted 2013) [#7]
Surprisingly, it is working rather well with QtMaxGUI..

I say surprisingly, because I have to admit to being completely surprised just how well it's handling "foreign" (i.e. not mine) code already.

Built on Fedora 17, because my Ubuntu box refuses to play audio at the moment, (running in Parallels on OS X, not that it matters).

I simply changed the Framework line at the top to point to my module instead.
The only thing that failed was the initial mutant splash canvas draw, which threw a DISPLAY error. Commenting out those three lines and the rest ran fine.

Here's some screenshots :

The glowy windows thing is what Fedora does to all windows. I don't like it much. Looks a bit stupid really.


There's even a little star icon in the listbox!


Tooltips and images work. Bold on the label?


A working combobox!




Funny German characters ;-)
I didn't convert any files, although you said I should. I just built it all with the default MaxIDE on Linux.

You'll notice the white border around the button. Dunno what that is meant to look like? Is the whole Window colour meant to change as part of the theme? (I may need to implement that still then).

Otherwise, for something that is only a month old, it's not looking too bad at the moment :-)


Brucey(Posted 2013) [#8]
The FLTK version, which I built initially just to get an idea, I couldn't even use! :-(
I can see why you were having so many problems with it. I had to resize the window just to get stuff to show up on the window (like the buttons, etc).


Grisu(Posted 2013) [#9]
Just came home. Hey, that looks cool! :D

1. Listboxes with icons! Awesome new feature, they don't show up with FLTK. Try to right click on an already selected station and set a new rating. It should display as icon as well.

2. The bold labels display as they should. On the second screen the alignment of the labels isn't correct. Both (Station name and tag id texts) should be "centered".

3. The system font used seems to be wider. Therefore there's a horizontal scrollbar present on the first screen which isn't shown under Mac or Windows.

4. Skins can change both (button images and window colour). Though the default ones included only modify the buttons (no color palette). The button transparency seems to be broken. They should be transparent (around the black borderline). You can set a custom colour via the options menu directly "[ ] [ ]" just for testing purposes.

5. Could you please recheck the Czech translation? The "C" in it was broken for me. Just to be sure.

6. Also, could you please drag and drop a playlist file of any kind onto the prp window. This should bring up the station editor.

7. For the bugged startup screen. Maybe I missed sending the image logo file?

Grisu

Last edited 2013


Brucey(Posted 2013) [#10]
So many things to do, it seems!

1. I need to finish my context/popup menu implementation.

2. I guess I missed out the alignment stuff for labels.

3. It looks bigger on Mac (with QtMaxGUI) too. Perhaps it is the same size on both, as there is a horizontal scrollbar there. Might be a standard thing with Qt.

4. I found the buttons, and managed to make the window pink! hmm..
Well, funnily enough, I tried that blue-win-7 on Mac with both Qt and the default, and they both show the white border. Perhaps a bug in your pngs ;-)

5. The "C" has a little thing above it. All the unicode appears to work correctly. (as it should, I suppose).

6. I haven't implemented drag-and-drop yet!

7. It's something to do with the Canvas drawing at that point in time when the app is starting up. The equalizer stuff works later (mostly). On OS X, the canvas shows okay at the start.
I'm not sure why you really need to use a canvas at all for all your stuff? Are you drawing the station pics on the canvas too?
I'm pretty sure you could cover most things drawing pixmaps onto a panel ? (even the equalizer?)
But anyway…

It generally works the same on OS X too. Well, I had to comment out your TNSGadgetEX thing.
There is such a lot of platform-specific stuff in there. Surely you shouldn't need to hack things so much with a "cross-platform" GUI ? (although depending on who you ask, MaxGUI is the defacto cross-platform GUI!)


Derron(Posted 2013) [#11]

3. It looks bigger on Mac (with QtMaxGUI) too. Perhaps it is the same size on both, as there is a horizontal scrollbar there. Might be a standard thing with Qt.



It might also be a configuration of your theme. GTK apps respect ~/.gtkrc-2.0 , may other guikits use their own overridables.
That is also why a real webdesigner does not rely on "1.0em"-fontsizes nor "12px"-fontsizes as the clients could scale up a website at all - or only the fonts (like it was done years before chrome and iphone safari).

The only way to assure pixel perfect alignment is to use bitmaps and bitmapfonts which you render on the bitmaps by yourself (to avoid systemwide scaling). But as modern approaches to software use floating alignments this is no option.
Ok there is an ulgy option: disable the scrollbars on the window and let the buttons be cut off if they are displaced or wider than supposed.


PS: there is another possibility for wider fonts: antialias. On (x/k/.)Ubuntu and other derivates (mint) you can easily adjust the way the desktop antialiases fonts. Depending on the options (kerning, rgb gbr rbg subpixels...) the font renders look different within the applications.

bye
Ron


Brucey(Posted 2013) [#12]
The bigger issue is the non-scaling of the MaxGUI layout "engine". It's dependent on you telling it where everything should go (x, y).

Better to use something like wxWidgets' and Qt's layout algorithms, which don't care how big a label or button is, as everything lays out nicely according to some basic rules.


Grisu(Posted 2013) [#13]
Faulty buttons: Will redo the skin.

Splash Screen: I was forced to redo the startup process because I couldn't get it to work on all platforms. Linux/Mac don't like it if you create a hidden panel on startup.

Canvas vs Panel: In former versions I used panels. But setting pixmaps on them frequently caused a huge memory leak under Mac. That way a got some bad reviews on the former PRP port.

I also needed a canvas in order to display the more specialised spectrum analyser (right mouse click on a station logo).

I hope you can iron out the last bits and pieces.


Brucey(Posted 2013) [#14]
But setting pixmaps on them frequently caused a huge memory leak under Mac

Which would be a bug in MaxGUI on OS X?

Probably better to get a bug fixed than to have to start using a completely different form of displaying an image. ;-)


Grisu(Posted 2013) [#15]
I'm not good at fixing stuff. I'm better at breaking it... ;)

If you want to recheck the potenial bug. The current Windows code still uses panels for the small spectrum analyser. It's the same code that causes the memory issue under different Mac platforms. I could also send you some older code for this.

BTW: You were right on the skin. Somehow the images dropped down to 256 colours. I've fixed these and on top added a new Fedora skin. They can be grabbed here: http://www.mediafire.com/?s6htb76a4bhc770

Finally weekend!


Brucey(Posted 2013) [#16]
I seem to have managed to get popup windows working…



I was actually expecting it to be somewhat of a pain, but it appears my hacky code did the job first time :-)

I also implemented label content alignment.

The listbox has a strange habit, when you are far down the list and right-click, it jumps to the first item. Perhaps a bug of mine somewhere… :-/
edit : which turned out to be because I hadn't implemented ClearListItems() yet!


Grisu(Posted 2013) [#17]
Great progress!

Do you use my updated skin file? - The transparency seems to be broken on th icon buttons and the listbox icons as well ("white borders").

You also changed the font, right? Much more readable now. If I can identify the station names that are too long, I will shorten them in later versions, so we dont see a horizontal scrollbar on the listbox.

So all that is missing from being the ueber gui module is the drag & drop feature? :)


Brucey(Posted 2013) [#18]
I downloaded the skin file but haven't tried it yet. :-/

Didn't change the font. That latest image was the OS X build (my main dev platform).

I'm currently hacking in some drag and drop stuff to see what happens next ;-)


Grisu(Posted 2013) [#19]
Hopefully nothing will explode. ;) *ducks behind his desk*

For the listbox:
In a later version it would be great to have a kind of "AddListItemsBatch" function. I got it for Windows but couldn't get it to work under Linux/Mac. The idea is that you add tons of items to a listbox and only update/redraw the box at the end of the process. This speeds up the creation drastically (in comparison to the native function set).


Brucey(Posted 2013) [#20]
Well, that's one of the problems with MaxGUI: When you are adding an item to the listbox, it is doing lots of stuff as well as adding it to the listbox.
I think if you were calling it natively (i.e. actually just adding to the listbox in a for-loop) it wouldn't redraw until you were done, because of the nature of everything happening in the main thread.

So, how do I test this drag&drop thing? What can I drag into it?


Grisu(Posted 2013) [#21]
You can use http://www.shoutcast.com/ to download a .pls file. Just make sure its an mp3 stream (for Fmod restrictions).

Edit: Or take this one: http://www.mediafire.com/?c9e7nlhyumpcu8d

Save it to the desktop and drop it onto the main window. The station editor should show up.


Brucey(Posted 2013) [#22]
Ahhh, cool. I dropped it onto the window and got this :



The combo box appears to contain the content of the pls file.

I also tried one out of the stations folder and nothing happened, which is probably what should happen ;-)

So, I think my drag&drop is working now. Excellent! :-)


Edit : clicking on the [..] brought up a browser window. This is for custom logos, I presume?


Grisu(Posted 2013) [#23]
Drag & drop should work from all folders/desktop. At least it does under Windows.

Can you increase the editor window? It should bring up a genre selection box as well.

The [..] is for selecting / pointing to a custom logo (not inside the creator folder already).

P.S: The prp file will be created and started / played afer you hit the "save" button.


Brucey(Posted 2013) [#24]
Well, I think that because the prp file that I dragged in already existed it didn't try to add it again? (I dragged from the app's stations folder)

It does indeed have a genre box :-)



But when I resize the window, all the wrong things move… either you have set your anchor points wrong, or my gui code is broken… the other "pages" resize with their controls as expected. Hmm.


Brucey(Posted 2013) [#25]
Question. Should the window be resizing itself when I switch pages? Or is this for the user to do?


Grisu(Posted 2013) [#26]
You shouldn't be able to widen the window.

But apart from that there's definately something broken.
The issue is also present in the MaxGui module. :/
Under Windows it works... :P

Need to get some rest. Will be back tomorrow. Thanks for all your efforts!

Edit: Only the user should be able to change the window size! You can also save it in the options menu.


Brucey(Posted 2013) [#27]
There's a bug in your anchors :-p

You have :
SetGadgetLayout Creator_LogoBox, EDGE_ALIGNED,EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED 

should be :
SetGadgetLayout Creator_LogoBox, EDGE_ALIGNED,EDGE_ALIGNED, EDGE_ALIGNED, 0 

otherwise, when you resize the window, it wants to increase the height of the combobox.

Is there some code where you fix the maximum width of the window? (maybe I have still to implement that).


Brucey(Posted 2013) [#28]
One thing I noticed while testing, is that you load the station listbox *twice*.
I know this because my "clear" wasn't working, and so my listbox had 2 of everything.

I think it will be more quick to populate if you only populate it once, rather than populate-clear-populate ;-)
Unless of course you really need to do that!


Grisu(Posted 2013) [#29]
You're right about the anchor.

Line 446+47 are used to fix the window borders:
SetMinWindowSize(MainWindow,MAINWINDOW_W,MAINWINDOW_H)
SetMaxWindowSize(MainWindow,MAINWINDOW_W,DesktopHeight())


I think you can uncomment line 2548+49. Both functions are called twice for reasons I can't remember. Guess it was a temporary bugfix years ago.
'Load_db() 'new!!!
'PopulateList(0,0)

Will add some new radio stations within the next 2 hours. So you can also retest the updater... 8)


Brucey(Posted 2013) [#30]
I've now implemented min/max size and other window things, so it now will only resize the height, which is much better, me thinks.

Commenting out those lines does make it start up a bit more quickly.

I also updated, and it worked well. No pausing or anything - which is the way you want it ;-)
And then I double-clicked on one of the new stations in the tree-view, and it started playing it from there.

So, I'm quite happy with the state of QtMaxGUI now - at least with regards to having enough functionality to cope with your app. Cool :-)


Grisu(Posted 2013) [#31]
What about the initial start up. Does it display the logo and panels correctly?

Updated the stations files again. Just to keep my FB gang happy... :)

My app is a Dinosaur, if it can handle that, it can rule the world. ;)

Does your GUI work under Windows too or is it Mac/Linux only?


Brucey(Posted 2013) [#32]
This font size on Fedora 17 is the default, which is a couple of points larger than you were expecting :



I also noticed an issue on Linux with your panel cleanup after you double-click on an item from the update treeview :



As you can see, it doesn't clear the treeview panel properly. But if you click the bottom-right icon through a few pages, when you get back to the main listbox view it sorts itself out. Then you can go to the station logo page and back again without the issue recurring - until you launch a station from the treeview again.
Maybe you are missing some panel hide/show code from that action?


Grisu(Posted 2013) [#33]
I could increase the window width to keep up with the 17p font size. That's the only solution I can think of. Setting another smaller font would mean that the user has to install them first.

I really hate these panel issues..

Can you send me your temp code with the current changes? I can then reenable the panel spectrum analyser. This way you can check if the memory leak is still present with your gui.


Brucey(Posted 2013) [#34]
Does your GUI work under Windows too or is it Mac/Linux only?

All my modules cover the three BlitzMax platforms, unless otherwise stated :-)
I just happen to dev on OS X - since it is my preferred of the 3.

Not sure how it would cope with all you platform-specific MaxGUI hacks though :-p

What about the initial start up. Does it display the logo and panels correctly?

Not yet. I'm thinking perhaps the window isn't initialised properly at that point, or something. The error indicates as such - well, it works later when you start a station playing.


Brucey(Posted 2013) [#35]
I'm thinking perhaps the window isn't initialised properly at that point

Putting in a small loop which calls PollEvent just before the SetGraphics() call seems to confirm that theory. The window is not yet in a state to attach a GL context to it. Once it is, the context attaches fine - although it doesn't appear to show anything before it has finished loading everything else.

The little spectrum analyser also has some graphical glitches - It may of course be that my Linux code needs a tweak here? Dunno. It's still early days ;-)


Grisu(Posted 2013) [#36]
Will try to solve the treeview panel bug tomorrow.


Brucey(Posted 2013) [#37]
A little more information :

I also notice the same multi-panel display issue when I try to load a station but it has an error (perhaps the station isn't on, etc). Then your program gets confused, I think, and it doesn't know which panel to show, so it shows a few together :-)


Grisu(Posted 2013) [#38]
Hi,

Linux causes problems for my gfx card but these changes might work:

Treeview Fix: Line 1425
Case EVENT_GADGETACTION
(..)
add: SwitchtoPanel(0) 'New For Brucey
(right before "If SelectedGadgetItem(StationListbox) <> -1")


Loading Fix: Lines 3264..
Case Button_load_stop
(..)
add: SwitchtoPanel(0) 'New For Brucey


Loading Fix: Lines 3291..
Case Button_load_back 
(..)
uncomment: 'ShowGadget (StationPanel)
uncomment: 'ActivateGadget StationListbox
add: SwitchtoPanel(0) 'New For Brucey


You can use "106.3 The Longe" for testing purposes as this station is currently down.


Grisu(Posted 2013) [#39]
As compromise: Would it be enough to only increase the global window with just a bit. This way I could add an extra button to the station list panel so the users can bring up the station creator directly i.e.?

Really not sure what to do best in regards to the bigger Mac font.


Brucey(Posted 2013) [#40]
I dunno… I'm not so hot on UI design myself ;-)

That scrollbar is really bugging you, huh? :-P

Is the font smaller on the default MaxGUI in OS X? I know I had to specifically make the tabber font smaller in QtMaxGUI to match the "small" sized used by the default MaxGUI.


Grisu(Posted 2013) [#41]
Yeah, but only horizontal ones... ;)

Default GUI Mac font is a LOT smaller. See here:


The bigger font causes issues with my labels sizes. As for the progress bar for instance. So I'd prefer a smaller font as default.


Derron(Posted 2013) [#42]
Can't you adjust the displayed text by truncating it until its graphical width is lower than the space the label gadget got?

Do not rely on Fontsizes as there are some possibilities to modify them externally. Just rely on the dimensions of the graphical result.


bye
Ron


Grisu(Posted 2013) [#43]
Labels truncate automatically (the other chars aren't displayed).

The idea is to give the user more informations instead of just shorter texts.

For the progress bar I needed 2 labels 1 for the status text (algn left) and the other one for the "%" (algn right).


Brucey(Posted 2013) [#44]
The fonts in the listbox actually look very similar in size :



Maybe there's an option (used in the Cocoa MaxGUI) to disable the horizontal scrollbar? I'll have a dig around...


Grisu(Posted 2013) [#45]
Horizontal scrollbar:
Seb implemented flags (SCROLLPANEL_HNEVER, SCROLLPANEL_VNEVER) to prevent this inside the "CreateScrollPanel" function. Perhaps you can adopt his code?

If this is too much hassle I just need to find out which station names are too long and truncate them accordingly. So the scrollbar shouldn't appear. It's not worth investing tons of hours into this matter.

Update Progressbar:
For a larger progressbar %-label change line 900 from:
 
Global label_upd1:TGadget=CreateLabel:TGadget("",2,LABEL_STARTY,MAINWINDOW_W-6-30,16,UpdatePanel,Label_LEFT) 
Global label_upd3:TGadget=CreateLabel:TGadget("",2+(MAINWINDOW_W-6-30),LABEL_STARTY,30,16,UpdatePanel,Label_RIGHT)

to:
 
Global label_upd1:TGadget=CreateLabel:TGadget("",2,LABEL_STARTY,MAINWINDOW_W-6-40,16,UpdatePanel,Label_LEFT) 
Global label_upd3:TGadget=CreateLabel:TGadget("",2+(MAINWINDOW_W-6-40),LABEL_STARTY,40,16,UpdatePanel,Label_RIGHT) 

This was the text should now display properly.

Btw: Did the code before fix the multipanel issue?


Brucey(Posted 2013) [#46]
Btw: Did the code before fix the multipanel issue?

Mostly :-)

Except when a station doesn't load :



It sits for a moment with 4 empty buttons in the bottom left, then it gets confused and tries to show lots of different panels at the same time :-)

The "start music from treeview" is working fine now. It resets itself to show the correct panels.


Grisu(Posted 2013) [#47]
Argh, these screenshots hurt. *gets his code shovel*

I updated the station files so that the longest station name is now 34 chars long. Please update and see if the horizontal scrollbar is gone.


Grisu(Posted 2013) [#48]
Ok! Thanks to your description I think I have it. I missed the loading panel to be hidden via my main panel function. :(

Just add a "HideGadget (LoadingPanel)" for each case of Showpanel or replace the full SwitchtoPanel() function (around Line 5068) with the one from below:



Also at the very and of TuneIn_RadioStation():
Around line 3445 add:
SwitchtoPanel(1) 'For Brucey NEW 
(before ActivateGadget ServerListbox)

some Lines before change: 
'HideGadget(LoadingPanel)
SetGadgetPixmap (LoadingStationPanel, Null)
'ShowGadget(MainPanel)



Grisu(Posted 2013) [#49]
Any news about the gtk module?


Brucey(Posted 2013) [#50]
No news is good news? :-|

*cough*


Grisu(Posted 2013) [#51]
Can I download the new module somewhere? On SVN there's still the old one.