Page 38 of 42

Re: Can't compile gtkdialog.gtk rev 505

Posted: Mon 01 Apr 2013, 11:49
by simargl
.

Posted: Mon 01 Apr 2013, 13:24
by pemasu
Absolutely off topic.
I downloaded in Upup Raring shimmer themes which have matching gtk2 and gtk3 themes involved, stripped unneeded stuff out. It needs murrine engine which is not included in the attached pet. Check 01micko`s in previous page and ubuntu - debian based Puppies can download it with PPM.
I did hack the involved codes so that every gtk2 - gtk3 theme has wider slider-width. The default one was so tiny.

I didnt involve the stuff Thunor posted earlier for gtk3 theme support.

I think that 01micko`s hacked, Barry`s original wrapper file, gtk_chtheme_wrapper does not update the gtk-theme-name in /root/.config/gtk-3.0/settings.ini file.

So...the gtk2 and gtk3 are not changed unifiedly. Or then I have understood something wrong, which happens every hour in my life.
I do have /root/.config/gtk-3.0 folder and settings.ini and gtk.css files inside the folder, but the gtk-theme-name row just dissappears when using the wrapper file. Other info is there, just the gtk-theme-name row vanishes.

Code: Select all

#!/bin/sh
#(c) Copyright Barry Kauler April 2013, bkhome.org
#license GPL3 (see /usr/share/doc/legal).
#130329 first release.
#130401 01micko: preliminary gtk3 support.

gtk-chtheme

#make Qt4 apps theme match gtk2...
#see also /etc/profile.d/pup_gtk and /root/.config/Trolltech.conf
#/root/.gtkrc-2.0 typically looks like this:
## -- THEME AUTO-WRITTEN DO NOT EDIT
#include "/usr/share/themes/Polished-Blue/gtk-2.0/gtkrc"
#
#include "/root/.gtkrc.mine"
#
## -- THEME AUTO-WRITTEN DO NOT EDIT
CURRGTKTHEME="$(grep '^include "/usr/share/themes/' /root/.gtkrc-2.0 | cut -f 5 -d '/')" #'geany  ex: Polished-Blue
THEREBEFORE="$(grep '^gtk-theme-name' /root/.gtkrc-2.0)"
if [ "$THEREBEFORE" = "" ];then

 echo "gtk-theme-name=\"${CURRGTKTHEME}\"" >> /root/.gtkrc-2.0

 #130401...
 # gtk3 theme support thunor http://murga-linux.com/puppy/viewtopic.php?p=695722#695722
 pathGTK3THEME="`find /usr/share/themes/${CURRGTKTHEME} -type d -name gtk-3.0`"
 if [ "$pathGTK3THEME" ];then #XDG_CONFIG_HOME=/root/.config
  [ -d ${XDG_CONFIG_HOME}/gtk-3.0 ] || mkdir -p ${XDG_CONFIG_HOME}/gtk-3.0
  [ -f ${pathGTK3THEME}/settings.ini ] && cp -af ${pathGTK3THEME}/settings.ini $XDG_CONFIG_HOME/gtk-3.0/ || echo -e "[Settings] \ngtk-theme-name = \"${CURRGTKTHEME}\" \ngtk-fallback-icon-theme = \"gnome\"" > $XDG_CONFIG_HOME/gtk-3.0/settings.ini
  #[ -f ${pathGTK3THEME}/gtk.css ] && cp -af ${pathGTK3THEME}/gtk.css $XDG_CONFIG_HOME/gtk-3.0/ ||\# doesn't work
  echo "" > $XDG_CONFIG_HOME/gtk-3.0/gtk.css
 fi
fi

Posted: Mon 01 Apr 2013, 13:41
by pemasu
To be continued from previous post:

/usr/bin/gtk-chtheme-wrapper executed with -x in console:
+ echo 'gtk-theme-name="Greybird"'
++ find /usr/share/themes/Greybird -type d -name gtk-3.0
+ pathGTK3THEME=/usr/share/themes/Greybird/gtk-3.0
+ '[' /usr/share/themes/Greybird/gtk-3.0 ']'
+ '[' -d /root/.config/gtk-3.0 ']'
+ '[' -f /usr/share/themes/Greybird/gtk-3.0/settings.ini ']'
+ cp -af /usr/share/themes/Greybird/gtk-3.0/settings.ini /root/.config/gtk-3.0/
+ echo ''
/usr/share/themes/Greybird/gtk-3.0/settings.ini does not include gtk-theme-name and you cant even put it there. Tested, gtk3 apps just hungs until you remove the row.

Something else is needed. Would sed command be useful for inserting the gtk-theme-name from /root/.gtkrc-2.0 file.

Posted: Mon 01 Apr 2013, 13:44
by simargl
.

Posted: Mon 01 Apr 2013, 13:54
by pemasu
simargl.
http://bkhome.org/blog2/?viewDetailed=00196

http://bkhome.org/fossil/woof2.cgi/info/0879c4b3a1
Who told you that hacking gtk-chtheme is only way to change gtk3 themes?
No one. I dont even know from whom you heard that I have said that the above is the only one. Yeah....I know....my alzheimer disease and multi-infarct dementia cause black holes to my memory.

Could you provide me the url link where I told it is the only way ?
I would be most grateful and I would even send for you couple of my pills.

Okay...I know how to change the gtk3 themes in Puppy now. Just like Thunor showed. It seems simple way in Puppy. And no....I dont explicitly want to know how they do it in Arch. Spare me from it.
I have tested gtk3 theme swapping couple of hours now. Even edited several of those themes a little.

I just gave my 1½ cents to the code Barry Kauler and 01micko created.
I have to admit that your way to start the conversation has bad effect on me....as you can read above.

Posted: Mon 01 Apr 2013, 14:06
by simargl
.

Posted: Mon 01 Apr 2013, 14:52
by pemasu
For matching gtk2 and gtk3 themes this worked for me:

Code: Select all

 #130401...
 # gtk3 theme support thunor http://murga-linux.com/puppy/viewtopic.php?p=695722#695722
 pathGTK3THEME="`find /usr/share/themes/${CURRGTKTHEME} -type d -name gtk-3.0`"
 if [ "$pathGTK3THEME" ];then #XDG_CONFIG_HOME=/root/.config
 rm  $XDG_CONFIG_HOME/gtk-3.0
 ln -s ${pathGTK3THEME} $XDG_CONFIG_HOME
 fi
fi
Yeah....I know....not for multiuser environment, but I have heard that Puppy is....

Posted: Mon 01 Apr 2013, 16:01
by 2byte
This may be of interest for GTK+3 themes

https://developer.gnome.org/gtk3/3.1/Gt ... der-struct
certain files will be read when GTK+ is initialized. First, the file $XDG_CONFIG_HOME/gtk-3.0/gtk.css is loaded if it exists. Then, GTK+ tries to load $HOME/.themes/theme-name/gtk-3.0/gtk.css, falling back to datadir/share/themes/theme-name/gtk-3.0/gtk.css, where theme-name is the name of the current theme (see the "gtk-theme-name" setting) and datadir is the prefix configured when GTK+ was compiled, unless overridden by the GTK_DATA_PREFIX environment variable.

Posted: Mon 01 Apr 2013, 17:42
by thunor
Changes in r507:
  • Added gtk3 specific code to the comboboxtext and comboboxentry widgets so that they now function identically to the gtk2 equivalents.
  • The file selection dialog filename retrieval issue was specific to less than gtk-2.4.0 so I've wrapped it in a macro for those versions.
  • Added "GTK+ 2/3" to the supported libraries list with gtkdialog -v.
  • Added the "column-resizeable" tag attribute to the tree widget.
  • Updated a few wiki/reference pages with new info, fixed bad links.
  • Added helpful error messages when attempting to create combobox, list and table widgets with GTK+ 3.
That's it, although I have yet to compensate for the defunct ~/.gtkrc-2.0 and GTK2_RC_FILES but I can load gtk.css style sheets in gtk3 at runtime which might be fun.

Cheers,
Thunor

Posted: Mon 01 Apr 2013, 21:35
by 01micko
To save all the OT about themes, I have created a thread

All welcome.

Posted: Mon 01 Apr 2013, 21:49
by simargl
.

Posted: Tue 02 Apr 2013, 01:02
by thunor
simargl wrote:
thunor wrote:[*]Added gtk3 specific code to the comboboxtext and comboboxentry widgets so that they now function identically to the gtk2 equivalents.
Does this mean sfs_load will now work with gtk3 because it uses combobox, sorry if this is stupid question I had to ask.
No, it means that in gtk3 some of the comboboxtext/entry functions are named differently and take an additional parameter and I had to compensate for that. I then checked them to make sure that they behave identically in gtk2 and gtk3.
simargl wrote:Here is how I named gtkdialog binaries in alphaos:
version 0.8.3 installed as /usr/bin/gtkdialog2
gtkdialog3 and gtkdialog4 are symbolic links pointing to this version

version svn504 installed as /usr/bin/gtkdialog

Idea for this came from python package in Archlinux, where older version 2.7 is named python2, and new version 3.3 is just python - I think that make sense.

Cheers!
I create gtkdialog. It is not my business what people rename it to. Those incrementing numbers trailing gtkdialog are not directly related to gtkdialog's version number. You need to talk to the people who rename it.

Regards,
Thunor

Posted: Tue 02 Apr 2013, 09:13
by simargl
.

Posted: Tue 02 Apr 2013, 09:47
by scsijon
thunor wrote:
zigbert wrote:...
Puppy apps will make it into the future.
It had to be done didn't it. The gates to gtk3 are now open for Puppy apps and Puppy itself although it may yet be discovered that gtk2 is worth staying with :P
.
.
.
There will likely be some tweaking involved.
Just because gtk3 is appearing is not a reason to abandon gtk2!

In some cases, gtk2 will always be the better option.

Having worked with both mageia while building mage2, and my work with opensuse which goes back to the early SuSE 6 days, both have the two gtk's operating.

I see them as being not exclusive, with one totally replacing the other, but complementory as is gtkdialog3 and gtkdialog4 within puppy.

By the way, QT4 / QT5 compiled for gtk2 needs to be recompiled if gtk3 is used in any way as are quite a number of other libs, it won't be a simple task!


scsijon

Posted: Tue 02 Apr 2013, 11:09
by thunor
simargl wrote:
thunor wrote:I create gtkdialog. It is not my business what people rename it to.
Sorry, I thought you'd care. And you do great job at creating gtkdialog. Bye
It's not about caring, it's about the fact that there are people (or person) who specifically choose/set the names of the gtkdialog binaries and [Puppy] developer's scripts look for these names and it doesn't involve me, so it's not my business giving you advice or expressing an opinion on your own naming scheme however much thought you may have put into it :) I recommend that you discuss this with somebody who assembles a Puppy distro/flavour.

Try web searching "gtkdialog2 gtkdialog3 gtkdialog4 gtkdialog5" and you should find everything you need to know within the first few posts.

Regards,
Thunor

Posted: Wed 03 Apr 2013, 05:23
by zigbert
Thunor
I tested the new column-resizable <tree> option, but could not get it to work.
I wonder, does this option require gtk3?

Image

Code: Select all

gtkdialog -v > /tmp/gtkdialog_input

echo '
<vbox>
 <tree column-resizable="false|false|false">
  <label>"First column|Second column|Third column"</label>
  <input file>/tmp/gtkdialog_input</input>
  <width>600</width>
 </tree>
</vbox>' | gtkdialog -s

Sigmund

Posted: Wed 03 Apr 2013, 09:18
by thunor
Hi Sigmund

Try column-resizeable. I've checked that it works in both gtk2/3 and it does.

Let me know how you get on because I can tweak things to a degree.

Regards,
Thunor

Posted: Wed 03 Apr 2013, 10:55
by zigbert
Okeeey, I see
...It works how you intended, but not the way I expected.... :)
The column is now not resizable, but it still auto-widen the column to fit content. As I understand it, gtk-tree-view-columns-autosize should handle this, - not the resizing done by the user.

This example should explain the difference between <tree> and <table>

Code: Select all

gtkdialog -v > /tmp/gtkdialog_input

echo '
<vbox>
 <tree column-resizeable="false|false|false">
  <label>"INPUT defines width of column|Second|Third"</label>
  <input file>/tmp/gtkdialog_input</input>
  <width>600</width>
 </tree>
 <table>
  <label>"HEADER defines width of column|Second|Third"</label>
  <input file>/tmp/gtkdialog_input</input>
 </table>
</vbox>' | gtkdialog -s

Sigmund

Posted: Wed 03 Apr 2013, 13:01
by thunor
@Sigmund

These are the column properties but you can't set them, I have to create custom tag attributes for them:
https://developer.gnome.org/gtk2/2.24/GtkTreeViewColumn.html#GtkTreeViewColumn.properties

I'll have a play with them and see if I can set the width by column header label rather than the contents of the row, or simulate it somehow.

Cheers

Posted: Thu 04 Apr 2013, 17:03
by zigbert
Thunor
I am hoping for the best.
This might sound like a minor issue, but the fact is that this behavior makes pMusic still choose <table> over <tree>. And keep in mind that using the <tree> widget would give icons, doubleclick and a right-click menu.

It must be mentioned that a secondary solution would be to update column width when the <tree> widget is updated. - So that the column width decreases if content has become narrower.


Thank you for your effort!
Sigmund