Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 20 Apr 2014, 07:10
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Gtkdialog Development
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 52 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 50, 51, 52, 53, 54, 55 Next
Author Message
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Wed 03 Apr 2013, 01:23    Post subject:  

Thunor
I tested the new column-resizable <tree> option, but could not get it to work.
I wonder, does this option require gtk3?



Code:
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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 03 Apr 2013, 05:18    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Wed 03 Apr 2013, 06:55    Post subject:  

Okeeey, I see
...It works how you intended, but not the way I expected.... Smile
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:
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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 03 Apr 2013, 09:01    Post subject:  

@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
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Thu 04 Apr 2013, 13:03    Post subject:  

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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Sat 06 Apr 2013, 12:17    Post subject:  

svn510
column-width works great Very Happy
Thanks a lot


pMusic 4 - here we go
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sat 06 Apr 2013, 12:18    Post subject:  

@Sigmund

In revision 512:

column-sizing="mode|mode|mode|...".

This is a combination of the sizing and width properties:

  • If mode is 0 or "" then column grows as default (GTK_TREE_VIEW_COLUMN_GROW_ONLY)
  • If mode is 1 then column autosizes i.e. grows and shrinks (GTK_TREE_VIEW_COLUMN_AUTOSIZE)
  • If mode is >= 2 then column width is fixed to the value in mode (GTK_TREE_VIEW_COLUMN_FIXED)

Cheers,
Thunor

[EDIT] You posted just before I pressed Submit. I've tweaked it in r511. Anyway, I'm glad it works Smile

Also, "Please note that GTK_TREE_VIEW_COLUMN_AUTOSIZE is inefficient for large views, and can make columns appear choppy".

I haven't documented it yet, wiki/reference update to follow.

[EDIT2] I've renamed it to column-sizing in r512 because it makes more sense naming it that way around.
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Sat 06 Apr 2013, 13:42    Post subject:  

Thunor
Great stuff, just a 'minor' issue...
Using single-click runs <action> when resizing column width.
Example should explain:

Code:
gtkdialog -v > /tmp/gtkdialog_input

echo '
<vbox>
 <text><label>Using signal="button-release-event", action is executed when resizing column width</label></text>
 <tree column-sizing="50|1|1">
  <label>"First|Second|Third"</label>
  <input file>/tmp/gtkdialog_input</input>
  <action signal="button-release-event">gxmessage "hello" &</action>
 </tree>
</vbox>' | gtkdialog -s



Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Sat 06 Apr 2013, 17:56    Post subject:  

Credits to thunor


_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sat 06 Apr 2013, 18:39    Post subject:  

zigbert wrote:
...
Using single-click runs <action> when resizing column width.
...

Nice screenshot Smile I just listened to Tor with the Hammer and I like that.

Are using the button-release-event for a menu? I guess you've gone to bed now but let me know what it is you are trying to achieve with this signal and then we might be able to work something out. You know you can't resize the columns with any other mouse button than 1?

This works fine if this is what you need:
Code:
<action signal="button-release-event">[ $PTR_BTN -eq 3 ] && gxmessage "hello" &</action>

But you know that anyway so I guess it's not what you want.

Cheers,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sun 07 Apr 2013, 18:38    Post subject:  

murga-linux is alive! https://webchat.freenode.net/?channels=puppylinux was fun though Smile
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Mon 08 Apr 2013, 11:32    Post subject:  

Thunor
pMusic will resize column-width nicely, as I have settled on selection-mode="3" for mulitple selections. But, it would also take benefit of a signal="button-release-event" (left-click) if that was possible without interfere with resizing column-width.


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Mon 08 Apr 2013, 12:22    Post subject:  

zigbert wrote:
But, it would also take benefit of a signal="button-release-event" (left-click) if that was possible without interfere with resizing column-width.
Probably not, since single-click is dedicated to selection.


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 08 Apr 2013, 17:39    Post subject:  

My problem is that that's the way the widget is made and there's nothing that I can adjust anywhere.

In gtkdialog, when a widget is created it results in a widget pointer which is stored in an array. Signals are then connected-up, some unique to the widget plus many common signals which are actually part of the base class GtkWidget. The button-release-event signal is simply coming from the tree (GtkTreeView) widget (it's connected to the tree widget's pointer) and I can't modify where it gets emitted from.

Let me know how you get on. Maybe you're already doing it differently now.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5562
Location: Valåmoen, Norway

PostPosted: Tue 09 Apr 2013, 11:57    Post subject:  

Thunor
Nothing to bother about. Everything is working properly.


Thank you a lot for your cooperation!
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 52 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 50, 51, 52, 53, 54, 55 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0816s ][ Queries: 13 (0.0189s) ][ GZIP on ]