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 Sat 19 Apr 2014, 21:13
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 37 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 35, 36, 37, 38, 39, ..., 53, 54, 55 Next
Author Message
thunor


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

PostPosted: 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>
strnatcmp1.png
 Description   
 Filesize   2.96 KB
 Viewed   636 Time(s)

strnatcmp1.png

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 05 Sep 2012, 13:00    Post subject:  

Quote:
Fixed leading zero issue with strnatcmp.
Wonderful!
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7547
Location: qld

PostPosted: 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 Wink )

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

_________________
Woof Mailing List | keep the faith Cool |
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 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. Twisted Evil

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
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: 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 Wink )

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 Razz 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
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: 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 */
          }
       }

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
zigbert


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

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


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

PostPosted: Fri 07 Sep 2012, 13:01    Post subject:  

I see Crying or Very sad

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... Very Happy


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


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

PostPosted: 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
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 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
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: 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.
expander.png
 Description   
 Filesize   4.42 KB
 Viewed   354 Time(s)

expander.png


Last edited by thunor on Thu 13 Sep 2012, 13:44; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 37 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 35, 36, 37, 38, 39, ..., 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.0968s ][ Queries: 12 (0.0122s) ][ GZIP on ]