The time now is Sun 22 Apr 2018, 16:35
All times are UTC - 4 |
Page 37 of 56 [833 Posts] |
Goto page: Previous 1, 2, 3, ..., 35, 36, 37, 38, 39, ..., 54, 55, 56 Next |
Author |
Message |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Wed 05 Sep 2012, 12:17 Post subject:
|
|
r407:
- Fixed leading zero issue with strnatcmp.
- Added the "freeze-thaw" tag attribute to the table widget to stop rendering when adding data and to resume rendering when finished.
- Added save action function support to the tree widget.
Test data:
Code: |
<item>"0 |0|00| 0"</item>
<item>"1|01| 1|1 "</item>
<item>"02| 2|2 |2"</item>
<item>" 3|3 |3|03"</item>
<item>"4 |4|04| 4"</item>
<item>"10|010| 10|10 "</item>
|
Description |
|
Filesize |
2.96 KB |
Viewed |
745 Time(s) |

|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Wed 05 Sep 2012, 13:00 Post subject:
|
|
Quote: | Fixed leading zero issue with strnatcmp. | Wonderful!
_________________ Stardust resources
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8670 Location: qld
|
Posted: Wed 05 Sep 2012, 18:38 Post subject:
|
|
Couple of Q's
@thunor
1) Approxamately, how far will you go in this dev cycle? (I guess until you are tired of it )
2) Do you think much, if any, backward compatibility will be broken? (apart from bad code)
@ziggy
Slackware14 is knocking on the door, next Slacko will be a month or so behind. What obstacles do you see in including the latest rev at the time in the next beta?
-
TIA guys
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Thu 06 Sep 2012, 11:03 Post subject:
|
|
Mick
Quote: | What obstacles do you see in including the latest rev at the time in the next beta? | No one.
Thunor has removed the *_ALL variable at exit, which sure breaks backward compatibility. But I don't know any script using it, so go johnny, go go go.
I don't plan any new releases that depends on gtkdialog 0.8.1 in the nearest future. It would be great if Slacko had 0.8.1, so later updates of the pSeries would be smooth. I see slacko has ffmpeg 0.11 which supports tagging of albumart into the audiofile. Maybe pMusic 3 will take advantage of that. Let's see. pMusic 3 will not be ready in 1 month. - For sure.
Looking forward to a new Slacko !!!
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Thu 06 Sep 2012, 13:28 Post subject:
|
|
01micko wrote: | 1) Approxamately, how far will you go in this dev cycle? (I guess until you are tired of it )
2) Do you think much, if any, backward compatibility will be broken? (apart from bad code) |
1) When it turns into a chore is a good time to stop but I'm still having fun and there's not much left I want to add/fix at this time. I might've finished with it in a week so I'll make an 0.8.2 source package release and it would be nice if you could build that for inclusion into slacko.
2) The *_ALL envvars that were being exported were ruining widgets that contained lots of data so I've disabled that but it's not being used in any examples and I'm not sure anyone even knows about it. I haven't changed the default behaviour of anything or fixed something that could cause erroneously written apps to break so I can't see that there'll be a problem.
Cheers Mick.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4786 Location: Kingwood, TX
|
Posted: Thu 06 Sep 2012, 15:37 Post subject:
|
|
I figured out a more cross-platform way to do autorefresh:
(my previous implementation may be faster on linux, but won't work on systems without inotify like bsd, solaris, unix, mac or windows)
Code: | --- src/widget_pixmap.c~ 2012-09-06 13:18:44.189883986 +0800
+++ src/widget_pixmap.c 2012-09-06 13:13:03.901816603 +0800
@@ -61,6 +61,8 @@ void widget_pixmap_clear(variable *var)
/***********************************************************************
* Create *
***********************************************************************/
+void autorefresh(GFileMonitor *monitor, GFile *file, GFile *to_file, GFileMonitorEvent event, gpointer image){
+ gtk_image_set_from_file( GTK_IMAGE(image), g_file_get_path(file));}
GtkWidget *widget_pixmap_create(
AttributeSet *Attr, tag_attr *attr, gint Type)
{
@@ -136,6 +138,9 @@ GtkWidget *widget_pixmap_create(
widget = gtk_image_new_from_file("");
}
}
+/* Note that this autorefresh is on by default - should add another tag_attr */
+ g_signal_connect(g_file_monitor_file(g_file_new_for_path(find_pixmap(file_name)),
+ G_FILE_MONITOR_NONE, FALSE, NULL), "changed", G_CALLBACK(autorefresh),(gpointer) widget);
break; /* Only one image is required */
}
}
|
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Thu 06 Sep 2012, 16:19 Post subject:
|
|
Working with the new sort-features in <table> is really great - simple and fast.
When it comes to right-click-menu, it suffers from rigid selection mode in <table>. You have to first select the row with a left-click before clicking right button to show the menu. Not the best usability... - But worst, <action> HAS TO be executed before <action signal="button-press-event">
Sigmund
Code: | #!/bin/sh
echo -e "1|2|3|4\n10|20|30|40" > /tmp/list
menu (){
#external menu
if [ $PTR_BTN = 3 ]; then
echo -n > /tmp/OUTPUT
if [ "$TABLE" ]; then
export gtkdialog_menu='
<window title="menu" decorated="false" height-request="90" skip_taskbar_hint="true">
<vbox spacing="2">
<button height-request="20" xalign="0" can-focus="no" relief="2"><label>" command 1 "</label><action>echo 1 > /tmp/OUTPUT</action><action>EXIT:exit</action></button>
<button height-request="20" xalign="0" can-focus="no" relief="2"><label>" command 2 "</label><action>echo 2 > /tmp/OUTPUT</action><action>EXIT:exit</action></button>
<button height-request="20" xalign="0" can-focus="no" relief="2"><label>" command 2 "</label><action>echo 3 > /tmp/OUTPUT</action><action>EXIT:exit</action></button>
<button height-request="20" xalign="0" can-focus="no" relief="2"><label>" command 2 "</label><action>echo 4 > /tmp/OUTPUT</action><action>EXIT:exit</action></button>
</vbox>
<action signal="focus-out-event">EXIT:exit</action>
</window>'
gtkdialog -p gtkdialog_menu -G +"$(($PTR_X_ROOT-5))"+"$(($PTR_Y_ROOT-5))" > /dev/null
OUTPUT=($(<"/tmp/OUTPUT"))
case "$OUTPUT" in
1) gxmessage 1;;
2) gxmessage 2;;
3) gxmessage 3;;
4) gxmessage 4;;
esac
fi
fi
}
export -f menu
export win='
<window>
<vbox>
<table sort-function="1" column-visible="false|true" hscrollbar-policy="2">
<variable>TABLE</variable>
<height>100</height><width>120</width>
<label>"1 |2 |3 |4 "</label>
<input file>/tmp/list</input>
<action signal="button-press-event">menu</action>
<action>echo $TABLE</action>
</table>
</vbox>
</window>
'
gtkdialog --program=win |
_________________ Stardust resources
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Fri 07 Sep 2012, 07:51 Post subject:
|
|
zigbert wrote: | ...
When it comes to right-click-menu, it suffers from rigid selection mode in <table>. You have to first select the row with a left-click before clicking right button to show the menu. Not the best usability... - But worst, <action> HAS TO be executed before <action signal="button-press-event"> |
With the table widget, left-click de/selects rows, the right mouse button does nothing except fire signals. The table widget does not utilise the right mouse button so it has no effect on the contents of the table.
if [ "$TABLE" ]; then will be false if nothing is selected so if you want to show the menu whether there's something selected or not then remove that code.
Gtk is responsible for the order that signals are fired and this is what happens when clicking on a table row and selecting it:
Code: | button-press-event
button-release-event
select-row
|
... so that's the order that actions using those signals will be executed.
I made a couple of modifications to your menu code and I got something that mimmicks the behaviour you'd expect from a pop-up menu:
Remove if [ "$TABLE" ]; then.
Add modal="true" to the window tag because currently it's not receiving the focus:
So now you've got a simulated menu pop-up on table right-click that closes when it loses the focus. If you want to modify the contents of the menu based upon the table's selected rows then that information will be in $TABLE.
Regards,
Thunor
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Fri 07 Sep 2012, 13:01 Post subject:
|
|
I see
That means it is not possible to show a right-click menu for a specific row without first select it with left-click.
Well well, limits are the challenge that brings new ideas to the world...
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Sat 08 Sep 2012, 07:21 Post subject:
|
|
The new eventbox widget is cool.
You can now make an action to a pixmap......
_________________ Stardust resources
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Sat 08 Sep 2012, 09:04 Post subject:
|
|
Added an eventbox widget
Gtk properties: GtkEventBox.properties
Widget reference: eventbox widget
Example: examples/eventbox/eventbox
Description: A widget used to catch events for widgets which do not have their own window (background) and because it has its own window it can be painted pretty colours or tiled with wonderful images.
As Sigmund stated above, pixmaps can now respond to events but equally as useful is being able to show a background image so there are likely lots of applications for this.
This widget -- like the window widget -- expects only one child so you might want to place something like an hbox or vbox inside it.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Sun 09 Sep 2012, 06:44 Post subject:
|
|
Thunor
I wonder, would it be troublesome to add your great sort-function="0/1/2" to the <tree> widget?
As is, sorting <tree> by clicking column-headers is useless when it comes to numbers.
Thank you
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Wed 12 Sep 2012, 20:11 Post subject:
|
|
In r422:
- Added the "column-type" tag attribute to the tree widget to support setting int64, uint64, double and string data types (issue 35 - Disciple).
- Added the "selected-row" tag attribute to the tree widget to enable selecting a default row on initialisation and refresh.
- Removed the tree widget's default indentation in column 0.
- Added the "column-header-active" and "column-visible" tag attributes to the tree widget enabling column-header locking and column hiding.
- Tidied-up the tree widget's signal handling and added support for the selection object's "changed" signal.
zigbert wrote: | I wonder, would it be troublesome to add your great sort-function="0/1/2" to the <tree> widget? |
I'll have a look at this next. If you're thinking of using the tree widget then look at what I've done above because it's comparable to the recent table updates.
Regards,
Thunor
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Thu 13 Sep 2012, 13:32 Post subject:
|
|
Added an expander widget
Gtk properties: GtkExpander.properties
Widget reference: expander widget
Example: examples/expander/expander
Description: A container which can hide its child; typically used to hide advanced sections in preferences dialogs but with a little creativity could be used to make a tree like structure with branches.
Description |
|
Filesize |
4.42 KB |
Viewed |
460 Time(s) |

|
Last edited by thunor on Thu 13 Sep 2012, 13:44; edited 1 time in total
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1447 Location: Ukraine
|
Posted: Thu 13 Sep 2012, 13:41 Post subject:
|
|
Dear thunor,
What can I say? you are doing great stuff and I thank you for it.
With kind regards,
vovchik
|
Back to top
|
|
 |
|
Page 37 of 56 [833 Posts] |
Goto page: Previous 1, 2, 3, ..., 35, 36, 37, 38, 39, ..., 54, 55, 56 Next |
|
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
|